Skip to content

Commit

Permalink
test: Kill podman pause process after stopping user service
Browse files Browse the repository at this point in the history
Working with user podman API leaves behind a `podman pause` process
which is not attached to/stopped by podman.service. This completely
breaks the API: containers/podman#7180

Closes cockpit-project#473
  • Loading branch information
martinpitt committed Aug 1, 2020
1 parent 710692f commit 68140a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class TestApplication(testlib.MachineCase):
# Enable user service as well
self.restore_dir("/home/admin/.local/share/containers")
self.admin_s.execute("systemctl --now --user enable podman.socket")
# HACK: user podman.service leaks a "podman pause" outside of the unit: https://github.com/containers/podman/issues/7180
self.addCleanup(self.admin_s.execute, "pkill -u $USER -e podman; while pgrep -u $USER -a podman; do sleep 1; done")

self.addCleanup(self.admin_s.execute, "podman rm --force --all; systemctl --user stop podman.service podman.socket")

self.allow_journal_messages("/run.*/podman/podman: couldn't connect.*")
Expand Down Expand Up @@ -807,7 +810,8 @@ class TestApplication(testlib.MachineCase):

def disable_user():
self.execute(False, "systemctl --user disable --now podman.socket")
self.execute(False, "killall podman || true")
# HACK: user podman.service leaks a "podman pause" outside of the unit: https://github.com/containers/podman/issues/7180
self.execute(False, "pkill -u $USER -e podman; while pgrep -u $USER -a podman; do sleep 1; done")

def is_active_system(string):
b.wait(lambda: self.execute(True, "systemctl is-active podman.socket || true").strip() == string)
Expand Down Expand Up @@ -857,6 +861,8 @@ class TestApplication(testlib.MachineCase):

b.logout()
disable_system()
# HACK: Due to https://github.com/containers/podman/issues/7180, avoid user podman.service to time out; make sure to start it afresh
disable_user()
enable_user()
self.login_and_go("/podman")
b.wait_in_text("#overview div.pf-c-alert .pf-c-alert__title", "System Podman service is also available")
Expand Down

0 comments on commit 68140a3

Please sign in to comment.