From 8f53edae3bd628e00f052182a3a5e84ee578f018 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Fri, 30 Oct 2015 15:07:17 +0800 Subject: [PATCH] bug fix for test cases Fix bug that `isNwPresent` can't distinguish network names with same prefix. Signed-off-by: Zhang Wei --- integration-cli/docker_cli_network_unix_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go index 8bf5659233..3f492257e1 100644 --- a/integration-cli/docker_cli_network_unix_test.go +++ b/integration-cli/docker_cli_network_unix_test.go @@ -201,7 +201,8 @@ func isNwPresent(c *check.C, name string) bool { out, _ := dockerCmd(c, "network", "ls") lines := strings.Split(out, "\n") for i := 1; i < len(lines)-1; i++ { - if strings.Contains(lines[i], name) { + netFields := strings.Fields(lines[i]) + if netFields[1] == name { return true } }