TestRunCidFileCleanupIfEmpty fails on windows/mac because the test runs
the command `docker run scratch` and it gives the following error:
Unable to find image 'scratch:latest' locally
Pulling repository scratch
511136ea3c5a: Download complete
FATA[0004] 'scratch' is a reserved name
I am not entirely sure if this is a test issue or not but I had a quick
workaround by creating another image using `FROM scratch` and using that.
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
| ... | ... |
@@ -2289,11 +2289,12 @@ func TestRunCidFileCleanupIfEmpty(t *testing.T) {
|
| 2289 | 2289 |
} |
| 2290 | 2290 |
defer os.RemoveAll(tmpDir) |
| 2291 | 2291 |
tmpCidFile := path.Join(tmpDir, "cid") |
| 2292 |
- cmd := exec.Command(dockerBinary, "run", "--cidfile", tmpCidFile, "scratch") |
|
| 2292 |
+ cmd := exec.Command(dockerBinary, "run", "--cidfile", tmpCidFile, "emptyfs") |
|
| 2293 | 2293 |
out, _, err := runCommandWithOutput(cmd) |
| 2294 |
- t.Log(out) |
|
| 2295 | 2294 |
if err == nil {
|
| 2296 |
- t.Fatal("Run without command must fail")
|
|
| 2295 |
+ t.Fatalf("Run without command must fail. out=%s", out)
|
|
| 2296 |
+ } else if !strings.Contains(out, "No command specified") {
|
|
| 2297 |
+ t.Fatalf("Run without command failed with wrong output. out=%s\nerr=%v", out, err)
|
|
| 2297 | 2298 |
} |
| 2298 | 2299 |
|
| 2299 | 2300 |
if _, err := os.Stat(tmpCidFile); err == nil {
|