mirror of https://github.com/containers/podman.git
Merge pull request #21011 from edsantiago/wait_wait_wait
CI: safer podman-stop tests
This commit is contained in:
commit
d1d38b2aa4
|
@ -508,8 +508,17 @@ func (p *PodmanTestIntegration) RunTopContainerWithArgs(name string, args []stri
|
|||
podmanArgs = append(podmanArgs, "--name", name)
|
||||
}
|
||||
podmanArgs = append(podmanArgs, args...)
|
||||
podmanArgs = append(podmanArgs, "-d", ALPINE, "top")
|
||||
return p.Podman(podmanArgs)
|
||||
podmanArgs = append(podmanArgs, "-d", ALPINE, "top", "-b")
|
||||
session := p.Podman(podmanArgs)
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
// Output indicates that top is running, which means it's safe
|
||||
// for our caller to invoke `podman stop`
|
||||
if !WaitContainerReady(p, cid, "Mem:", 20, 1) {
|
||||
Fail("Could not start a top container")
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
// RunLsContainer runs a simple container in the background that
|
||||
|
|
|
@ -220,8 +220,7 @@ var _ = Describe("Podman prune", func() {
|
|||
session = podmanTest.Podman([]string{"pod", "start", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"pod", "stop", podid1})
|
||||
session = podmanTest.Podman([]string{"pod", "stop", "-t0", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
|
@ -294,8 +293,7 @@ var _ = Describe("Podman prune", func() {
|
|||
session = podmanTest.Podman([]string{"pod", "start", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"pod", "stop", podid1})
|
||||
session = podmanTest.Podman([]string{"pod", "stop", "-t0", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
|
@ -327,8 +325,7 @@ var _ = Describe("Podman prune", func() {
|
|||
session = podmanTest.Podman([]string{"pod", "start", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"pod", "stop", podid1})
|
||||
session = podmanTest.Podman([]string{"pod", "stop", "-t0", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
|
|
|
@ -77,12 +77,15 @@ load helpers
|
|||
# stop -a must print the IDs
|
||||
run_podman run -d $IMAGE top
|
||||
ctrID="$output"
|
||||
# Output means container has set up its signal handlers
|
||||
wait_for_output "Mem:" $ctrID
|
||||
run_podman stop --all
|
||||
is "$output" "$ctrID"
|
||||
|
||||
# stop $input must print $input
|
||||
cname=$(random_string)
|
||||
run_podman run -d --name $cname $IMAGE top
|
||||
wait_for_output "Mem:" $cname
|
||||
run_podman stop $cname
|
||||
is "$output" $cname
|
||||
|
||||
|
|
Loading…
Reference in New Issue