@@ -7,10 +7,11 @@ import (
77 "net/http"
88 "strings"
99 "testing"
10+ "time"
1011)
1112
12- func deisRegistryServiceTest (t * testing.T , testSessionUid string ) {
13- IPAddress := dockercliutils .GetInspectData (t , "{{ .NetworkSettings.IPAddress }}" , "deis-registry -" + testSessionUid )
13+ func deisLoggerServiceTest (t * testing.T , testSessionUid string ) {
14+ IPAddress := dockercliutils .GetInspectData (t , "{{ .NetworkSettings.IPAddress }}" , "deis-logger -" + testSessionUid )
1415 if strings .Contains (IPAddress , "Error" ) {
1516 t .Fatalf ("worng IP %s" , IPAddress )
1617 }
@@ -22,34 +23,35 @@ func deisRegistryServiceTest(t *testing.T, testSessionUid string) {
2223 fmt .Println (response )
2324}
2425
25- func runDeisLoggerTest (t * testing.T ) {
26+ func runDeisLoggerTest (t * testing.T , testSessionUid string ) {
2627 cli , stdout , stdoutPipe := dockercliutils .GetNewClient ()
2728 done := make (chan bool , 1 )
28- dockercliutils .BuildDockerfile (t , "../" , " " )
29+ dockercliutils .BuildDockerfile (t , "../" , "deis/logger:" + testSessionUid )
2930 dockercliutils .RunDeisDataTest (t , "--name" , "deis-logger-data" , "-v" , "/var/log/deis" , "deis/base" , "true" )
30- dockercliutils .RunDeisDataTest (t , "--name" , "deis-logger-data" , "-v" , "/var/log/deis" , "deis/base" , "true" )
31- IPAddress := dockercliutils .GetInspectData (t , "{{ .NetworkSettings.IPAddress }}" , "deis-etcd" )
32- if strings .Contains (IPAddress , "Error" ) {
33- t .Fatalf ("worng IP %s" , IPAddress )
34- }
31+ IPAddress := func () string {
32+ var Ip string
33+ if utils .GetHostOs () == "darwin" {
34+ Ip = "172.17.8.100"
35+ }
36+ return Ip
37+ }()
3538 done <- true
3639 go func () {
3740 <- done
3841 fmt .Println ("inside run etcd" )
39- dockercliutils .RunContainer (t , cli , "--name" , "deis-logger" , "-p" , "514:514/udp" , "-e" , "PUBLISH=514" , "-e" , "HOST=" + IPAddress , "--volumes-from" , "deis-logger-data" , "deis/logger" )
42+ dockercliutils .RunContainer (t , cli , "--name" , "deis-logger-" + testSessionUid , "-p" , "514:514/udp" , "-e" , "PUBLISH=514" , "-e" , "HOST=" + IPAddress , "--volumes-from" , "deis-logger-data" , "deis/logger:" + testSessionUid )
4043 }()
41- dockercliutils .PrintToStdout (t , stdout , stdoutPipe , "Booting " )
44+ dockercliutils .PrintToStdout (t , stdout , stdoutPipe , "deis-logger running " )
4245}
4346
4447func TestBuild (t * testing.T ) {
45-
4648 fmt .Println ("1st" )
4749 var testSessionUid = utils .GetnewUuid ()
48- dockercliutils .RunEtcdTest ( t )
49- t . Logf ("starting registry test: %v" , testSessionUid )
50+ dockercliutils .RunDummyEtcdTest ( t , testSessionUid )
51+ fmt . Println ("starting registry test: %v" , testSessionUid )
5052 fmt .Println ("2nd" )
5153 runDeisLoggerTest (t , testSessionUid )
52- deisRegistryServiceTest (t , testSessionUid )
54+ // deisRegistryServiceTest(t, testSessionUid)*/
5355 dockercliutils .ClearTestSession (t , testSessionUid )
5456 fmt .Println ("3rd" )
5557
0 commit comments