summaryrefslogtreecommitdiff
path: root/test/e2e/rmi_test.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-05-14 14:28:50 -0500
committerbaude <bbaude@redhat.com>2019-05-29 15:12:05 -0500
commitf610a485c1bca7a78d3b2f70e2005b79668fab2f (patch)
tree1a3650add2aff9b57ea005c543a29a39ff5b4976 /test/e2e/rmi_test.go
parent8422503f4311555ecb799449b371ad1600a8020f (diff)
downloadpodman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.tar.gz
podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.tar.bz2
podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.zip
use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image stores as read-only image caches. this cuts down on test time significantly because each test does not need to restore the images from a tarball anymore. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/rmi_test.go')
-rw-r--r--test/e2e/rmi_test.go84
1 files changed, 42 insertions, 42 deletions
diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go
index e034f24cf..1687bf764 100644
--- a/test/e2e/rmi_test.go
+++ b/test/e2e/rmi_test.go
@@ -41,14 +41,14 @@ var _ = Describe("Podman rmi", func() {
})
It("podman rmi with fq name", func() {
- session := podmanTest.Podman([]string{"rmi", ALPINE})
+ session := podmanTest.PodmanNoCache([]string{"rmi", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman rmi with short name", func() {
- session := podmanTest.Podman([]string{"rmi", "alpine"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -56,9 +56,9 @@ var _ = Describe("Podman rmi", func() {
It("podman rmi all images", func() {
podmanTest.PullImages([]string{nginx})
- session := podmanTest.Podman([]string{"rmi", "-a"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-a"})
session.WaitWithDefaultTimeout()
- images := podmanTest.Podman([]string{"images"})
+ images := podmanTest.PodmanNoCache([]string{"images"})
images.WaitWithDefaultTimeout()
fmt.Println(images.OutputToStringArray())
Expect(session.ExitCode()).To(Equal(0))
@@ -67,22 +67,22 @@ var _ = Describe("Podman rmi", func() {
It("podman rmi all images forcibly with short options", func() {
podmanTest.PullImages([]string{nginx})
- session := podmanTest.Podman([]string{"rmi", "-fa"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman rmi tagged image", func() {
- setup := podmanTest.Podman([]string{"images", "-q", ALPINE})
+ setup := podmanTest.PodmanNoCache([]string{"images", "-q", ALPINE})
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
- session := podmanTest.Podman([]string{"tag", "alpine", "foo:bar", "foo"})
+ session := podmanTest.PodmanNoCache([]string{"tag", "alpine", "foo:bar", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- result := podmanTest.Podman([]string{"images", "-q", "foo"})
+ result := podmanTest.PodmanNoCache([]string{"images", "-q", "foo"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@@ -90,95 +90,95 @@ var _ = Describe("Podman rmi", func() {
})
It("podman rmi image with tags by ID cannot be done without force", func() {
- setup := podmanTest.Podman([]string{"images", "-q", ALPINE})
+ setup := podmanTest.PodmanNoCache([]string{"images", "-q", ALPINE})
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
alpineId := setup.OutputToString()
- session := podmanTest.Podman([]string{"tag", "alpine", "foo:bar", "foo"})
+ session := podmanTest.PodmanNoCache([]string{"tag", "alpine", "foo:bar", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
// Trying without --force should fail
- result := podmanTest.Podman([]string{"rmi", alpineId})
+ result := podmanTest.PodmanNoCache([]string{"rmi", alpineId})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).ToNot(Equal(0))
// With --force it should work
- resultForce := podmanTest.Podman([]string{"rmi", "-f", alpineId})
+ resultForce := podmanTest.PodmanNoCache([]string{"rmi", "-f", alpineId})
resultForce.WaitWithDefaultTimeout()
Expect(resultForce.ExitCode()).To(Equal(0))
})
It("podman rmi image that is a parent of another image", func() {
SkipIfRemote()
- session := podmanTest.Podman([]string{"rmi", "-fa"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"run", "--name", "c_test", ALPINE, "true"})
+ session = podmanTest.PodmanNoCache([]string{"run", "--name", "c_test", ALPINE, "true"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"commit", "-q", "c_test", "test"})
+ session = podmanTest.PodmanNoCache([]string{"commit", "-q", "c_test", "test"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rm", "c_test"})
+ session = podmanTest.PodmanNoCache([]string{"rm", "c_test"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", ALPINE})
+ session = podmanTest.PodmanNoCache([]string{"rmi", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"images", "-q"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(1))
- session = podmanTest.Podman([]string{"images", "-q", "-a"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q", "-a"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(2))
untaggedImg := session.OutputToStringArray()[1]
- session = podmanTest.Podman([]string{"rmi", "-f", untaggedImg})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "-f", untaggedImg})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Not(Equal(0)))
})
It("podman rmi image that is created from another named imaged", func() {
SkipIfRemote()
- session := podmanTest.Podman([]string{"rmi", "-fa"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"create", "--name", "c_test1", ALPINE, "true"})
+ session = podmanTest.PodmanNoCache([]string{"create", "--name", "c_test1", ALPINE, "true"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"commit", "-q", "c_test1", "test1"})
+ session = podmanTest.PodmanNoCache([]string{"commit", "-q", "c_test1", "test1"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"create", "--name", "c_test2", "test1", "true"})
+ session = podmanTest.PodmanNoCache([]string{"create", "--name", "c_test2", "test1", "true"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"commit", "-q", "c_test2", "test2"})
+ session = podmanTest.PodmanNoCache([]string{"commit", "-q", "c_test2", "test2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rm", "-a"})
+ session = podmanTest.PodmanNoCache([]string{"rm", "-a"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "test2"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "test2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"images", "-q"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(2))
@@ -186,7 +186,7 @@ var _ = Describe("Podman rmi", func() {
It("podman rmi with cached images", func() {
SkipIfRemote()
- session := podmanTest.Podman([]string{"rmi", "-fa"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -205,51 +205,51 @@ var _ = Describe("Podman rmi", func() {
`
podmanTest.BuildImage(dockerfile, "test2", "true")
- session = podmanTest.Podman([]string{"images", "-q", "-a"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q", "-a"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
numOfImages := len(session.OutputToStringArray())
- session = podmanTest.Podman([]string{"rmi", "test2"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "test2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"images", "-q", "-a"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q", "-a"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(numOfImages - len(session.OutputToStringArray())).To(Equal(2))
- session = podmanTest.Podman([]string{"rmi", "test"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "test"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"images", "-q", "-a"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q", "-a"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(Equal(1))
podmanTest.BuildImage(dockerfile, "test3", "true")
- session = podmanTest.Podman([]string{"rmi", ALPINE})
+ session = podmanTest.PodmanNoCache([]string{"rmi", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "test3"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "test3"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"images", "-q", "-a"})
+ session = podmanTest.PodmanNoCache([]string{"images", "-q", "-a"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToString())).To(Equal(0))
})
It("podman rmi -a with no images should be exit 0", func() {
- session := podmanTest.Podman([]string{"rmi", "-fa"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session2 := podmanTest.Podman([]string{"rmi", "-fa"})
+ session2 := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session2.WaitWithDefaultTimeout()
Expect(session2.ExitCode()).To(Equal(0))
})
@@ -265,12 +265,12 @@ RUN find $LOCAL
`
podmanTest.BuildImage(dockerfile, "test", "true")
- session := podmanTest.Podman([]string{"rmi", "-a"})
+ session := podmanTest.PodmanNoCache([]string{"rmi", "-a"})
session.WaitWithDefaultTimeout()
fmt.Println(session.OutputToString())
Expect(session.ExitCode()).To(Equal(0))
- images := podmanTest.Podman([]string{"images", "-aq"})
+ images := podmanTest.PodmanNoCache([]string{"images", "-aq"})
images.WaitWithDefaultTimeout()
Expect(images.ExitCode()).To(Equal(0))
Expect(len(images.OutputToStringArray())).To(Equal(0))
@@ -279,7 +279,7 @@ RUN find $LOCAL
// Don't rerun all tests; just assume that if we get that diagnostic,
// we're getting rmi
It("podman image rm is the same as rmi", func() {
- session := podmanTest.Podman([]string{"image", "rm"})
+ session := podmanTest.PodmanNoCache([]string{"image", "rm"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(125))
Expect(session.LineInOutputContains("image name or ID must be specified"))