test/e2e: fix pause tests to unpause before cleanup()

The Cleanup() function tries to stop all containers, a paused contianer
cannot be stopped. The tests should make sure it works.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-04-13 16:22:47 +02:00
parent 2ce4e935be
commit cd46e72795
2 changed files with 11 additions and 0 deletions

View File

@ -124,5 +124,11 @@ var _ = Describe("Podman container cleanup", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(125))
Expect(session.ErrorToString()).To(ContainSubstring("container state improper"))
// unpause so that the cleanup can stop the container,
// otherwise it fails with container state improper
session = podmanTest.Podman([]string{"unpause", "paused"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
})

View File

@ -151,6 +151,11 @@ var _ = Describe("Podman pause", func() {
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
// unpause so that the cleanup can stop the container,
// otherwise it fails with container state improper
session = podmanTest.Podman([]string{"unpause", cid})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
It("podman remove a paused container by id with force", func() {