veyron/services/mgmt/device/impl: fix unit test
go/vcl/2608 broke the device manager unit test by renaming the test principal
from test-principal to test-blessing.
Change-Id: I953fd80420b163b82ee13fde5a9bbcb22bdfc583
diff --git a/lib/testutil/init.go b/lib/testutil/init.go
index 9e47b5f..4e328b3 100644
--- a/lib/testutil/init.go
+++ b/lib/testutil/init.go
@@ -22,7 +22,10 @@
"v.io/core/veyron2/vlog"
)
-const SeedEnv = "VEYRON_RNG_SEED"
+const (
+ SeedEnv = "VEYRON_RNG_SEED"
+ TestBlessing = "test-blessing"
+)
// Random is a concurrent-access friendly source of randomness.
type Random struct {
@@ -108,7 +111,7 @@
return ctx, shutdown
}
var err error
- if ctx, err = veyron2.SetPrincipal(ctx, tsecurity.NewPrincipal("test-blessing")); err != nil {
+ if ctx, err = veyron2.SetPrincipal(ctx, tsecurity.NewPrincipal(TestBlessing)); err != nil {
panic(err)
}
return ctx, shutdown
diff --git a/services/mgmt/device/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
index 68ea84a..d146f15 100644
--- a/services/mgmt/device/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -609,7 +609,7 @@
instance1ID := startApp(t, ctx, appID)
instanceDebug := debug(t, ctx, appID, instance1ID)
- if !strings.Contains(instanceDebug, "Blessing Store: Default blessings: test-principal/forapp/google naps") {
+ if !strings.Contains(instanceDebug, fmt.Sprintf("Blessing Store: Default blessings: %s/forapp/google naps", testutil.TestBlessing)) {
t.Fatalf("debug response doesn't contain expected info: %v", instanceDebug)
}