bug fix for test cases

Fix bug that `isNwPresent` can't distinguish network names with same
prefix.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
Zhang Wei 2015-10-30 15:07:17 +08:00
parent 75128c46c7
commit 8f53edae3b
1 changed files with 2 additions and 1 deletions

View File

@ -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
}
}