Skip to content

Commit

Permalink
test/e2e: fix "podman run ipcns ipcmk container test"
Browse files Browse the repository at this point in the history
The test will leak processes because the rm -fa in the cleanup failed.
This happens because podman tried to remove the contianers in the wrong
order and thus ppodman failed with:
`contianer XXX has dependent containers which must be removed before it`

For now I patch the test but it should be much better if we can fix it
in podman to remove in the correct order. `--all` should mean all I do
not care if there is a dependent container, just get rid of it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 committed Apr 21, 2023
1 parent 6e637f8 commit 597d0f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/e2e/run_ns_test.go
Expand Up @@ -85,7 +85,7 @@ var _ = Describe("Podman run ns", func() {
})

It("podman run ipcns ipcmk container test", func() {
setup := podmanTest.Podman([]string{"run", "-d", "--name", "test1", fedoraMinimal, "sleep", "999"})
setup := podmanTest.Podman([]string{"run", "-d", "--name", "test1", fedoraMinimal, "sleep", "30"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))

Expand All @@ -94,7 +94,12 @@ var _ = Describe("Podman run ns", func() {
Expect(session).Should(Exit(0))
output := strings.Split(session.OutputToString(), " ")
ipc := output[len(output)-1]
session = podmanTest.Podman([]string{"run", "--ipc=container:test1", fedoraMinimal, "ipcs", "-m", "-i", ipc})
session = podmanTest.Podman([]string{"run", "--name=t2", "--ipc=container:test1", fedoraMinimal, "ipcs", "-m", "-i", ipc})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))

// We have to remove the dependency container first, rm --all fails in the cleanup because of the unknown ordering.
session = podmanTest.Podman([]string{"rm", "t2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
Expand Down

0 comments on commit 597d0f2

Please sign in to comment.