From 2f53820ce409ce1afb6513b7799d094b9c53779d Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Thu, 12 Feb 2015 15:42:27 -0800 Subject: [PATCH] TestBuildAddTarXz: xz with '-k' due to msys bug TestBuildAddTarXz/TestBuildAddTarXzGz make exec calls like 'cd %SOME_TEMP_DIR%; xz test.gz' but this fails when called from integration-cli tests (doesn't fail from msys or cmd shell). It fails with error: "xz: test.tar: Cannot remove: Permission denied." Proposing workaround of using the `xz --keep` argument since keeping test.tar is harmless and it's already in os.TempDir(). Signed-off-by: Ahmet Alp Balkan --- integration-cli/docker_cli_build_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index c0aae34a5d..14c9835bf8 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -3877,7 +3877,7 @@ func TestBuildAddTarXz(t *testing.T) { if err := tw.Close(); err != nil { t.Fatalf("failed to close tar archive: %v", err) } - xzCompressCmd := exec.Command("xz", "test.tar") + xzCompressCmd := exec.Command("xz", "-k", "test.tar") xzCompressCmd.Dir = tmpDir out, _, err := runCommandWithOutput(xzCompressCmd) if err != nil { @@ -3930,7 +3930,7 @@ func TestBuildAddTarXzGz(t *testing.T) { t.Fatalf("failed to close tar archive: %v", err) } - xzCompressCmd := exec.Command("xz", "test.tar") + xzCompressCmd := exec.Command("xz", "-k", "test.tar") xzCompressCmd.Dir = tmpDir out, _, err := runCommandWithOutput(xzCompressCmd) if err != nil {