Merge pull request #6052 from sujil02/enable-prune-test

Enable prune integration test. Fixes container prune
This commit is contained in:
OpenShift Merge Robot
2020-04-30 21:06:11 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@ -869,7 +869,8 @@ func (r *Runtime) PruneContainers(filterFuncs []ContainerFilter) (map[string]int
logrus.Error(err) logrus.Error(err)
return false return false
} }
if state == define.ContainerStateStopped || state == define.ContainerStateExited { if state == define.ContainerStateStopped || state == define.ContainerStateExited ||
state == define.ContainerStateCreated || state == define.ContainerStateConfigured {
return true return true
} }
return false return false

View File

@ -22,7 +22,6 @@ var _ = Describe("Podman prune", func() {
) )
BeforeEach(func() { BeforeEach(func() {
Skip(v2fail)
tempdir, err = CreateTempDirInTempDir() tempdir, err = CreateTempDirInTempDir()
if err != nil { if err != nil {
os.Exit(1) os.Exit(1)
@ -149,6 +148,7 @@ var _ = Describe("Podman prune", func() {
It("podman system image prune unused images", func() { It("podman system image prune unused images", func() {
SkipIfRemote() SkipIfRemote()
Skip(v2fail)
podmanTest.RestoreAllArtifacts() podmanTest.RestoreAllArtifacts()
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
prune := podmanTest.PodmanNoCache([]string{"system", "prune", "-a", "--force"}) prune := podmanTest.PodmanNoCache([]string{"system", "prune", "-a", "--force"})
@ -162,6 +162,7 @@ var _ = Describe("Podman prune", func() {
}) })
It("podman system prune pods", func() { It("podman system prune pods", func() {
Skip(v2fail)
session := podmanTest.Podman([]string{"pod", "create"}) session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0)) Expect(session.ExitCode()).To(Equal(0))