blob: e108e49f5262ba9f9061553149b5867c41ba9217 [file] [log] [blame]
Bogdan Capritad8204052015-01-28 10:40:34 -08001package impl_test
2
3import (
4 "v.io/core/veyron2"
5 "v.io/core/veyron2/context"
6
7 "v.io/core/veyron/lib/testutil/security"
8 _ "v.io/core/veyron/profiles"
9 "v.io/core/veyron/tools/mgmt/device/impl"
10)
11
12var gctx *context.T
13
14func initTest() veyron2.Shutdown {
15 ctx, shutdown := veyron2.Init()
16 var err error
17 if ctx, err = veyron2.SetPrincipal(ctx, security.NewPrincipal("test-blessing")); err != nil {
18 panic(err)
19 }
20 gctx = ctx
21 impl.SetGlobalContext(gctx)
22 return func() {
23 shutdown()
24 impl.SetGlobalContext(nil)
25 gctx = nil
26 }
27}