|
@@ -17,7 +17,6 @@ import (
|
|
|
|
|
|
"github.com/docker/docker/integration-cli/checker"
|
|
|
"github.com/docker/docker/integration-cli/cli/build"
|
|
|
- "github.com/docker/docker/pkg/testutil"
|
|
|
icmd "github.com/docker/docker/pkg/testutil/cmd"
|
|
|
"github.com/go-check/check"
|
|
|
digest "github.com/opencontainers/go-digest"
|
|
@@ -34,7 +33,7 @@ func (s *DockerSuite) TestSaveXzAndLoadRepoStdout(c *check.C) {
|
|
|
|
|
|
dockerCmd(c, "inspect", repoName)
|
|
|
|
|
|
- repoTarball, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ repoTarball, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName),
|
|
|
exec.Command("xz", "-c"),
|
|
|
exec.Command("gzip", "-c"))
|
|
@@ -63,7 +62,7 @@ func (s *DockerSuite) TestSaveXzGzAndLoadRepoStdout(c *check.C) {
|
|
|
|
|
|
dockerCmd(c, "inspect", repoName)
|
|
|
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName),
|
|
|
exec.Command("xz", "-c"),
|
|
|
exec.Command("gzip", "-c"))
|
|
@@ -90,7 +89,7 @@ func (s *DockerSuite) TestSaveSingleTag(c *check.C) {
|
|
|
out, _ := dockerCmd(c, "images", "-q", "--no-trunc", repoName)
|
|
|
cleanedImageID := strings.TrimSpace(out)
|
|
|
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", fmt.Sprintf("%v:latest", repoName)),
|
|
|
exec.Command("tar", "t"),
|
|
|
exec.Command("grep", "-E", fmt.Sprintf("(^repositories$|%v)", cleanedImageID)))
|
|
@@ -109,7 +108,7 @@ func (s *DockerSuite) TestSaveCheckTimes(c *check.C) {
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("failed to marshal from %q: err %v", repoName, err))
|
|
|
c.Assert(len(data), checker.Not(checker.Equals), 0, check.Commentf("failed to marshal the data from %q", repoName))
|
|
|
tarTvTimeFormat := "2006-01-02 15:04"
|
|
|
- out, _, err = testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err = RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName),
|
|
|
exec.Command("tar", "tv"),
|
|
|
exec.Command("grep", "-E", fmt.Sprintf("%s %s", data[0].Created.Format(tarTvTimeFormat), digest.Digest(data[0].ID).Hex())))
|
|
@@ -167,7 +166,7 @@ func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {
|
|
|
|
|
|
before, _ := dockerCmd(c, "inspect", repoName)
|
|
|
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName),
|
|
|
exec.Command(dockerBinary, "load"))
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("failed to save and load repo: %s, %v", out, err))
|
|
@@ -196,7 +195,7 @@ func (s *DockerSuite) TestSaveMultipleNames(c *check.C) {
|
|
|
// Make two images
|
|
|
dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v-two:latest", repoName))
|
|
|
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", fmt.Sprintf("%v-one", repoName), fmt.Sprintf("%v-two:latest", repoName)),
|
|
|
exec.Command("tar", "xO", "repositories"),
|
|
|
exec.Command("grep", "-q", "-E", "(-one|-two)"),
|
|
@@ -228,7 +227,7 @@ func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {
|
|
|
deleteImages(repoName)
|
|
|
|
|
|
// create the archive
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName, "busybox:latest"),
|
|
|
exec.Command("tar", "t"))
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("failed to save multiple images: %s, %v", out, err))
|
|
@@ -272,7 +271,7 @@ func (s *DockerSuite) TestSaveDirectoryPermissions(c *check.C) {
|
|
|
RUN adduser -D user && mkdir -p /opt/a/b && chown -R user:user /opt/a
|
|
|
RUN touch /opt/a/b/c && chown user:user /opt/a/b/c`))
|
|
|
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", name),
|
|
|
exec.Command("tar", "-xf", "-", "-C", extractionDirectory),
|
|
|
)
|
|
@@ -384,7 +383,7 @@ func (s *DockerSuite) TestSaveLoadNoTag(c *check.C) {
|
|
|
id := inspectField(c, name, "Id")
|
|
|
|
|
|
// Test to make sure that save w/o name just shows imageID during load
|
|
|
- out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err := RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", id),
|
|
|
exec.Command(dockerBinary, "load"))
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("failed to save and load repo: %s, %v", out, err))
|
|
@@ -395,7 +394,7 @@ func (s *DockerSuite) TestSaveLoadNoTag(c *check.C) {
|
|
|
c.Assert(out, checker.Contains, id)
|
|
|
|
|
|
// Test to make sure that save by name shows that name during load
|
|
|
- out, _, err = testutil.RunCommandPipelineWithOutput(
|
|
|
+ out, err = RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", name),
|
|
|
exec.Command(dockerBinary, "load"))
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("failed to save and load repo: %s, %v", out, err))
|