]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: clean up our mess after the pstore test
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 2 Jun 2023 08:07:57 +0000 (10:07 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 2 Jun 2023 08:07:57 +0000 (10:07 +0200)
test/units/testsuite-74.pstore.sh

index 1b475a3f2a398b8347f0fa8e4ac3f5b339417263..9be8066e8e2b9919a2881d27539a7dd67b24c43e 100755 (executable)
@@ -125,6 +125,17 @@ start_pstore() {
     journalctl --sync
 }
 
+at_exit() {
+    set +e
+
+    mountpoint -q /sys/fs/pstore && umount /sys/fs/pstore
+    rm -fr /var/lib/systemd/pstore/*
+    rm -f /run/systemd/system/systemd-pstore.service.d/99-StartLimitInterval.conf
+    rm -f /run/systemd/pstore.conf.d/99-test.conf
+}
+
+trap at_exit EXIT
+
 # To avoid having to depend on the VM providing the pstore, let's simulate
 # it using a simple bind mount
 PSTORE_DIR="$(mktemp -d)"