浏览代码

fix assertPortList normalizing being too strict

The normalizing was updated with the output of the "docker port" command
in mind, but we're normalizing the "expected" output, which is passed
without the "->" in front of the mapping, causing some tests to fail;

    === RUN   TestDockerSuite/TestPortHostBinding
        --- FAIL: TestDockerSuite/TestPortHostBinding (1.21s)
            docker_cli_port_test.go:324: assertion failed: error is not nil: |:::9876!=[::]:9876|
    === RUN   TestDockerSuite/TestPortList
        --- FAIL: TestDockerSuite/TestPortList (0.96s)
            docker_cli_port_test.go:25: assertion failed: error is not nil: |:::9876!=[::]:9876|

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c8599a6537016dc27d01f756c6747aa709554a45)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 4 年之前
父节点
当前提交
d26ed2c33b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      integration-cli/docker_cli_port_test.go

+ 1 - 1
integration-cli/docker_cli_port_test.go

@@ -161,7 +161,7 @@ func assertPortList(c *testing.T, out string, expected []string) error {
 	// of the CLI used an incorrect output format for mappings on IPv6 addresses
 	// for example, "80/tcp -> :::80" instead of "80/tcp -> [::]:80".
 	oldFormat := func(mapping string) string {
-		old := strings.Replace(mapping, "-> [", "-> ", 1)
+		old := strings.Replace(mapping, "[", "", 1)
 		old = strings.Replace(old, "]:", ":", 1)
 		return old
 	}