Browse code

Windows: Enable TestBuildWorkdirImageCmd

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2017/01/05 08:33:40
Showing 1 changed files
... ...
@@ -7360,8 +7360,6 @@ func (s *DockerSuite) TestBuildWindowsEnvCaseInsensitive(c *check.C) {
7360 7360
 
7361 7361
 // Test case for 29667
7362 7362
 func (s *DockerSuite) TestBuildWorkdirImageCmd(c *check.C) {
7363
-	testRequires(c, DaemonIsLinux)
7364
-
7365 7363
 	image := "testworkdirimagecmd"
7366 7364
 	dockerfile := `
7367 7365
 FROM busybox
... ...
@@ -7371,7 +7369,13 @@ WORKDIR /foo/bar
7371 7371
 	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
7372 7372
 
7373 7373
 	out, _ = dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", image)
7374
-	c.Assert(strings.TrimSpace(out), checker.Equals, `["sh"]`)
7374
+
7375
+	// The Windows busybox image has a blank `cmd`
7376
+	lookingFor := `["sh"]`
7377
+	if daemonPlatform == "windows" {
7378
+		lookingFor = "null"
7379
+	}
7380
+	c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor)
7375 7381
 
7376 7382
 	image = "testworkdirlabelimagecmd"
7377 7383
 	dockerfile = `
... ...
@@ -7383,7 +7387,7 @@ LABEL a=b
7383 7383
 	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
7384 7384
 
7385 7385
 	out, _ = dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", image)
7386
-	c.Assert(strings.TrimSpace(out), checker.Equals, `["sh"]`)
7386
+	c.Assert(strings.TrimSpace(out), checker.Equals, lookingFor)
7387 7387
 }
7388 7388
 
7389 7389
 // Test case for 28902/28909