|
@@ -10,6 +10,7 @@ import (
|
|
|
"strings"
|
|
|
|
|
|
"github.com/docker/docker/pkg/integration/checker"
|
|
|
+ icmd "github.com/docker/docker/pkg/integration/cmd"
|
|
|
"github.com/go-check/check"
|
|
|
)
|
|
|
|
|
@@ -125,3 +126,25 @@ func (s *DockerSuite) TestImportFileNonExistentFile(c *check.C) {
|
|
|
_, _, err := dockerCmdWithError("import", "example.com/myImage.tar")
|
|
|
c.Assert(err, checker.NotNil, check.Commentf("import non-existing file must failed"))
|
|
|
}
|
|
|
+
|
|
|
+func (s *DockerSuite) TestImportWithQuotedChanges(c *check.C) {
|
|
|
+ testRequires(c, DaemonIsLinux)
|
|
|
+ dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
|
|
|
+
|
|
|
+ temporaryFile, err := ioutil.TempFile("", "exportImportTest")
|
|
|
+ c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary file"))
|
|
|
+ defer os.Remove(temporaryFile.Name())
|
|
|
+
|
|
|
+ result := icmd.RunCmd(icmd.Cmd{
|
|
|
+ Command: binaryWithArgs("export", "test-import"),
|
|
|
+ Stdout: bufio.NewWriter(temporaryFile),
|
|
|
+ })
|
|
|
+ c.Assert(result, icmd.Matches, icmd.Success)
|
|
|
+
|
|
|
+ result = dockerCmdWithResult("import", "-c", `ENTRYPOINT ["/bin/sh", "-c"]`, temporaryFile.Name())
|
|
|
+ c.Assert(result, icmd.Matches, icmd.Success)
|
|
|
+ image := strings.TrimSpace(result.Stdout())
|
|
|
+
|
|
|
+ result = dockerCmdWithResult("run", "--rm", image, "true")
|
|
|
+ c.Assert(result, icmd.Matches, icmd.Expected{Out: icmd.None})
|
|
|
+}
|