From 978bdd6270fafe3187cd41d9be42576b8965e580 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 23 May 2016 10:00:01 -0700 Subject: [PATCH] Fix docker import tests For me when I run the test I see: ``` Downloading from http://nourl/bad Importing 283 B Untar re-exec error: exit status 1: output: unexpected EOF ``` and nothing about "dial tcp" so it appears that the output is system dependent and therefore we can't really check it. I think checking for non-zero exit code is sufficient so I'm removing this string check. Signed-off-by: Doug Davis Upstream-commit: ac043c7db67f268e96c7c7d0236d5316f3a2d9ac Component: engine --- components/engine/integration-cli/docker_cli_import_test.go | 6 +++++- components/engine/pkg/chrootarchive/archive_unix.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/engine/integration-cli/docker_cli_import_test.go b/components/engine/integration-cli/docker_cli_import_test.go index 9420dafa57..dc07fb40ee 100644 --- a/components/engine/integration-cli/docker_cli_import_test.go +++ b/components/engine/integration-cli/docker_cli_import_test.go @@ -35,7 +35,11 @@ func (s *DockerSuite) TestImportBadURL(c *check.C) { testRequires(c, DaemonIsLinux) out, _, err := dockerCmdWithError("import", "http://nourl/bad") c.Assert(err, checker.NotNil, check.Commentf("import was supposed to fail but didn't")) - c.Assert(out, checker.Contains, "dial tcp", check.Commentf("expected an error msg but didn't get one")) + // Depending on your system you can get either of these errors + if !strings.Contains(out, "dial tcp") && + !strings.Contains(out, "Error processing tar file") { + c.Fatalf("expected an error msg but didn't get one.\nErr: %v\nOut: %v", err, out) + } } func (s *DockerSuite) TestImportFile(c *check.C) { diff --git a/components/engine/pkg/chrootarchive/archive_unix.go b/components/engine/pkg/chrootarchive/archive_unix.go index 54a299b8fb..f2325abd74 100644 --- a/components/engine/pkg/chrootarchive/archive_unix.go +++ b/components/engine/pkg/chrootarchive/archive_unix.go @@ -80,7 +80,7 @@ func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.T // pending on write pipe forever io.Copy(ioutil.Discard, decompressedArchive) - return fmt.Errorf("Untar re-exec error: %v: output: %s", err, output) + return fmt.Errorf("Error processing tar file(%v): %s", err, output) } return nil }