"core/veyron/tools": Test must run under agent
This Part 2 of a series of changes to make go tests self-contained
and in particular run under an agent.
See: https://vanadium-review.googlesource.com/#/c/1931/
Change-Id: I956a15d7612e16d369c5b4882fa413c7c62aed04
diff --git a/tools/profile/impl_test.go b/tools/profile/impl_test.go
index 30891d3..75e14d6 100644
--- a/tools/profile/impl_test.go
+++ b/tools/profile/impl_test.go
@@ -10,11 +10,13 @@
"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"
+ tsecurity "v.io/core/veyron/lib/testutil/security"
"v.io/core/veyron/profiles"
"v.io/core/veyron/services/mgmt/profile"
"v.io/core/veyron/services/mgmt/repository"
@@ -110,7 +112,10 @@
func TestProfileClient(t *testing.T) {
var err error
- runtime, err = rt.New()
+ // 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)
}