mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Merge pull request #21661 from edsantiago/stopsignal
More test tweaks to avoid "StopSignal ... 10 seconds" warning
This commit is contained in:
@ -87,7 +87,7 @@ var _ = Describe("Podman events", func() {
|
||||
It("podman events with a type", func() {
|
||||
setup := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:foobarpod", ALPINE, "top"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
stop := podmanTest.Podman([]string{"pod", "stop", "foobarpod"})
|
||||
stop := podmanTest.Podman([]string{"pod", "stop", "-t0", "foobarpod"})
|
||||
stop.WaitWithDefaultTimeout()
|
||||
Expect(stop).Should(ExitCleanly())
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
|
@ -405,7 +405,8 @@ var _ = Describe("Podman prune", func() {
|
||||
|
||||
session = podmanTest.Podman([]string{"pod", "stop", podid1})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
// FIXME - #20196: Cannot use ExitCleanly()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
// Create a container. This container should be pruned.
|
||||
create := podmanTest.Podman([]string{"create", "--name", "test", BB})
|
||||
|
@ -248,7 +248,8 @@ var _ = Describe("Podman restart", func() {
|
||||
|
||||
result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(ExitCleanly())
|
||||
// FIXME - #20196: Cannot use ExitCleanly()
|
||||
Expect(result).Should(Exit(0))
|
||||
output := result.OutputToString()
|
||||
Expect(output).To(ContainSubstring(cid))
|
||||
})
|
||||
|
@ -329,7 +329,7 @@ var _ = Describe("Podman rm", func() {
|
||||
Expect(ctr2).Should(ExitCleanly())
|
||||
cid2 := ctr2.OutputToString()
|
||||
|
||||
rm := podmanTest.Podman([]string{"rm", "-fa"})
|
||||
rm := podmanTest.Podman([]string{"rm", "-t0", "-fa"})
|
||||
rm.WaitWithDefaultTimeout()
|
||||
Expect(rm).Should(ExitCleanly())
|
||||
Expect(rm.ErrorToString()).To(BeEmpty(), "rm -fa error logged")
|
||||
|
@ -1541,7 +1541,7 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
||||
ctr.WaitWithDefaultTimeout()
|
||||
Expect(ctr).Should(ExitCleanly())
|
||||
|
||||
stop := podmanTest.Podman([]string{"stop", ctrName})
|
||||
stop := podmanTest.Podman([]string{"stop", "-t0", ctrName})
|
||||
stop.WaitWithDefaultTimeout()
|
||||
Expect(stop).Should(ExitCleanly())
|
||||
|
||||
@ -1693,13 +1693,15 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
||||
session := podmanTest.Podman([]string{"create", "--replace", ALPINE, "/bin/sh"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("cannot replace container without --name being set"))
|
||||
|
||||
// Run and replace 5 times in a row the "same" container.
|
||||
ctrName := "testCtr"
|
||||
for i := 0; i < 5; i++ {
|
||||
session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
// FIXME - #20196: Cannot use ExitCleanly()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
// make sure Podman prints only one ID
|
||||
Expect(session.OutputToString()).To(HaveLen(64))
|
||||
|
@ -77,16 +77,13 @@ 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
|
||||
run_podman stop -t0 --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
|
||||
run_podman stop -t0 $cname
|
||||
is "$output" $cname
|
||||
|
||||
run_podman rm -t 0 -f $ctrID $cname
|
||||
|
@ -155,7 +155,7 @@ Labels.l | $mylabel
|
||||
cid=$output
|
||||
run_podman 2 volume rm myvol
|
||||
is "$output" "Error: volume myvol is being used by the following container(s): $cid: volume is being used" "should error since container is running"
|
||||
run_podman volume rm myvol --force
|
||||
run_podman volume rm myvol --force -t0
|
||||
}
|
||||
|
||||
# Running scripts (executables) from a volume
|
||||
|
Reference in New Issue
Block a user