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>
| ... | ... |
@@ -2921,6 +2921,10 @@ func TestRunPortFromDockerRangeInUse(t *testing.T) {
|
| 2921 | 2921 |
t.Fatal(out, err) |
| 2922 | 2922 |
} |
| 2923 | 2923 |
out = strings.TrimSpace(out) |
| 2924 |
+ |
|
| 2925 |
+ if out == "" {
|
|
| 2926 |
+ t.Fatal("docker port command output is empty")
|
|
| 2927 |
+ } |
|
| 2924 | 2928 |
out = strings.Split(out, ":")[1] |
| 2925 | 2929 |
lastPort, err := strconv.Atoi(out) |
| 2926 | 2930 |
if err != nil {
|