Fix GetLocalHost testutil function for mac users (boot2docker)

This commit is contained in:
Cameron Sparr
2015-08-03 17:16:02 -06:00
parent a4d0c47fc6
commit 03c520798e
2 changed files with 25 additions and 2 deletions

View File

@@ -23,4 +23,12 @@ func TestDockerHost(t *testing.T) {
t.Fatalf("Host should take DOCKER_HOST value when set. Current value is [%s] and DOCKER_HOST is [%s]", host, os.Getenv("DOCKER_HOST"))
}
os.Setenv("DOCKER_HOST", "tcp://1.1.1.1:8080")
host = GetLocalHost()
if host != "1.1.1.1" {
t.Fatalf("Host should take DOCKER_HOST value when set. Current value is [%s] and DOCKER_HOST is [%s]", host, os.Getenv("DOCKER_HOST"))
}
}