|
@@ -14,8 +14,8 @@ import (
|
|
|
"time"
|
|
|
|
|
|
"github.com/docker/distribution/digest"
|
|
|
- "github.com/docker/docker/pkg/integration"
|
|
|
- "github.com/docker/docker/pkg/integration/checker"
|
|
|
+ "github.com/docker/docker/integration-cli/checker"
|
|
|
+ "github.com/docker/docker/pkg/testutil"
|
|
|
"github.com/go-check/check"
|
|
|
)
|
|
|
|
|
@@ -30,7 +30,7 @@ func (s *DockerSuite) TestSaveXzAndLoadRepoStdout(c *check.C) {
|
|
|
|
|
|
dockerCmd(c, "inspect", repoName)
|
|
|
|
|
|
- repoTarball, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ repoTarball, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName),
|
|
|
exec.Command("xz", "-c"),
|
|
|
exec.Command("gzip", "-c"))
|
|
@@ -57,7 +57,7 @@ func (s *DockerSuite) TestSaveXzGzAndLoadRepoStdout(c *check.C) {
|
|
|
|
|
|
dockerCmd(c, "inspect", repoName)
|
|
|
|
|
|
- out, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", repoName),
|
|
|
exec.Command("xz", "-c"),
|
|
|
exec.Command("gzip", "-c"))
|
|
@@ -82,7 +82,7 @@ func (s *DockerSuite) TestSaveSingleTag(c *check.C) {
|
|
|
out, _ := dockerCmd(c, "images", "-q", "--no-trunc", repoName)
|
|
|
cleanedImageID := strings.TrimSpace(out)
|
|
|
|
|
|
- out, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", fmt.Sprintf("%v:latest", repoName)),
|
|
|
exec.Command("tar", "t"),
|
|
|
exec.Command("grep", "-E", fmt.Sprintf("(^repositories$|%v)", cleanedImageID)))
|
|
@@ -101,7 +101,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 = integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err = testutil.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())))
|
|
@@ -159,7 +159,7 @@ func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {
|
|
|
|
|
|
before, _ := dockerCmd(c, "inspect", repoName)
|
|
|
|
|
|
- out, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.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))
|
|
@@ -188,7 +188,7 @@ func (s *DockerSuite) TestSaveMultipleNames(c *check.C) {
|
|
|
// Make two images
|
|
|
dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v-two:latest", repoName))
|
|
|
|
|
|
- out, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.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)"),
|
|
@@ -220,7 +220,7 @@ func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {
|
|
|
deleteImages(repoName)
|
|
|
|
|
|
// create the archive
|
|
|
- out, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.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))
|
|
@@ -267,7 +267,7 @@ func (s *DockerSuite) TestSaveDirectoryPermissions(c *check.C) {
|
|
|
true)
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("%v", err))
|
|
|
|
|
|
- out, _, err := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.RunCommandPipelineWithOutput(
|
|
|
exec.Command(dockerBinary, "save", name),
|
|
|
exec.Command("tar", "-xf", "-", "-C", extractionDirectory),
|
|
|
)
|
|
@@ -286,7 +286,7 @@ func (s *DockerSuite) TestSaveDirectoryPermissions(c *check.C) {
|
|
|
c.Assert(err, checker.IsNil, check.Commentf("failed to open %s: %s", layerPath, err))
|
|
|
defer f.Close()
|
|
|
|
|
|
- entries, err := integration.ListTar(f)
|
|
|
+ entries, err := testutil.ListTar(f)
|
|
|
for _, e := range entries {
|
|
|
if !strings.Contains(e, "dev/") {
|
|
|
entriesSansDev = append(entriesSansDev, e)
|
|
@@ -364,7 +364,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 := integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err := testutil.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))
|
|
@@ -375,7 +375,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 = integration.RunCommandPipelineWithOutput(
|
|
|
+ out, _, err = testutil.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))
|