Skip to content

Commit

Permalink
test/e2e: fix pause tests to unpause before cleanup()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Luap99 committed May 2, 2023
1 parent 2ce4e93 commit cd46e72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
})
5 changes: 5 additions & 0 deletions test/e2e/pause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit cd46e72

Please sign in to comment.