mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
container prune remove state created, configured
podman container prune should remove containers with state Created, Configured to be compatible with docker Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
@ -59,6 +59,34 @@ var _ = Describe("Podman prune", func() {
|
||||
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
|
||||
})
|
||||
|
||||
It("podman container prune after create containers", func() {
|
||||
create := podmanTest.Podman([]string{"create", "--name", "test", BB})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create.ExitCode()).To(Equal(0))
|
||||
|
||||
prune := podmanTest.Podman([]string{"container", "prune", "-f"})
|
||||
prune.WaitWithDefaultTimeout()
|
||||
Expect(prune.ExitCode()).To(Equal(0))
|
||||
|
||||
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman container prune after create & init containers", func() {
|
||||
create := podmanTest.Podman([]string{"create", "--name", "test", BB})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create.ExitCode()).To(Equal(0))
|
||||
|
||||
init := podmanTest.Podman([]string{"init", "test"})
|
||||
init.WaitWithDefaultTimeout()
|
||||
Expect(init.ExitCode()).To(Equal(0))
|
||||
|
||||
prune := podmanTest.Podman([]string{"container", "prune", "-f"})
|
||||
prune.WaitWithDefaultTimeout()
|
||||
Expect(prune.ExitCode()).To(Equal(0))
|
||||
|
||||
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman image prune none images", func() {
|
||||
SkipIfRemote()
|
||||
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
|
||||
|
Reference in New Issue
Block a user