mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
test/e2e: fix CleanupVolume/Secrets()
Just like Cleanup() they should check the error codes. While doing this it was clear that some volume tests were calling Cleanup() twice so remove this. Instead make sure they call Cleanup() themselves so callers only need to do one call. This is required because we cannot use Expect().To() before doing all the cleanup. An error causes panic does results in an early return thus missing potentially important cleanup. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -58,8 +58,6 @@ var _ = Describe("Podman volume prune", func() {
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToStringArray()).To(HaveLen(2))
|
||||
|
||||
podmanTest.Cleanup()
|
||||
})
|
||||
|
||||
It("podman prune volume --filter until", func() {
|
||||
@@ -89,8 +87,6 @@ var _ = Describe("Podman volume prune", func() {
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToStringArray()).To(BeEmpty())
|
||||
|
||||
podmanTest.Cleanup()
|
||||
})
|
||||
|
||||
It("podman prune volume --filter", func() {
|
||||
@@ -157,8 +153,6 @@ var _ = Describe("Podman volume prune", func() {
|
||||
session = podmanTest.Podman([]string{"volume", "prune", "--force", "--filter", "label!=testlabel"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
podmanTest.Cleanup()
|
||||
})
|
||||
|
||||
It("podman system prune --volume", func() {
|
||||
@@ -188,7 +182,5 @@ var _ = Describe("Podman volume prune", func() {
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToStringArray()).To(BeEmpty())
|
||||
|
||||
podmanTest.Cleanup()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user