From a1638563f72977a643cd0324631e00cf0f54a386 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 4 Sep 2019 12:55:47 +0200 Subject: [PATCH] integration-cli: update TestCreateWithWorkdir for Hyper-V isolation Hyper-V isolated containers do not allow file-operations on a running container. This test currently uses `docker cp` to verify that the WORKDIR was automatically created, which cannot be done while the container is running. ``` FAIL: docker_cli_create_test.go:302: DockerSuite.TestCreateWithWorkdir assertion failed: Command: d:\CI-7\CI-f3768a669\binary\docker.exe cp foo:c:\home\foo\bar c:\tmp ExitCode: 1 Error: exit status 1 Stdout: Stderr: Error response from daemon: filesystem operations against a running Hyper-V container are not supported Failures: ExitCode was 1 expected 0 Expected no error ``` Signed-off-by: Sebastiaan van Stijn (cherry picked from commit ac9ef840ef94ff66266d3d8b9d32caf570d3b93f) Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_cli_create_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/integration-cli/docker_cli_create_test.go b/integration-cli/docker_cli_create_test.go index 2b1681d32b..cb8171be63 100644 --- a/integration-cli/docker_cli_create_test.go +++ b/integration-cli/docker_cli_create_test.go @@ -309,7 +309,15 @@ func (s *DockerSuite) TestCreateWithWorkdir(c *check.C) { // Windows does not create the workdir until the container is started if testEnv.OSType == "windows" { dockerCmd(c, "start", name) + if IsolationIsHyperv() { + // Hyper-V isolated containers do not allow file-operations on a + // running container. This test currently uses `docker cp` to verify + // that the WORKDIR was automatically created, which cannot be done + // while the container is running. + dockerCmd(c, "stop", name) + } } + // TODO: rewrite this test to not use `docker cp` for verifying that the WORKDIR was created dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), prefix+slash+"tmp") }