Skip to content

Commit

Permalink
Add a test for removing dependencies with rm -fa
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
  • Loading branch information
mheon committed May 9, 2023
1 parent a4877c8 commit 9a5b581
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/e2e/rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,25 @@ var _ = Describe("Podman rm", func() {
Expect(session1).Should(Exit(0))
Expect(session1.OutputToString()).To(BeEquivalentTo(cid2))
})

It("podman rm -fa with dependencies", func() {
ctr1Name := "ctr1"
ctr1 := podmanTest.RunTopContainer(ctr1Name)
ctr1.WaitWithDefaultTimeout()
Expect(ctr1).Should(Exit(0))
cid1 := ctr1.OutputToString()

ctr2 := podmanTest.Podman([]string{"run", "-d", "--network", fmt.Sprintf("container:%s", ctr1Name), ALPINE, "top"})
ctr2.WaitWithDefaultTimeout()
Expect(ctr2).Should(Exit(0))
cid2 := ctr2.OutputToString()

rm := podmanTest.Podman([]string{"rm", "-fa"})
rm.WaitWithDefaultTimeout()
Expect(rm).Should(Exit(0))
Expect(rm.ErrorToString()).To(BeEmpty(), "rm -fa error logged")
Expect(rm.OutputToStringArray()).Should(ConsistOf(cid1, cid2))

Expect(podmanTest.NumberOfContainers()).To(Equal(0))
})
})

0 comments on commit 9a5b581

Please sign in to comment.