Skip to content

Commit

Permalink
test: ensure podman was stopped fully
Browse files Browse the repository at this point in the history
On Debian-testing restore_dir fails as it tries to copy a file which has
come away. So it seems that systemctl stop did not fully succeed in
stopping podman, ensure it does.
  • Loading branch information
jelly committed Sep 23, 2022
1 parent a7f5d29 commit f80868f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ class TestApplication(testlib.MachineCase):
def setUp(self):
super().setUp()
m = self.machine
m.execute("systemctl stop podman.service; systemctl --now enable podman.socket")
m.execute("""
systemctl stop podman.service; systemctl --now enable podman.socket
# Ensure podman is really stopped, as sometimes restore_dir flakes on Debian-testing
pkill -e -9 podman || true
while pgrep podman; do sleep 0.1; done
findmnt --list -otarget | grep /var/lib/containers/. | xargs -r umount
sync
""")

# backup/restore pristine podman state, so that tests can run on existing testbeds
self.restore_dir("/var/lib/containers", reboot_safe=True)
Expand Down

0 comments on commit f80868f

Please sign in to comment.