From 5d61fa01f1326aabd0ed062ab4fc17d273048278 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Fri, 8 Jul 2016 18:27:51 -0700 Subject: [PATCH] Fixed tests --- client/driver/docker_test.go | 3 ++- client/driver/driver_test.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/driver/docker_test.go b/client/driver/docker_test.go index d5596fcb8..3229c0fd3 100644 --- a/client/driver/docker_test.go +++ b/client/driver/docker_test.go @@ -9,6 +9,7 @@ import ( "path/filepath" "reflect" "runtime/debug" + "strconv" "strings" "testing" "time" @@ -709,7 +710,7 @@ func TestDockerPortsMapping(t *testing.T) { expectedEnvironment := map[string]string{ "NOMAD_ADDR_main": "127.0.0.1:8080", "NOMAD_ADDR_REDIS": "127.0.0.1:6379", - "NOMAD_HOST_PORT_main": "8080", + "NOMAD_HOST_PORT_main": strconv.Itoa(docker_reserved), } for key, val := range expectedEnvironment { diff --git a/client/driver/driver_test.go b/client/driver/driver_test.go index 477c1832f..c8b37dda4 100644 --- a/client/driver/driver_test.go +++ b/client/driver/driver_test.go @@ -129,15 +129,19 @@ func TestDriver_GetTaskEnv(t *testing.T) { "NOMAD_ADDR_one": "1.2.3.4:80", "NOMAD_IP_one": "1.2.3.4", "NOMAD_PORT_one": "80", + "NOMAD_HOST_PORT_one": "80", "NOMAD_ADDR_two": "1.2.3.4:443", "NOMAD_IP_two": "1.2.3.4", "NOMAD_PORT_two": "443", + "NOMAD_HOST_PORT_two": "443", "NOMAD_ADDR_admin": "1.2.3.4:8081", "NOMAD_IP_admin": "1.2.3.4", "NOMAD_PORT_admin": "8081", + "NOMAD_HOST_PORT_admin": "8081", "NOMAD_ADDR_web": "1.2.3.4:8086", "NOMAD_IP_web": "1.2.3.4", "NOMAD_PORT_web": "8086", + "NOMAD_HOST_PORT_web": "8086", "NOMAD_META_CHOCOLATE": "cake", "NOMAD_META_STRAWBERRY": "icecream", "NOMAD_META_ELB_CHECK_INTERVAL": "30s",