@@ -2,31 +2,34 @@ package verbose
22
33import (
44 "fmt"
5+ "testing"
6+ "time"
7+
58 "github.com/deis/deis/tests/dockercliutils"
69 "github.com/deis/deis/tests/etcdutils"
710 "github.com/deis/deis/tests/mockserviceutils"
811 "github.com/deis/deis/tests/utils"
9- "testing"
10- "time"
1112)
1213
13- func runDeisControllerTest (t * testing.T , testSessionUid string ,port string ) {
14+ func runDeisControllerTest (t * testing.T , testSessionUID string , port string ) {
1415 cli , stdout , stdoutPipe := dockercliutils .GetNewClient ()
1516 done := make (chan bool , 1 )
16- dockercliutils .BuildDockerfile (t , "../" , "deis/controller:" + testSessionUid )
17+ dockercliutils .BuildDockerfile (t , "../" , "deis/controller:" + testSessionUID )
1718 //docker run --name deis-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=${COREOS_PRIVATE_IPV4} --volumes-from=deis-logger deis/controller
18- IPAddress := utils .GetHostIpAddress ()
19+ IPAddress := utils .GetHostIPAddress ()
1920 done <- true
2021 go func () {
2122 <- done
22- dockercliutils .RunContainer (t , cli , "--name" , "deis-controller-" + testSessionUid , "-p" , "8000:8000" , "-e" , "PUBLISH=8000" , "-e" , "HOST=" + IPAddress ,"-e" ,"ETCD_PORT=" + port , "deis/controller:" + testSessionUid )
23+ dockercliutils .RunContainer (t , cli , "--name" ,
24+ "deis-controller-" + testSessionUID , "-p" , "8000:8000" ,
25+ "-e" , "PUBLISH=8000" , "-e" , "HOST=" + IPAddress ,
26+ "-e" , "ETCD_PORT=" + port , "deis/controller:" + testSessionUID )
2327 }()
2428 time .Sleep (5000 * time .Millisecond )
2529 dockercliutils .PrintToStdout (t , stdout , stdoutPipe , "Booting" )
2630
2731}
2832
29-
3033func TestBuild (t * testing.T ) {
3134 setkeys := []string {"/deis/registry/protocol" ,
3235 "deis/registry/host" ,
@@ -38,17 +41,18 @@ func TestBuild(t *testing.T) {
3841 "/deis/database" ,
3942 "/deis/registry" ,
4043 "/deis/domains" }
41- var testSessionUid = utils .GetnewUuid ()
42- fmt .Println ("UUID for the session Controller Test :" + testSessionUid )
44+ var testSessionUID = utils .NewUuid ()
45+ fmt .Println ("UUID for the session Controller Test :" + testSessionUID )
4346 port := utils .GetRandomPort ()
44- //testSessionUid := "352aea64"
45- dockercliutils .RunEtcdTest (t , testSessionUid , port )
47+ //testSessionUID := "352aea64"
48+ dockercliutils .RunEtcdTest (t , testSessionUID , port )
4649 fmt .Println ("starting controller test:" )
47- Controllerhandler := etcdutils .InitetcdValues (setdir , setkeys ,port )
50+ Controllerhandler := etcdutils .InitetcdValues (setdir , setkeys , port )
4851 etcdutils .Publishvalues (t , Controllerhandler )
49- mockserviceutils .RunMockDatabase (t , testSessionUid , port )
52+ mockserviceutils .RunMockDatabase (t , testSessionUID , port )
5053 fmt .Println ("starting Controller component test" )
51- runDeisControllerTest (t , testSessionUid ,port )
52- dockercliutils .DeisServiceTest (t ,"deis-controller-" + testSessionUid ,"8000" ,"http" )
53- dockercliutils .ClearTestSession (t , testSessionUid )
54+ runDeisControllerTest (t , testSessionUID , port )
55+ dockercliutils .DeisServiceTest (
56+ t , "deis-controller-" + testSessionUID , "8000" , "http" )
57+ dockercliutils .ClearTestSession (t , testSessionUID )
5458}
0 commit comments