summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-07-20 12:50:18 -0400
committerGitHub <noreply@github.com>2018-07-20 12:50:18 -0400
commit6cae4a0e94cf2ee66687ee0cbf553270396c2d5c (patch)
treea383b1728be7a00732a16ba7e3a504e5ebce3766 /test
parent7944bca4681893971ad6bda4ade4e1b3470b9559 (diff)
parent0fecfeee6398e2db6b7b3fd257645a6ea9aab542 (diff)
downloadpodman-6cae4a0e94cf2ee66687ee0cbf553270396c2d5c.tar.gz
podman-6cae4a0e94cf2ee66687ee0cbf553270396c2d5c.tar.bz2
podman-6cae4a0e94cf2ee66687ee0cbf553270396c2d5c.zip
Merge pull request #1103 from haircommander/load_dockerless
Podman load/tag/save prepends localhost when no registry is present
Diffstat (limited to 'test')
-rw-r--r--test/e2e/load_test.go56
-rw-r--r--test/e2e/tag_test.go6
2 files changed, 59 insertions, 3 deletions
diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go
index 3fe68ad8e..d39f75927 100644
--- a/test/e2e/load_test.go
+++ b/test/e2e/load_test.go
@@ -161,4 +161,60 @@ var _ = Describe("Podman load", func() {
inspect.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
})
+
+ It("podman load localhost repo from scratch", func() {
+ outfile := filepath.Join(podmanTest.TempDir, "load_test.tar.gz")
+ setup := podmanTest.Podman([]string{"pull", fedoraMinimal})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.Podman([]string{"tag", "fedora-minimal", "hello:world"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", "hello:world"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.Podman([]string{"rmi", "hello:world"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ load := podmanTest.Podman([]string{"load", "-i", outfile})
+ load.WaitWithDefaultTimeout()
+ Expect(load.ExitCode()).To(Equal(0))
+
+ result := podmanTest.Podman([]string{"images", "-f", "label", "hello:world"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.LineInOutputContains("docker")).To(Not(BeTrue()))
+ Expect(result.LineInOutputContains("localhost")).To(BeTrue())
+ })
+
+ It("podman load localhost repo from dir", func() {
+ outfile := filepath.Join(podmanTest.TempDir, "load")
+ setup := podmanTest.Podman([]string{"pull", fedoraMinimal})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.Podman([]string{"tag", "fedora-minimal", "hello:world"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-dir", "hello:world"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ setup = podmanTest.Podman([]string{"rmi", "hello:world"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ load := podmanTest.Podman([]string{"load", "-i", outfile})
+ load.WaitWithDefaultTimeout()
+ Expect(load.ExitCode()).To(Equal(0))
+
+ result := podmanTest.Podman([]string{"images", "-f", "label", "load:latest"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.LineInOutputContains("docker")).To(Not(BeTrue()))
+ Expect(result.LineInOutputContains("localhost")).To(BeTrue())
+ })
})
diff --git a/test/e2e/tag_test.go b/test/e2e/tag_test.go
index 5b578ee07..b07bc5550 100644
--- a/test/e2e/tag_test.go
+++ b/test/e2e/tag_test.go
@@ -38,7 +38,7 @@ var _ = Describe("Podman tag", func() {
Expect(results.ExitCode()).To(Equal(0))
inspectData := results.InspectImageJSON()
Expect(StringInSlice("docker.io/library/alpine:latest", inspectData[0].RepoTags)).To(BeTrue())
- Expect(StringInSlice("foobar:latest", inspectData[0].RepoTags)).To(BeTrue())
+ Expect(StringInSlice("localhost/foobar:latest", inspectData[0].RepoTags)).To(BeTrue())
})
It("podman tag shortname", func() {
@@ -51,7 +51,7 @@ var _ = Describe("Podman tag", func() {
Expect(results.ExitCode()).To(Equal(0))
inspectData := results.InspectImageJSON()
Expect(StringInSlice("docker.io/library/alpine:latest", inspectData[0].RepoTags)).To(BeTrue())
- Expect(StringInSlice("foobar:latest", inspectData[0].RepoTags)).To(BeTrue())
+ Expect(StringInSlice("localhost/foobar:latest", inspectData[0].RepoTags)).To(BeTrue())
})
It("podman tag shortname:tag", func() {
@@ -64,7 +64,7 @@ var _ = Describe("Podman tag", func() {
Expect(results.ExitCode()).To(Equal(0))
inspectData := results.InspectImageJSON()
Expect(StringInSlice("docker.io/library/alpine:latest", inspectData[0].RepoTags)).To(BeTrue())
- Expect(StringInSlice("foobar:new", inspectData[0].RepoTags)).To(BeTrue())
+ Expect(StringInSlice("localhost/foobar:new", inspectData[0].RepoTags)).To(BeTrue())
})
It("podman tag shortname image no tag", func() {