mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
test: simplify cleanup code
do not try to first stop and then rm but combine the two operations in a single command. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -516,17 +516,13 @@ func (p *PodmanTestIntegration) PodmanPID(args []string) (*PodmanSessionIntegrat
|
|||||||
|
|
||||||
// Cleanup cleans up the temporary store
|
// Cleanup cleans up the temporary store
|
||||||
func (p *PodmanTestIntegration) Cleanup() {
|
func (p *PodmanTestIntegration) Cleanup() {
|
||||||
// Remove all containers
|
// Remove all pods...
|
||||||
stopall := p.Podman([]string{"stop", "-a", "--time", "0"})
|
podrm := p.Podman([]string{"pod", "rm", "-fa", "-t", "0"})
|
||||||
stopall.WaitWithDefaultTimeout()
|
|
||||||
|
|
||||||
podstop := p.Podman([]string{"pod", "stop", "-a", "-t", "0"})
|
|
||||||
podstop.WaitWithDefaultTimeout()
|
|
||||||
podrm := p.Podman([]string{"pod", "rm", "-fa"})
|
|
||||||
podrm.WaitWithDefaultTimeout()
|
podrm.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
session := p.Podman([]string{"rm", "-fa"})
|
// ...and containers
|
||||||
session.WaitWithDefaultTimeout()
|
rmall := p.Podman([]string{"rm", "-fa", "-t", "0"})
|
||||||
|
rmall.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
p.StopRemoteService()
|
p.StopRemoteService()
|
||||||
// Nuke tempdir
|
// Nuke tempdir
|
||||||
|
Reference in New Issue
Block a user