From 5302429fffd4a1971e11c867e32a6a19b7b66919 Mon Sep 17 00:00:00 2001 From: vikrambirsingh Date: Mon, 25 Nov 2019 17:45:12 +0000 Subject: [PATCH] TestRunAttachFailedNoLeak: Compare lowercase Fixed failures in TestRunAttachFailedNoLeak caused by case mismatch Signed-off-by: vikrambirsingh (cherry picked from commit c530c9cbb0da177337a90a6651305daa9eb0c42b) Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_cli_run_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index dd0c65fdaf..b0473a435e 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -3944,11 +3944,12 @@ func (s *DockerSuite) TestRunAttachFailedNoLeak(c *testing.T) { assert.Assert(c, err != nil, "Command should have failed but succeeded with: %s\nContainer 'test' [%+v]: %s\nContainer 'fail' [%+v]: %s", out, err1, out1, err2, out2) // check for windows error as well // TODO Windows Post TP5. Fix the error message string - assert.Assert(c, strings.Contains(out, "port is already allocated") || - strings.Contains(out, "were not connected because a duplicate name exists") || - strings.Contains(out, "The specified port already exists") || - strings.Contains(out, "HNS failed with error : Failed to create endpoint") || - strings.Contains(out, "HNS failed with error : The object already exists"), fmt.Sprintf("Output: %s", out)) + outLowerCase := strings.ToLower(out) + assert.Assert(c, strings.Contains(outLowerCase, "port is already allocated") || + strings.Contains(outLowerCase, "were not connected because a duplicate name exists") || + strings.Contains(outLowerCase, "the specified port already exists") || + strings.Contains(outLowerCase, "hns failed with error : failed to create endpoint") || + strings.Contains(outLowerCase, "hns failed with error : the object already exists"), fmt.Sprintf("Output: %s", out)) dockerCmd(c, "rm", "-f", "test") // NGoroutines is not updated right away, so we need to wait before failing