mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
integration-cli: check that docker port command output is not empty
Or else we can violate array range boundaries in: out = strings.Split(out, ":")[1] and get runtime error. We got this runtime error when run TestRunPortFromDockerRangeInUse Somehow docker goes silently if it cannot publish port because of no bridge. Signed-off-by: Pavel Tikhomirov <ptikhomirov@parallels.com>
This commit is contained in:
parent
2243e32cbb
commit
cad770f992
1 changed files with 4 additions and 0 deletions
|
@ -2921,6 +2921,10 @@ func TestRunPortFromDockerRangeInUse(t *testing.T) {
|
|||
t.Fatal(out, err)
|
||||
}
|
||||
out = strings.TrimSpace(out)
|
||||
|
||||
if out == "" {
|
||||
t.Fatal("docker port command output is empty")
|
||||
}
|
||||
out = strings.Split(out, ":")[1]
|
||||
lastPort, err := strconv.Atoi(out)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue