Browse code

Merge pull request #39876 from thaJeztah/TestCreateWithWorkdir_hyperv

integration-cli: update TestCreateWithWorkdir for Hyper-V isolation

Brian Goff authored on 2019/09/21 02:58:13
Showing 1 changed files
... ...
@@ -303,7 +303,15 @@ func (s *DockerSuite) TestCreateWithWorkdir(c *testing.T) {
303 303
 	// Windows does not create the workdir until the container is started
304 304
 	if testEnv.OSType == "windows" {
305 305
 		dockerCmd(c, "start", name)
306
+		if IsolationIsHyperv() {
307
+			// Hyper-V isolated containers do not allow file-operations on a
308
+			// running container. This test currently uses `docker cp` to verify
309
+			// that the WORKDIR was automatically created, which cannot be done
310
+			// while the container is running.
311
+			dockerCmd(c, "stop", name)
312
+		}
306 313
 	}
314
+	// TODO: rewrite this test to not use `docker cp` for verifying that the WORKDIR was created
307 315
 	dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), prefix+slash+"tmp")
308 316
 }
309 317