()
| 20 | ) |
| 21 | |
| 22 | func init() { |
| 23 | conf = config.New() |
| 24 | conf.Username = "testuser" |
| 25 | conf.KontrolURL = "http://localhost:4099/kite" |
| 26 | conf.KontrolKey = testkeys.Public |
| 27 | conf.KontrolUser = "testuser" |
| 28 | conf.KiteKey = testutil.NewKiteKey().Raw |
| 29 | conf.ReadEnvironmentVariables() |
| 30 | |
| 31 | kontrol.DefaultPort = 4099 |
| 32 | kon := kontrol.New(conf.Copy(), "0.1.0") |
| 33 | |
| 34 | switch os.Getenv("KONTROL_STORAGE") { |
| 35 | case "etcd": |
| 36 | kon.SetStorage(kontrol.NewEtcd(nil, kon.Kite.Log)) |
| 37 | case "postgres": |
| 38 | p := kontrol.NewPostgres(nil, kon.Kite.Log) |
| 39 | kon.SetStorage(p) |
| 40 | kon.SetKeyPairStorage(p) |
| 41 | default: |
| 42 | kon.SetStorage(kontrol.NewEtcd(nil, kon.Kite.Log)) |
| 43 | } |
| 44 | |
| 45 | kon.AddKeyPair("", testkeys.Public, testkeys.Private) |
| 46 | |
| 47 | go kon.Run() |
| 48 | <-kon.Kite.ServerReadyNotify() |
| 49 | } |
| 50 | |
| 51 | func TestRegisterToKontrol(t *testing.T) { |
| 52 | k := setup() |
nothing calls this directly
no test coverage detected