Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 76021db

Browse files
committed
Add a test TestLoadFromLocalTarNoTag
1 parent 6ac6d28 commit 76021db

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

integration-cli/hyper_cli_load_local_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,32 @@ func (s *DockerSuite) TestLoadFromLocalTar(c *check.C) {
6969
c.Assert(images, checker.Contains, "hello-world")
7070
}
7171

72+
func (s *DockerSuite) TestLoadFromLocalTarNoTag(c *check.C) {
73+
printTestCaseName()
74+
defer printTestDuration(time.Now())
75+
testRequires(c, DaemonIsLinux)
76+
77+
publicURL := "http://image-tarball.s3.amazonaws.com/test/public/busybox-notag.gz"
78+
imagePath := fmt.Sprintf("%s/busybox-notag.gz", os.Getenv("IMAGE_DIR"))
79+
80+
//download image tar
81+
wgetCmd := exec.Command("wget", "-cO", imagePath, publicURL)
82+
output, exitCode, err := runCommandWithOutput(wgetCmd)
83+
c.Assert(pathExist(imagePath), checker.Equals, true)
84+
c.Assert(exitCode, checker.Equals, 0)
85+
c.Assert(err, checker.IsNil)
86+
87+
//load image tar
88+
output, exitCode, err = dockerCmdWithError("load", "-i", imagePath)
89+
c.Assert(output, checker.Contains, "sha256:c75bebcdd211f41b3a460c7bf82970ed6c75acaab9cd4c9a4e125b03ca113798 has been loaded.")
90+
c.Assert(err, checker.IsNil)
91+
c.Assert(exitCode, checker.Equals, 0)
92+
93+
//check image
94+
images, _ := dockerCmd(c, "images")
95+
c.Assert(images, checker.Contains, "c75bebcdd211")
96+
}
97+
7298
func (s *DockerSuite) TestLoadFromLocalTarDelta(c *check.C) {
7399
printTestCaseName()
74100
defer printTestDuration(time.Now())

0 commit comments

Comments
 (0)