@@ -13,7 +13,8 @@ import (
1313 "testing"
1414
1515 "github.com/deis/deis/deisctl/backend"
16- "github.com/deis/deis/deisctl/etcdclient"
16+ "github.com/deis/deis/deisctl/config"
17+ "github.com/deis/deis/deisctl/config/model"
1718 "github.com/deis/deis/deisctl/test/mock"
1819 "github.com/deis/deis/deisctl/units"
1920)
@@ -86,7 +87,7 @@ func (backend *backendStub) SSHExec(target, command string) error {
8687
8788var _ backend.Backend = & backendStub {}
8889
89- func fakeCheckKeys () error {
90+ func fakeCheckKeys (cb config. Backend ) error {
9091 return nil
9192}
9293
@@ -306,7 +307,7 @@ func TestUpgradePrep(t *testing.T) {
306307
307308func TestUpgradeTakeover (t * testing.T ) {
308309 t .Parallel ()
309- testMock := mock.Client {Expected : []* etcdclient. ServiceKey {{Key : "/deis/services/app1" , Value : "foo" , TTL : 10 },
310+ testMock := mock.ConfigBackend {Expected : []* model. ConfigNode {{Key : "/deis/services/app1" , Value : "foo" , TTL : 10 },
310311 {Key : "/deis/services/app2" , Value : "8000" , TTL : 10 }}}
311312
312313 b := backendStub {}
@@ -477,9 +478,11 @@ func TestInstall(t *testing.T) {
477478 t .Parallel ()
478479
479480 b := backendStub {}
481+ cb := mock.ConfigBackend {}
482+
480483 expected := []string {"router@1" , "router@2" }
481484
482- Install (expected , & b , fakeCheckKeys )
485+ Install (expected , & b , & cb , fakeCheckKeys )
483486
484487 if ! reflect .DeepEqual (b .installedUnits , expected ) {
485488 t .Error (fmt .Errorf ("Expected %v, Got %v" , expected , b .installedUnits ))
@@ -490,11 +493,13 @@ func TestInstallPlatform(t *testing.T) {
490493 t .Parallel ()
491494
492495 b := backendStub {}
496+ cb := mock.ConfigBackend {}
497+
493498 expected := []string {"store-daemon" , "store-monitor" , "store-metadata" , "store-volume" ,
494499 "store-gateway@1" , "logger" , "logspout" , "database" , "registry@1" ,
495500 "controller" , "builder" , "publisher" , "router@1" , "router@2" , "router@3" }
496501
497- Install ([]string {"platform" }, & b , fakeCheckKeys )
502+ Install ([]string {"platform" }, & b , & cb , fakeCheckKeys )
498503
499504 if ! reflect .DeepEqual (b .installedUnits , expected ) {
500505 t .Error (fmt .Errorf ("Expected %v, Got %v" , expected , b .installedUnits ))
@@ -505,12 +510,14 @@ func TestInstallPlatformWithCustomRouterMeshSize(t *testing.T) {
505510 t .Parallel ()
506511
507512 b := backendStub {}
513+ cb := mock.ConfigBackend {}
514+
508515 expected := []string {"store-daemon" , "store-monitor" , "store-metadata" , "store-volume" ,
509516 "store-gateway@1" , "logger" , "logspout" , "database" , "registry@1" ,
510517 "controller" , "builder" , "publisher" , "router@1" , "router@2" , "router@3" , "router@4" , "router@5" }
511518 RouterMeshSize = 5
512519
513- Install ([]string {"platform" }, & b , fakeCheckKeys )
520+ Install ([]string {"platform" }, & b , & cb , fakeCheckKeys )
514521 RouterMeshSize = DefaultRouterMeshSize
515522
516523 if ! reflect .DeepEqual (b .installedUnits , expected ) {
@@ -522,10 +529,12 @@ func TestInstallStatelessPlatform(t *testing.T) {
522529 t .Parallel ()
523530
524531 b := backendStub {}
532+ cb := mock.ConfigBackend {}
533+
525534 expected := []string {"logspout" , "registry@1" ,
526535 "controller" , "builder" , "publisher" , "router@1" , "router@2" , "router@3" }
527536
528- Install ([]string {"stateless-platform" }, & b , fakeCheckKeys )
537+ Install ([]string {"stateless-platform" }, & b , & cb , fakeCheckKeys )
529538
530539 if ! reflect .DeepEqual (b .installedUnits , expected ) {
531540 t .Error (fmt .Errorf ("Expected %v, Got %v" , expected , b .installedUnits ))
@@ -536,9 +545,11 @@ func TestInstallSwarm(t *testing.T) {
536545 t .Parallel ()
537546
538547 b := backendStub {}
548+ cb := mock.ConfigBackend {}
549+
539550 expected := []string {"swarm-node" , "swarm-manager" }
540551
541- Install ([]string {"swarm" }, & b , fakeCheckKeys )
552+ Install ([]string {"swarm" }, & b , & cb , fakeCheckKeys )
542553
543554 if ! reflect .DeepEqual (b .installedUnits , expected ) {
544555 t .Error (fmt .Errorf ("Expected %v, Got %v" , expected , b .installedUnits ))
0 commit comments