From b66d6c8ea69f8c1c95556e71a88bd8ce23b21fe5 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 30 Oct 2024 15:54:57 +0100 Subject: [PATCH] test: restore fstab/crypttab for RHEL 8 storage tests When re-trying non-destructive tests the testFstabOptions test fails as /etc/fstab is not restored to its pristine state. CoreOS does not run storage tests so should not restore fstab/crypttab and the ws-container scenario should not stop cockpit as it isn't installed on the host itself. --- test/common/testlib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/common/testlib.py b/test/common/testlib.py index b80f2488ac70..2c13473b8d1e 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -1816,13 +1816,14 @@ def cleanup_home_dirs() -> None: # cockpit configuration self.restore_dir("/etc/cockpit") - if not m.ws_container: + if not m.ostree_image: # for storage tests self.restore_file("/etc/fstab") self.restore_file("/etc/crypttab") - # tests expect cockpit.service to not run at start; also, avoid log leakage into the next test - self.addCleanup(m.execute, "systemctl stop --quiet cockpit") + if not m.ws_container: + # tests expect cockpit.service to not run at start; also, avoid log leakage into the next test + self.addCleanup(m.execute, "systemctl stop --quiet cockpit") # The sssd daemon seems to get confused when we restore # backups of /etc/group etc and stops following updates to it.