Browse code

Fourth set of enabling Builder CI tests for Windows

Signed-off-by: Darren Stahl <darst@microsoft.com>

Darren Stahl authored on 2016/02/06 10:46:06
Showing 1 changed files
... ...
@@ -2673,13 +2673,12 @@ func (s *DockerSuite) TestBuildCopyDirButNotFile(c *check.C) {
2673 2673
 }
2674 2674
 
2675 2675
 func (s *DockerSuite) TestBuildAddCurrentDirWithCache(c *check.C) {
2676
-	testRequires(c, DaemonIsLinux)
2677 2676
 	name := "testbuildaddcurrentdirwithcache"
2678 2677
 	name2 := name + "2"
2679 2678
 	name3 := name + "3"
2680 2679
 	name4 := name + "4"
2681 2680
 	dockerfile := `
2682
-        FROM scratch
2681
+        FROM ` + minimalBaseImage() + `
2683 2682
         MAINTAINER dockerio
2684 2683
         ADD . /usr/lib/bla`
2685 2684
 	ctx, err := fakeContext(dockerfile, map[string]string{
... ...
@@ -2731,11 +2730,10 @@ func (s *DockerSuite) TestBuildAddCurrentDirWithCache(c *check.C) {
2731 2731
 }
2732 2732
 
2733 2733
 func (s *DockerSuite) TestBuildAddCurrentDirWithoutCache(c *check.C) {
2734
-	testRequires(c, DaemonIsLinux)
2735 2734
 	name := "testbuildaddcurrentdirwithoutcache"
2736 2735
 	name2 := "testbuildaddcurrentdirwithoutcache2"
2737 2736
 	dockerfile := `
2738
-        FROM scratch
2737
+        FROM ` + minimalBaseImage() + `
2739 2738
         MAINTAINER dockerio
2740 2739
         ADD . /usr/lib/bla`
2741 2740
 	ctx, err := fakeContext(dockerfile, map[string]string{
... ...
@@ -2759,7 +2757,7 @@ func (s *DockerSuite) TestBuildAddCurrentDirWithoutCache(c *check.C) {
2759 2759
 }
2760 2760
 
2761 2761
 func (s *DockerSuite) TestBuildAddRemoteFileWithCache(c *check.C) {
2762
-	testRequires(c, DaemonIsLinux)
2762
+	testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet
2763 2763
 	name := "testbuildaddremotefilewithcache"
2764 2764
 	server, err := fakeStorage(map[string]string{
2765 2765
 		"baz": "hello",
... ...
@@ -2791,7 +2789,7 @@ func (s *DockerSuite) TestBuildAddRemoteFileWithCache(c *check.C) {
2791 2791
 }
2792 2792
 
2793 2793
 func (s *DockerSuite) TestBuildAddRemoteFileWithoutCache(c *check.C) {
2794
-	testRequires(c, DaemonIsLinux)
2794
+	testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet
2795 2795
 	name := "testbuildaddremotefilewithoutcache"
2796 2796
 	name2 := "testbuildaddremotefilewithoutcache2"
2797 2797
 	server, err := fakeStorage(map[string]string{
... ...
@@ -2824,7 +2822,7 @@ func (s *DockerSuite) TestBuildAddRemoteFileWithoutCache(c *check.C) {
2824 2824
 }
2825 2825
 
2826 2826
 func (s *DockerSuite) TestBuildAddRemoteFileMTime(c *check.C) {
2827
-	testRequires(c, DaemonIsLinux)
2827
+	testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet
2828 2828
 	name := "testbuildaddremotefilemtime"
2829 2829
 	name2 := name + "2"
2830 2830
 	name3 := name + "3"
... ...
@@ -2886,7 +2884,7 @@ func (s *DockerSuite) TestBuildAddRemoteFileMTime(c *check.C) {
2886 2886
 }
2887 2887
 
2888 2888
 func (s *DockerSuite) TestBuildAddLocalAndRemoteFilesWithCache(c *check.C) {
2889
-	testRequires(c, DaemonIsLinux)
2889
+	testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet
2890 2890
 	name := "testbuildaddlocalandremotefilewithcache"
2891 2891
 	server, err := fakeStorage(map[string]string{
2892 2892
 		"baz": "hello",
... ...
@@ -2921,7 +2919,6 @@ func (s *DockerSuite) TestBuildAddLocalAndRemoteFilesWithCache(c *check.C) {
2921 2921
 }
2922 2922
 
2923 2923
 func testContextTar(c *check.C, compression archive.Compression) {
2924
-	testRequires(c, DaemonIsLinux)
2925 2924
 	ctx, err := fakeContext(
2926 2925
 		`FROM busybox
2927 2926
 ADD foo /foo
... ...
@@ -2956,9 +2953,10 @@ func (s *DockerSuite) TestBuildContextTarNoCompression(c *check.C) {
2956 2956
 }
2957 2957
 
2958 2958
 func (s *DockerSuite) TestBuildNoContext(c *check.C) {
2959
-	testRequires(c, DaemonIsLinux)
2960 2959
 	buildCmd := exec.Command(dockerBinary, "build", "-t", "nocontext", "-")
2961
-	buildCmd.Stdin = strings.NewReader("FROM busybox\nCMD echo ok\n")
2960
+	buildCmd.Stdin = strings.NewReader(
2961
+		`FROM busybox
2962
+		CMD ["echo", "ok"]`)
2962 2963
 
2963 2964
 	if out, _, err := runCommandWithOutput(buildCmd); err != nil {
2964 2965
 		c.Fatalf("build failed to complete: %v %v", out, err)
... ...
@@ -2971,7 +2969,7 @@ func (s *DockerSuite) TestBuildNoContext(c *check.C) {
2971 2971
 
2972 2972
 // TODO: TestCaching
2973 2973
 func (s *DockerSuite) TestBuildAddLocalAndRemoteFilesWithoutCache(c *check.C) {
2974
-	testRequires(c, DaemonIsLinux)
2974
+	testRequires(c, DaemonIsLinux) // Windows doesn't have httpserver image yet
2975 2975
 	name := "testbuildaddlocalandremotefilewithoutcache"
2976 2976
 	name2 := "testbuildaddlocalandremotefilewithoutcache2"
2977 2977
 	server, err := fakeStorage(map[string]string{
... ...
@@ -3035,7 +3033,6 @@ func (s *DockerSuite) TestBuildWithVolumeOwnership(c *check.C) {
3035 3035
 // testing #1405 - config.Cmd does not get cleaned up if
3036 3036
 // utilizing cache
3037 3037
 func (s *DockerSuite) TestBuildEntrypointRunCleanup(c *check.C) {
3038
-	testRequires(c, DaemonIsLinux)
3039 3038
 	name := "testbuildcmdcleanup"
3040 3039
 	if _, err := buildImage(name,
3041 3040
 		`FROM busybox
... ...
@@ -3066,9 +3063,8 @@ func (s *DockerSuite) TestBuildEntrypointRunCleanup(c *check.C) {
3066 3066
 }
3067 3067
 
3068 3068
 func (s *DockerSuite) TestBuildForbiddenContextPath(c *check.C) {
3069
-	testRequires(c, DaemonIsLinux)
3070 3069
 	name := "testbuildforbidpath"
3071
-	ctx, err := fakeContext(`FROM scratch
3070
+	ctx, err := fakeContext(`FROM `+minimalBaseImage()+`
3072 3071
         ADD ../../ test/
3073 3072
         `,
3074 3073
 		map[string]string{
... ...
@@ -3081,6 +3077,11 @@ func (s *DockerSuite) TestBuildForbiddenContextPath(c *check.C) {
3081 3081
 	defer ctx.Close()
3082 3082
 
3083 3083
 	expected := "Forbidden path outside the build context: ../../ "
3084
+
3085
+	if daemonPlatform == "windows" {
3086
+		expected = "Forbidden path outside the build context: ..\\..\\ "
3087
+	}
3088
+
3084 3089
 	if _, err := buildImageFromContext(name, ctx, true); err == nil || !strings.Contains(err.Error(), expected) {
3085 3090
 		c.Fatalf("Wrong error: (should contain \"%s\") got:\n%v", expected, err)
3086 3091
 	}
... ...
@@ -3088,9 +3089,14 @@ func (s *DockerSuite) TestBuildForbiddenContextPath(c *check.C) {
3088 3088
 }
3089 3089
 
3090 3090
 func (s *DockerSuite) TestBuildAddFileNotFound(c *check.C) {
3091
-	testRequires(c, DaemonIsLinux)
3092 3091
 	name := "testbuildaddnotfound"
3093
-	ctx, err := fakeContext(`FROM scratch
3092
+	expected := "foo: no such file or directory"
3093
+
3094
+	if daemonPlatform == "windows" {
3095
+		expected = "foo: The system cannot find the file specified"
3096
+	}
3097
+
3098
+	ctx, err := fakeContext(`FROM `+minimalBaseImage()+`
3094 3099
         ADD foo /usr/local/bar`,
3095 3100
 		map[string]string{"bar": "hello"})
3096 3101
 	if err != nil {
... ...
@@ -3098,7 +3104,7 @@ func (s *DockerSuite) TestBuildAddFileNotFound(c *check.C) {
3098 3098
 	}
3099 3099
 	defer ctx.Close()
3100 3100
 	if _, err := buildImageFromContext(name, ctx, true); err != nil {
3101
-		if !strings.Contains(err.Error(), "foo: no such file or directory") {
3101
+		if !strings.Contains(err.Error(), expected) {
3102 3102
 			c.Fatalf("Wrong error %v, must be about missing foo file or directory", err)
3103 3103
 		}
3104 3104
 	} else {
... ...
@@ -3138,7 +3144,6 @@ func (s *DockerSuite) TestBuildInheritance(c *check.C) {
3138 3138
 }
3139 3139
 
3140 3140
 func (s *DockerSuite) TestBuildFails(c *check.C) {
3141
-	testRequires(c, DaemonIsLinux)
3142 3141
 	name := "testbuildfails"
3143 3142
 	_, err := buildImage(name,
3144 3143
 		`FROM busybox
... ...
@@ -3166,7 +3171,6 @@ func (s *DockerSuite) TestBuildFailsDockerfileEmpty(c *check.C) {
3166 3166
 }
3167 3167
 
3168 3168
 func (s *DockerSuite) TestBuildOnBuild(c *check.C) {
3169
-	testRequires(c, DaemonIsLinux)
3170 3169
 	name := "testbuildonbuild"
3171 3170
 	_, err := buildImage(name,
3172 3171
 		`FROM busybox
... ...
@@ -3185,7 +3189,6 @@ func (s *DockerSuite) TestBuildOnBuild(c *check.C) {
3185 3185
 }
3186 3186
 
3187 3187
 func (s *DockerSuite) TestBuildOnBuildForbiddenChained(c *check.C) {
3188
-	testRequires(c, DaemonIsLinux)
3189 3188
 	name := "testbuildonbuildforbiddenchained"
3190 3189
 	_, err := buildImage(name,
3191 3190
 		`FROM busybox
... ...
@@ -3201,7 +3204,6 @@ func (s *DockerSuite) TestBuildOnBuildForbiddenChained(c *check.C) {
3201 3201
 }
3202 3202
 
3203 3203
 func (s *DockerSuite) TestBuildOnBuildForbiddenFrom(c *check.C) {
3204
-	testRequires(c, DaemonIsLinux)
3205 3204
 	name := "testbuildonbuildforbiddenfrom"
3206 3205
 	_, err := buildImage(name,
3207 3206
 		`FROM busybox
... ...
@@ -3217,7 +3219,6 @@ func (s *DockerSuite) TestBuildOnBuildForbiddenFrom(c *check.C) {
3217 3217
 }
3218 3218
 
3219 3219
 func (s *DockerSuite) TestBuildOnBuildForbiddenMaintainer(c *check.C) {
3220
-	testRequires(c, DaemonIsLinux)
3221 3220
 	name := "testbuildonbuildforbiddenmaintainer"
3222 3221
 	_, err := buildImage(name,
3223 3222
 		`FROM busybox
... ...
@@ -3255,7 +3256,6 @@ func (s *DockerSuite) TestBuildAddToSymlinkDest(c *check.C) {
3255 3255
 }
3256 3256
 
3257 3257
 func (s *DockerSuite) TestBuildEscapeWhitespace(c *check.C) {
3258
-	testRequires(c, DaemonIsLinux)
3259 3258
 	name := "testbuildescaping"
3260 3259
 
3261 3260
 	_, err := buildImage(name, `
... ...
@@ -3277,7 +3277,6 @@ docker.com>"
3277 3277
 }
3278 3278
 
3279 3279
 func (s *DockerSuite) TestBuildVerifyIntString(c *check.C) {
3280
-	testRequires(c, DaemonIsLinux)
3281 3280
 	// Verify that strings that look like ints are still passed as strings
3282 3281
 	name := "testbuildstringing"
3283 3282
 
... ...
@@ -3299,22 +3298,25 @@ func (s *DockerSuite) TestBuildVerifyIntString(c *check.C) {
3299 3299
 }
3300 3300
 
3301 3301
 func (s *DockerSuite) TestBuildDockerignore(c *check.C) {
3302
-	testRequires(c, DaemonIsLinux)
3302
+	testRequires(c, DaemonIsLinux) // TODO Windows: This test passes on Windows,
3303
+	// but currently adds a disproportionate amount of time for the value it has.
3304
+	// Removing it from Windows CI for now, but this will be revisited in the
3305
+	// TP5 timeframe when perf is better.
3303 3306
 	name := "testbuilddockerignore"
3304 3307
 	dockerfile := `
3305 3308
         FROM busybox
3306 3309
         ADD . /bla
3307
-		RUN [[ -f /bla/src/x.go ]]
3308
-		RUN [[ -f /bla/Makefile ]]
3309
-		RUN [[ ! -e /bla/src/_vendor ]]
3310
-		RUN [[ ! -e /bla/.gitignore ]]
3311
-		RUN [[ ! -e /bla/README.md ]]
3312
-		RUN [[ ! -e /bla/dir/foo ]]
3313
-		RUN [[ ! -e /bla/foo ]]
3314
-		RUN [[ ! -e /bla/.git ]]
3315
-		RUN [[ ! -e v.cc ]]
3316
-		RUN [[ ! -e src/v.cc ]]
3317
-		RUN [[ ! -e src/_vendor/v.cc ]]`
3310
+		RUN sh -c "[[ -f /bla/src/x.go ]]"
3311
+		RUN sh -c "[[ -f /bla/Makefile ]]"
3312
+		RUN sh -c "[[ ! -e /bla/src/_vendor ]]"
3313
+		RUN sh -c "[[ ! -e /bla/.gitignore ]]"
3314
+		RUN sh -c "[[ ! -e /bla/README.md ]]"
3315
+		RUN sh -c "[[ ! -e /bla/dir/foo ]]"
3316
+		RUN sh -c "[[ ! -e /bla/foo ]]"
3317
+		RUN sh -c "[[ ! -e /bla/.git ]]"
3318
+		RUN sh -c "[[ ! -e v.cc ]]"
3319
+		RUN sh -c "[[ ! -e src/v.cc ]]"
3320
+		RUN sh -c "[[ ! -e src/_vendor/v.cc ]]"`
3318 3321
 	ctx, err := fakeContext(dockerfile, map[string]string{
3319 3322
 		"Makefile":         "all:",
3320 3323
 		".git/HEAD":        "ref: foo",
... ...
@@ -3345,12 +3347,11 @@ dir`,
3345 3345
 }
3346 3346
 
3347 3347
 func (s *DockerSuite) TestBuildDockerignoreCleanPaths(c *check.C) {
3348
-	testRequires(c, DaemonIsLinux)
3349 3348
 	name := "testbuilddockerignorecleanpaths"
3350 3349
 	dockerfile := `
3351 3350
         FROM busybox
3352 3351
         ADD . /tmp/
3353
-        RUN (! ls /tmp/foo) && (! ls /tmp/foo2) && (! ls /tmp/dir1/foo)`
3352
+        RUN sh -c "(! ls /tmp/foo) && (! ls /tmp/foo2) && (! ls /tmp/dir1/foo)"`
3354 3353
 	ctx, err := fakeContext(dockerfile, map[string]string{
3355 3354
 		"foo":           "foo",
3356 3355
 		"foo2":          "foo2",
... ...
@@ -3367,23 +3368,26 @@ func (s *DockerSuite) TestBuildDockerignoreCleanPaths(c *check.C) {
3367 3367
 }
3368 3368
 
3369 3369
 func (s *DockerSuite) TestBuildDockerignoreExceptions(c *check.C) {
3370
-	testRequires(c, DaemonIsLinux)
3370
+	testRequires(c, DaemonIsLinux) // TODO Windows: This test passes on Windows,
3371
+	// but currently adds a disproportionate amount of time for the value it has.
3372
+	// Removing it from Windows CI for now, but this will be revisited in the
3373
+	// TP5 timeframe when perf is better.
3371 3374
 	name := "testbuilddockerignoreexceptions"
3372 3375
 	dockerfile := `
3373 3376
         FROM busybox
3374 3377
         ADD . /bla
3375
-		RUN [[ -f /bla/src/x.go ]]
3376
-		RUN [[ -f /bla/Makefile ]]
3377
-		RUN [[ ! -e /bla/src/_vendor ]]
3378
-		RUN [[ ! -e /bla/.gitignore ]]
3379
-		RUN [[ ! -e /bla/README.md ]]
3380
-		RUN [[  -e /bla/dir/dir/foo ]]
3381
-		RUN [[ ! -e /bla/dir/foo1 ]]
3382
-		RUN [[ -f /bla/dir/e ]]
3383
-		RUN [[ -f /bla/dir/e-dir/foo ]]
3384
-		RUN [[ ! -e /bla/foo ]]
3385
-		RUN [[ ! -e /bla/.git ]]
3386
-		RUN [[ -e /bla/dir/a.cc ]]`
3378
+		RUN sh -c "[[ -f /bla/src/x.go ]]"
3379
+		RUN sh -c "[[ -f /bla/Makefile ]]"
3380
+		RUN sh -c "[[ ! -e /bla/src/_vendor ]]"
3381
+		RUN sh -c "[[ ! -e /bla/.gitignore ]]"
3382
+		RUN sh -c "[[ ! -e /bla/README.md ]]"
3383
+		RUN sh -c "[[  -e /bla/dir/dir/foo ]]"
3384
+		RUN sh -c "[[ ! -e /bla/dir/foo1 ]]"
3385
+		RUN sh -c "[[ -f /bla/dir/e ]]"
3386
+		RUN sh -c "[[ -f /bla/dir/e-dir/foo ]]"
3387
+		RUN sh -c "[[ ! -e /bla/foo ]]"
3388
+		RUN sh -c "[[ ! -e /bla/.git ]]"
3389
+		RUN sh -c "[[ -e /bla/dir/a.cc ]]"`
3387 3390
 	ctx, err := fakeContext(dockerfile, map[string]string{
3388 3391
 		"Makefile":         "all:",
3389 3392
 		".git/HEAD":        "ref: foo",
... ...
@@ -3420,12 +3424,11 @@ dir
3420 3420
 }
3421 3421
 
3422 3422
 func (s *DockerSuite) TestBuildDockerignoringDockerfile(c *check.C) {
3423
-	testRequires(c, DaemonIsLinux)
3424 3423
 	name := "testbuilddockerignoredockerfile"
3425 3424
 	dockerfile := `
3426 3425
         FROM busybox
3427 3426
 		ADD . /tmp/
3428
-		RUN ! ls /tmp/Dockerfile
3427
+		RUN sh -c "! ls /tmp/Dockerfile"
3429 3428
 		RUN ls /tmp/.dockerignore`
3430 3429
 	ctx, err := fakeContext(dockerfile, map[string]string{
3431 3430
 		"Dockerfile":    dockerfile,
... ...
@@ -3449,13 +3452,12 @@ func (s *DockerSuite) TestBuildDockerignoringDockerfile(c *check.C) {
3449 3449
 }
3450 3450
 
3451 3451
 func (s *DockerSuite) TestBuildDockerignoringRenamedDockerfile(c *check.C) {
3452
-	testRequires(c, DaemonIsLinux)
3453 3452
 	name := "testbuilddockerignoredockerfile"
3454 3453
 	dockerfile := `
3455 3454
         FROM busybox
3456 3455
 		ADD . /tmp/
3457 3456
 		RUN ls /tmp/Dockerfile
3458
-		RUN ! ls /tmp/MyDockerfile
3457
+		RUN sh -c "! ls /tmp/MyDockerfile"
3459 3458
 		RUN ls /tmp/.dockerignore`
3460 3459
 	ctx, err := fakeContext(dockerfile, map[string]string{
3461 3460
 		"Dockerfile":    "Should not use me",
... ...
@@ -3480,12 +3482,11 @@ func (s *DockerSuite) TestBuildDockerignoringRenamedDockerfile(c *check.C) {
3480 3480
 }
3481 3481
 
3482 3482
 func (s *DockerSuite) TestBuildDockerignoringDockerignore(c *check.C) {
3483
-	testRequires(c, DaemonIsLinux)
3484 3483
 	name := "testbuilddockerignoredockerignore"
3485 3484
 	dockerfile := `
3486 3485
         FROM busybox
3487 3486
 		ADD . /tmp/
3488
-		RUN ! ls /tmp/.dockerignore
3487
+		RUN sh -c "! ls /tmp/.dockerignore"
3489 3488
 		RUN ls /tmp/Dockerfile`
3490 3489
 	ctx, err := fakeContext(dockerfile, map[string]string{
3491 3490
 		"Dockerfile":    dockerfile,
... ...
@@ -3501,7 +3502,6 @@ func (s *DockerSuite) TestBuildDockerignoringDockerignore(c *check.C) {
3501 3501
 }
3502 3502
 
3503 3503
 func (s *DockerSuite) TestBuildDockerignoreTouchDockerfile(c *check.C) {
3504
-	testRequires(c, DaemonIsLinux)
3505 3504
 	var id1 string
3506 3505
 	var id2 string
3507 3506
 
... ...
@@ -3554,13 +3554,12 @@ func (s *DockerSuite) TestBuildDockerignoreTouchDockerfile(c *check.C) {
3554 3554
 }
3555 3555
 
3556 3556
 func (s *DockerSuite) TestBuildDockerignoringWholeDir(c *check.C) {
3557
-	testRequires(c, DaemonIsLinux)
3558 3557
 	name := "testbuilddockerignorewholedir"
3559 3558
 	dockerfile := `
3560 3559
         FROM busybox
3561 3560
 		COPY . /
3562
-		RUN [[ ! -e /.gitignore ]]
3563
-		RUN [[ -f /Makefile ]]`
3561
+		RUN sh -c "[[ ! -e /.gitignore ]]"
3562
+		RUN sh -c "[[ -f /Makefile ]]"`
3564 3563
 	ctx, err := fakeContext(dockerfile, map[string]string{
3565 3564
 		"Dockerfile":    "FROM scratch",
3566 3565
 		"Makefile":      "all:",
... ...
@@ -3590,13 +3589,12 @@ func (s *DockerSuite) TestBuildDockerignoringWholeDir(c *check.C) {
3590 3590
 }
3591 3591
 
3592 3592
 func (s *DockerSuite) TestBuildDockerignoringBadExclusion(c *check.C) {
3593
-	testRequires(c, DaemonIsLinux)
3594 3593
 	name := "testbuilddockerignorebadexclusion"
3595 3594
 	dockerfile := `
3596 3595
         FROM busybox
3597 3596
 		COPY . /
3598
-		RUN [[ ! -e /.gitignore ]]
3599
-		RUN [[ -f /Makefile ]]`
3597
+		RUN sh -c "[[ ! -e /.gitignore ]]"
3598
+		RUN sh -c "[[ -f /Makefile ]]"`
3600 3599
 	ctx, err := fakeContext(dockerfile, map[string]string{
3601 3600
 		"Dockerfile":    "FROM scratch",
3602 3601
 		"Makefile":      "all:",
... ...
@@ -3615,15 +3613,13 @@ func (s *DockerSuite) TestBuildDockerignoringBadExclusion(c *check.C) {
3615 3615
 }
3616 3616
 
3617 3617
 func (s *DockerSuite) TestBuildDockerignoringWildTopDir(c *check.C) {
3618
-	testRequires(c, DaemonIsLinux)
3619
-
3620 3618
 	dockerfile := `
3621 3619
         FROM busybox
3622 3620
 		COPY . /
3623
-		RUN [[ ! -e /.dockerignore ]]
3624
-		RUN [[ ! -e /Dockerfile ]]
3625
-		RUN [[ ! -e /file1 ]]
3626
-		RUN [[ ! -e /dir ]]`
3621
+		RUN sh -c "[[ ! -e /.dockerignore ]]"
3622
+		RUN sh -c "[[ ! -e /Dockerfile ]]"
3623
+		RUN sh -c "[[ ! -e /file1 ]]"
3624
+		RUN sh -c "[[ ! -e /dir ]]"`
3627 3625
 
3628 3626
 	ctx, err := fakeContext(dockerfile, map[string]string{
3629 3627
 		"Dockerfile": "FROM scratch",
... ...
@@ -3642,36 +3638,36 @@ func (s *DockerSuite) TestBuildDockerignoringWildTopDir(c *check.C) {
3642 3642
 }
3643 3643
 
3644 3644
 func (s *DockerSuite) TestBuildDockerignoringWildDirs(c *check.C) {
3645
-	testRequires(c, DaemonIsLinux)
3645
+	testRequires(c, DaemonIsLinux) // TODO Windows: Fix this test; also perf
3646 3646
 
3647 3647
 	dockerfile := `
3648 3648
         FROM busybox
3649 3649
 		COPY . /
3650
-		RUN [[ -e /.dockerignore ]]
3651
-		RUN [[ -e /Dockerfile ]]
3650
+		#RUN sh -c "[[ -e /.dockerignore ]]"
3651
+		RUN sh -c "[[ -e /Dockerfile ]]"
3652 3652
 
3653
-		RUN [[ ! -e /file0 ]]
3654
-		RUN [[ ! -e /dir1/file0 ]]
3655
-		RUN [[ ! -e /dir2/file0 ]]
3653
+		RUN sh -c "[[ ! -e /file0 ]]"
3654
+		RUN sh -c "[[ ! -e /dir1/file0 ]]"
3655
+		RUN sh -c "[[ ! -e /dir2/file0 ]]"
3656 3656
 
3657
-		RUN [[ ! -e /file1 ]]
3658
-		RUN [[ ! -e /dir1/file1 ]]
3659
-		RUN [[ ! -e /dir1/dir2/file1 ]]
3657
+		RUN sh -c "[[ ! -e /file1 ]]"
3658
+		RUN sh -c "[[ ! -e /dir1/file1 ]]"
3659
+		RUN sh -c "[[ ! -e /dir1/dir2/file1 ]]"
3660 3660
 
3661
-		RUN [[ ! -e /dir1/file2 ]]
3662
-		RUN [[   -e /dir1/dir2/file2 ]]
3661
+		RUN sh -c "[[ ! -e /dir1/file2 ]]"
3662
+		RUN sh -c "[[   -e /dir1/dir2/file2 ]]"
3663 3663
 
3664
-		RUN [[ ! -e /dir1/dir2/file4 ]]
3665
-		RUN [[ ! -e /dir1/dir2/file5 ]]
3666
-		RUN [[ ! -e /dir1/dir2/file6 ]]
3667
-		RUN [[ ! -e /dir1/dir3/file7 ]]
3668
-		RUN [[ ! -e /dir1/dir3/file8 ]]
3669
-		RUN [[   -e /dir1/dir3 ]]
3670
-		RUN [[   -e /dir1/dir4 ]]
3664
+		RUN sh -c "[[ ! -e /dir1/dir2/file4 ]]"
3665
+		RUN sh -c "[[ ! -e /dir1/dir2/file5 ]]"
3666
+		RUN sh -c "[[ ! -e /dir1/dir2/file6 ]]"
3667
+		RUN sh -c "[[ ! -e /dir1/dir3/file7 ]]"
3668
+		RUN sh -c "[[ ! -e /dir1/dir3/file8 ]]"
3669
+		RUN sh -c "[[   -e /dir1/dir3 ]]"
3670
+		RUN sh -c "[[   -e /dir1/dir4 ]]"
3671 3671
 
3672
-		RUN [[ ! -e 'dir1/dir5/fileAA' ]]
3673
-		RUN [[   -e 'dir1/dir5/fileAB' ]]
3674
-		RUN [[   -e 'dir1/dir5/fileB' ]]   # "." in pattern means nothing
3672
+		RUN sh -c "[[ ! -e 'dir1/dir5/fileAA' ]]"
3673
+		RUN sh -c "[[   -e 'dir1/dir5/fileAB' ]]"
3674
+		RUN sh -c "[[   -e 'dir1/dir5/fileB' ]]"   # "." in pattern means nothing
3675 3675
 
3676 3676
 		RUN echo all done!`
3677 3677
 
... ...
@@ -3728,8 +3724,8 @@ func (s *DockerSuite) TestBuildLineBreak(c *check.C) {
3728 3728
 RUN    sh -c 'echo root:testpass \
3729 3729
 	> /tmp/passwd'
3730 3730
 RUN    mkdir -p /var/run/sshd
3731
-RUN    [ "$(cat /tmp/passwd)" = "root:testpass" ]
3732
-RUN    [ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]`,
3731
+RUN    sh -c "[ "$(cat /tmp/passwd)" = "root:testpass" ]"
3732
+RUN    sh -c "[ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]"`,
3733 3733
 		true)
3734 3734
 	if err != nil {
3735 3735
 		c.Fatal(err)
... ...
@@ -3744,8 +3740,8 @@ func (s *DockerSuite) TestBuildEOLInLine(c *check.C) {
3744 3744
 RUN    sh -c 'echo root:testpass > /tmp/passwd'
3745 3745
 RUN    echo "foo \n bar"; echo "baz"
3746 3746
 RUN    mkdir -p /var/run/sshd
3747
-RUN    [ "$(cat /tmp/passwd)" = "root:testpass" ]
3748
-RUN    [ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]`,
3747
+RUN    sh -c "[ "$(cat /tmp/passwd)" = "root:testpass" ]"
3748
+RUN    sh -c "[ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]"`,
3749 3749
 		true)
3750 3750
 	if err != nil {
3751 3751
 		c.Fatal(err)