This commit is contained in:
Brendan Burns 2014-06-15 21:57:29 -07:00
parent 2e68d087a9
commit 76148dc85f

View File

@ -677,17 +677,17 @@ func TestMakePortsAndBindings(t *testing.T) {
{ {
ContainerPort: 443, ContainerPort: 443,
HostPort: 443, HostPort: 443,
Protocol: "tcp", Protocol: "tcp",
}, },
{ {
ContainerPort: 444, ContainerPort: 444,
HostPort: 444, HostPort: 444,
Protocol: "udp", Protocol: "udp",
}, },
{ {
ContainerPort: 445, ContainerPort: 445,
HostPort: 445, HostPort: 445,
Protocol: "foobar", Protocol: "foobar",
}, },
}, },
} }
@ -696,26 +696,26 @@ func TestMakePortsAndBindings(t *testing.T) {
len(container.Ports) != len(bindings) { len(container.Ports) != len(bindings) {
t.Errorf("Unexpected ports and bindings, %#v %#v %#v", container, exposedPorts, bindings) t.Errorf("Unexpected ports and bindings, %#v %#v %#v", container, exposedPorts, bindings)
} }
for key,value := range bindings { for key, value := range bindings {
switch value[0].HostPort { switch value[0].HostPort {
case "8080": case "8080":
if !reflect.DeepEqual(docker.Port("80/tcp"), key) { if !reflect.DeepEqual(docker.Port("80/tcp"), key) {
t.Errorf("Unexpected docker port: %#v", key) t.Errorf("Unexpected docker port: %#v", key)
} }
case "443": case "443":
if !reflect.DeepEqual(docker.Port("443/tcp"), key) { if !reflect.DeepEqual(docker.Port("443/tcp"), key) {
t.Errorf("Unexpected docker port: %#v", key) t.Errorf("Unexpected docker port: %#v", key)
} }
case "444": case "444":
if !reflect.DeepEqual(docker.Port("444/udp"), key) { if !reflect.DeepEqual(docker.Port("444/udp"), key) {
t.Errorf("Unexpected docker port: %#v", key) t.Errorf("Unexpected docker port: %#v", key)
} }
case "445": case "445":
if !reflect.DeepEqual(docker.Port("445/tcp"), key) { if !reflect.DeepEqual(docker.Port("445/tcp"), key) {
t.Errorf("Unexpected docker port: %#v", key) t.Errorf("Unexpected docker port: %#v", key)
} }
} }
} }
} }