mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
Merge pull request #19897 from edsantiago/e2e_check_stderr_checkpoint
e2e: use ExitCleanly() in checkpoint tests
This commit is contained in:
@ -10,7 +10,6 @@ import (
|
|||||||
. "github.com/containers/podman/v4/test/utils"
|
. "github.com/containers/podman/v4/test/utils"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
. "github.com/onsi/gomega/gexec"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Podman checkpoint", func() {
|
var _ = Describe("Podman checkpoint", func() {
|
||||||
@ -55,20 +54,20 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
}
|
}
|
||||||
session := podmanTest.Podman(localRunString)
|
session := podmanTest.Podman(localRunString)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
containerID := session.OutputToString()
|
containerID := session.OutputToString()
|
||||||
|
|
||||||
// Checkpoint image should not exist
|
// Checkpoint image should not exist
|
||||||
session = podmanTest.Podman([]string{"images"})
|
session = podmanTest.Podman([]string{"images"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeFalse())
|
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeFalse())
|
||||||
|
|
||||||
// Check if none of the checkpoint/restore specific information is displayed
|
// Check if none of the checkpoint/restore specific information is displayed
|
||||||
// for newly started containers.
|
// for newly started containers.
|
||||||
inspect := podmanTest.Podman([]string{"inspect", containerID})
|
inspect := podmanTest.Podman([]string{"inspect", containerID})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
inspectOut := inspect.InspectContainerToJSON()
|
inspectOut := inspect.InspectContainerToJSON()
|
||||||
Expect(inspectOut[0].State.Checkpointed).To(BeFalse(), ".State.Checkpointed")
|
Expect(inspectOut[0].State.Checkpointed).To(BeFalse(), ".State.Checkpointed")
|
||||||
Expect(inspectOut[0].State.Restored).To(BeFalse(), ".State.Restored")
|
Expect(inspectOut[0].State.Restored).To(BeFalse(), ".State.Restored")
|
||||||
@ -79,13 +78,13 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "--keep", containerID})
|
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "--keep", containerID})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Exited"))
|
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Exited"))
|
||||||
|
|
||||||
inspect = podmanTest.Podman([]string{"inspect", containerID})
|
inspect = podmanTest.Podman([]string{"inspect", containerID})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
inspectOut = inspect.InspectContainerToJSON()
|
inspectOut = inspect.InspectContainerToJSON()
|
||||||
Expect(inspectOut[0].State.Checkpointed).To(BeTrue(), ".State.Checkpointed")
|
Expect(inspectOut[0].State.Checkpointed).To(BeTrue(), ".State.Checkpointed")
|
||||||
Expect(inspectOut[0].State.CheckpointPath).To(ContainSubstring("userdata/checkpoint"))
|
Expect(inspectOut[0].State.CheckpointPath).To(ContainSubstring("userdata/checkpoint"))
|
||||||
@ -94,13 +93,13 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
// Check if checkpoint image has been created
|
// Check if checkpoint image has been created
|
||||||
session = podmanTest.Podman([]string{"images"})
|
session = podmanTest.Podman([]string{"images"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeTrue())
|
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeTrue())
|
||||||
|
|
||||||
// Check if the checkpoint image contains annotations
|
// Check if the checkpoint image contains annotations
|
||||||
inspect = podmanTest.Podman([]string{"inspect", checkpointImage})
|
inspect = podmanTest.Podman([]string{"inspect", checkpointImage})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
inspectImageOut := inspect.InspectImageJSON()
|
inspectImageOut := inspect.InspectImageJSON()
|
||||||
Expect(inspectImageOut[0].Annotations["io.podman.annotations.checkpoint.name"]).To(
|
Expect(inspectImageOut[0].Annotations["io.podman.annotations.checkpoint.name"]).To(
|
||||||
BeEquivalentTo(containerName),
|
BeEquivalentTo(containerName),
|
||||||
@ -123,25 +122,25 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
// Remove existing container
|
// Remove existing container
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerID})
|
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerID})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
|
|
||||||
// Restore container from checkpoint image
|
// Restore container from checkpoint image
|
||||||
result = podmanTest.Podman([]string{"container", "restore", checkpointImage})
|
result = podmanTest.Podman([]string{"container", "restore", checkpointImage})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
||||||
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up"))
|
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Up"))
|
||||||
|
|
||||||
// Clean-up
|
// Clean-up
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
result = podmanTest.Podman([]string{"rmi", checkpointImage})
|
result = podmanTest.Podman([]string{"rmi", checkpointImage})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -153,57 +152,57 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
localRunString := []string{"run", "-d", "--name", containerName, ALPINE, "top"}
|
localRunString := []string{"run", "-d", "--name", containerName, ALPINE, "top"}
|
||||||
session := podmanTest.Podman(localRunString)
|
session := podmanTest.Podman(localRunString)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
containerID := session.OutputToString()
|
containerID := session.OutputToString()
|
||||||
|
|
||||||
// Checkpoint image should not exist
|
// Checkpoint image should not exist
|
||||||
session = podmanTest.Podman([]string{"images"})
|
session = podmanTest.Podman([]string{"images"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeFalse())
|
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeFalse())
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "--keep", containerID})
|
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "--keep", containerID})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Exited"))
|
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Exited"))
|
||||||
|
|
||||||
// Check if checkpoint image has been created
|
// Check if checkpoint image has been created
|
||||||
session = podmanTest.Podman([]string{"images"})
|
session = podmanTest.Podman([]string{"images"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeTrue())
|
Expect(session.LineInOutputContainsTag("localhost/"+checkpointImage, "latest")).To(BeTrue())
|
||||||
|
|
||||||
// Remove existing container
|
// Remove existing container
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerID})
|
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerID})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
|
|
||||||
for i := 1; i < 5; i++ {
|
for i := 1; i < 5; i++ {
|
||||||
// Restore container from checkpoint image
|
// Restore container from checkpoint image
|
||||||
name := containerName + strconv.Itoa(i)
|
name := containerName + strconv.Itoa(i)
|
||||||
result = podmanTest.Podman([]string{"container", "restore", "--name", name, checkpointImage})
|
result = podmanTest.Podman([]string{"container", "restore", "--name", name, checkpointImage})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(i))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(i))
|
||||||
|
|
||||||
// Check that the container is running
|
// Check that the container is running
|
||||||
status := podmanTest.Podman([]string{"inspect", name, "--format={{.State.Status}}"})
|
status := podmanTest.Podman([]string{"inspect", name, "--format={{.State.Status}}"})
|
||||||
status.WaitWithDefaultTimeout()
|
status.WaitWithDefaultTimeout()
|
||||||
Expect(status).Should(Exit(0))
|
Expect(status).Should(ExitCleanly())
|
||||||
Expect(status.OutputToString()).To(Equal("running"))
|
Expect(status.OutputToString()).To(Equal("running"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean-up
|
// Clean-up
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
result = podmanTest.Podman([]string{"rmi", checkpointImage})
|
result = podmanTest.Podman([]string{"rmi", checkpointImage})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -218,60 +217,60 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
localRunString := []string{"run", "-d", "--name", containerName1, ALPINE, "top"}
|
localRunString := []string{"run", "-d", "--name", containerName1, ALPINE, "top"}
|
||||||
session := podmanTest.Podman(localRunString)
|
session := podmanTest.Podman(localRunString)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
containerID1 := session.OutputToString()
|
containerID1 := session.OutputToString()
|
||||||
|
|
||||||
// Create second container
|
// Create second container
|
||||||
localRunString = []string{"run", "-d", "--name", containerName2, ALPINE, "top"}
|
localRunString = []string{"run", "-d", "--name", containerName2, ALPINE, "top"}
|
||||||
session = podmanTest.Podman(localRunString)
|
session = podmanTest.Podman(localRunString)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
containerID2 := session.OutputToString()
|
containerID2 := session.OutputToString()
|
||||||
|
|
||||||
// Checkpoint first container
|
// Checkpoint first container
|
||||||
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage1, "--keep", containerID1})
|
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage1, "--keep", containerID1})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
||||||
|
|
||||||
// Checkpoint second container
|
// Checkpoint second container
|
||||||
result = podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage2, "--keep", containerID2})
|
result = podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage2, "--keep", containerID2})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
// Remove existing containers
|
// Remove existing containers
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerName1, containerName2})
|
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerName1, containerName2})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
|
|
||||||
// Restore both containers from images
|
// Restore both containers from images
|
||||||
result = podmanTest.Podman([]string{"container", "restore", checkpointImage1, checkpointImage2})
|
result = podmanTest.Podman([]string{"container", "restore", checkpointImage1, checkpointImage2})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
||||||
|
|
||||||
// Check if first container is running
|
// Check if first container is running
|
||||||
status := podmanTest.Podman([]string{"inspect", containerName1, "--format={{.State.Status}}"})
|
status := podmanTest.Podman([]string{"inspect", containerName1, "--format={{.State.Status}}"})
|
||||||
status.WaitWithDefaultTimeout()
|
status.WaitWithDefaultTimeout()
|
||||||
Expect(status).Should(Exit(0))
|
Expect(status).Should(ExitCleanly())
|
||||||
Expect(status.OutputToString()).To(Equal("running"))
|
Expect(status.OutputToString()).To(Equal("running"))
|
||||||
|
|
||||||
// Check if second container is running
|
// Check if second container is running
|
||||||
status = podmanTest.Podman([]string{"inspect", containerName2, "--format={{.State.Status}}"})
|
status = podmanTest.Podman([]string{"inspect", containerName2, "--format={{.State.Status}}"})
|
||||||
status.WaitWithDefaultTimeout()
|
status.WaitWithDefaultTimeout()
|
||||||
Expect(status).Should(Exit(0))
|
Expect(status).Should(ExitCleanly())
|
||||||
Expect(status.OutputToString()).To(Equal("running"))
|
Expect(status.OutputToString()).To(Equal("running"))
|
||||||
|
|
||||||
// Clean-up
|
// Clean-up
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
result = podmanTest.Podman([]string{"rmi", checkpointImage1, checkpointImage2})
|
result = podmanTest.Podman([]string{"rmi", checkpointImage1, checkpointImage2})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -284,41 +283,41 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
localRunString := []string{"run", "-d", "--name", containerName, ALPINE, "top"}
|
localRunString := []string{"run", "-d", "--name", containerName, ALPINE, "top"}
|
||||||
session := podmanTest.Podman(localRunString)
|
session := podmanTest.Podman(localRunString)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
containerID1 := session.OutputToString()
|
containerID1 := session.OutputToString()
|
||||||
|
|
||||||
// Checkpoint container, create checkpoint image
|
// Checkpoint container, create checkpoint image
|
||||||
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "--keep", containerID1})
|
result := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "--keep", containerID1})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
// Remove existing container
|
// Remove existing container
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerName})
|
result = podmanTest.Podman([]string{"rm", "-t", "1", "-f", containerName})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
|
|
||||||
// Restore containers from image using `podman run`
|
// Restore containers from image using `podman run`
|
||||||
result = podmanTest.Podman([]string{"run", checkpointImage})
|
result = podmanTest.Podman([]string{"run", checkpointImage})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
||||||
|
|
||||||
// Check if the container is running
|
// Check if the container is running
|
||||||
status := podmanTest.Podman([]string{"inspect", containerName, "--format={{.State.Status}}"})
|
status := podmanTest.Podman([]string{"inspect", containerName, "--format={{.State.Status}}"})
|
||||||
status.WaitWithDefaultTimeout()
|
status.WaitWithDefaultTimeout()
|
||||||
Expect(status).Should(Exit(0))
|
Expect(status).Should(ExitCleanly())
|
||||||
Expect(status.OutputToString()).To(Equal("running"))
|
Expect(status.OutputToString()).To(Equal("running"))
|
||||||
|
|
||||||
// Clean-up
|
// Clean-up
|
||||||
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
result = podmanTest.Podman([]string{"rm", "-t", "0", "-fa"})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
result = podmanTest.Podman([]string{"rmi", checkpointImage})
|
result = podmanTest.Podman([]string{"rmi", checkpointImage})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -201,9 +201,12 @@ func (matcher *exitCleanlyMatcher) Match(actual interface{}) (success bool, err
|
|||||||
// FIXME: #19809, "failed to connect to syslog" warnings on f38
|
// FIXME: #19809, "failed to connect to syslog" warnings on f38
|
||||||
// FIXME: so, until that is fixed, don't check stderr if containerized
|
// FIXME: so, until that is fixed, don't check stderr if containerized
|
||||||
if !Containerized() {
|
if !Containerized() {
|
||||||
if stderr != "" {
|
info := GetHostDistributionInfo()
|
||||||
matcher.msg = fmt.Sprintf("Unexpected warnings seen on stderr: %q", stderr)
|
if info.Distribution == "fedora" {
|
||||||
return false, nil
|
if stderr != "" {
|
||||||
|
matcher.msg = fmt.Sprintf("Unexpected warnings seen on stderr: %q", stderr)
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user