core: Convert all cmdline users to veyron2.Init.

This is part of the runtimeX migration.

This CL, depends on vcl/1921, vcl/1922, and vcl/1923.

Change-Id: I72f3adbdea048b2e1599262472e67aa94b86f748
diff --git a/tools/profile/impl_test.go b/tools/profile/impl_test.go
index 75e14d6..891e36d 100644
--- a/tools/profile/impl_test.go
+++ b/tools/profile/impl_test.go
@@ -10,8 +10,6 @@
 	"v.io/core/veyron2/context"
 	"v.io/core/veyron2/ipc"
 	"v.io/core/veyron2/naming"
-	"v.io/core/veyron2/options"
-	"v.io/core/veyron2/rt"
 	"v.io/core/veyron2/security"
 	"v.io/core/veyron2/services/mgmt/build"
 	"v.io/core/veyron2/vlog"
@@ -111,18 +109,15 @@
 }
 
 func TestProfileClient(t *testing.T) {
+	var shutdown veyron2.Shutdown
+	gctx, shutdown = veyron2.Init()
+	defer shutdown()
 	var err error
-	// TODO(ataly, mattr, suharshs): This is a HACK to ensure that the server and the
-	// client have the same freshly created principal. One way to avoid the RuntimePrincipal
-	// option is to have a global client context.T (in main.go) instead of a veyron2.Runtime.
-	runtime, err = rt.New(options.RuntimePrincipal{tsecurity.NewPrincipal("test-blessing")})
-	if err != nil {
-		t.Fatalf("Unexpected error initializing runtime: %s", err)
+	if gctx, err = veyron2.SetPrincipal(gctx, tsecurity.NewPrincipal("test-blessing")); err != nil {
+		panic(err)
 	}
-	defer runtime.Cleanup()
-	ctx := runtime.NewContext()
 
-	server, endpoint, err := startServer(t, ctx)
+	server, endpoint, err := startServer(t, gctx)
 	if err != nil {
 		return
 	}