Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Move from restore_dir() to podman system reset for system #1601

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ class TestApplication(testlib.MachineCase):
while pgrep podman; do sleep 0.1; done
pkill -e -9 conmon || true
while pgrep conmon; 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")
# install our test images
m.execute('for img in /var/lib/test-images/*.tar; do podman load < "$img"; done')

self.addCleanup(m.execute, """
systemctl stop podman.service podman.socket
Expand All @@ -127,10 +125,6 @@ class TestApplication(testlib.MachineCase):
while pgrep podman; do sleep 0.1; done
pkill -e -9 conmon || true
while pgrep conmon; do sleep 0.1; done

# HACK: sometimes podman leaks mounts
findmnt --list -otarget | grep /var/lib/containers/. | xargs -r umount
sync
""")

# Create admin session
Expand All @@ -147,7 +141,7 @@ class TestApplication(testlib.MachineCase):
ssh_port=m.ssh_port,
identity_file=m.identity_file)

# Enable user service as well; copy our images (except cockpit/ws) from system
# Enable user service as well; install our test images (except cockpit/ws)
self.admin_s.execute("""
systemctl --user stop podman.service
for img in $(ls /var/lib/test-images/*.tar | grep -v cockpitws); do podman load < "$img"; done
Expand Down