Add a test for removing dependencies with rm -fa

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2023-05-08 14:04:44 -04:00
parent bafb3d6cc5
commit b75ff3a8fa

View File

@ -322,4 +322,25 @@ var _ = Describe("Podman rm", func() {
Expect(session1).Should(Exit(0))
Expect(session1.OutputToString()).To(BeEquivalentTo(cid4))
})
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))
})
})