aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-07-13 17:45:55 -0400
committerhaircommander <pehunt@redhat.com>2018-07-20 11:46:11 -0400
commit0fecfeee6398e2db6b7b3fd257645a6ea9aab542 (patch)
tree0c8bc2bc742ae2001f992c777ab0ac4d46947553 /test
parentba1871dac033783ab0329c9b3c9113a34a90992f (diff)
downloadpodman-0fecfeee6398e2db6b7b3fd257645a6ea9aab542.tar.gz
podman-0fecfeee6398e2db6b7b3fd257645a6ea9aab542.tar.bz2
podman-0fecfeee6398e2db6b7b3fd257645a6ea9aab542.zip
Podman load/tag/save prepend localhost when no repository is present
Instead of having docker.io/library as its repository. Test included. Signed-off-by: haircommander <pehunt@redhat.com>
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() {