]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-55-OOMD: use /run/ for configuration instead of /etc/
authorLuca Boccassi <bluca@debian.org>
Fri, 16 Jun 2023 23:01:24 +0000 (00:01 +0100)
committerLuca Boccassi <bluca@debian.org>
Fri, 16 Jun 2023 23:08:09 +0000 (00:08 +0100)
Make sure configuration is ephemeral if the image is reused

test/units/testsuite-55.sh

index 0887eac08f7ff98af26c0e6cb3bfb04fa7253921..4503553eac2fa7a970d44a17b46bb08225930725 100755 (executable)
@@ -22,18 +22,18 @@ if [[ -e /skipped ]]; then
     exit 0
 fi
 
-rm -rf /etc/systemd/system/testsuite-55-testbloat.service.d
+rm -rf /run/systemd/system/testsuite-55-testbloat.service.d
 
 # Configure oomd explicitly to avoid conflicts with distro dropins
-mkdir -p /etc/systemd/oomd.conf.d/
-echo -e "[OOM]\nDefaultMemoryPressureDurationSec=2s" >/etc/systemd/oomd.conf.d/99-oomd-test.conf
-mkdir -p /etc/systemd/system/-.slice.d/
-echo -e "[Slice]\nManagedOOMSwap=auto" >/etc/systemd/system/-.slice.d/99-oomd-test.conf
-mkdir -p /etc/systemd/system/user@.service.d/
-echo -e "[Service]\nManagedOOMMemoryPressure=auto\nManagedOOMMemoryPressureLimit=0%" >/etc/systemd/system/user@.service.d/99-oomd-test.conf
+mkdir -p /run/systemd/oomd.conf.d/
+echo -e "[OOM]\nDefaultMemoryPressureDurationSec=2s" >/run/systemd/oomd.conf.d/99-oomd-test.conf
+mkdir -p /run/systemd/system/-.slice.d/
+echo -e "[Slice]\nManagedOOMSwap=auto" >/run/systemd/system/-.slice.d/99-oomd-test.conf
+mkdir -p /run/systemd/system/user@.service.d/
+echo -e "[Service]\nManagedOOMMemoryPressure=auto\nManagedOOMMemoryPressureLimit=0%" >/run/systemd/system/user@.service.d/99-oomd-test.conf
 
-mkdir -p /etc/systemd/system/systemd-oomd.service.d/
-echo -e "[Service]\nEnvironment=SYSTEMD_LOG_LEVEL=debug" >/etc/systemd/system/systemd-oomd.service.d/debug.conf
+mkdir -p /run/systemd/system/systemd-oomd.service.d/
+echo -e "[Service]\nEnvironment=SYSTEMD_LOG_LEVEL=debug" >/run/systemd/system/systemd-oomd.service.d/debug.conf
 
 systemctl daemon-reload
 
@@ -122,9 +122,9 @@ if ! systemctl --machine "testuser@.host" --user status testsuite-55-testchill.s
 if setfattr -n user.xattr_test -v 1 /sys/fs/cgroup/; then
     sleep 120 # wait for systemd-oomd kill cool down and elevated memory pressure to come down
 
-    mkdir -p /etc/systemd/system/testsuite-55-testbloat.service.d/
-    echo "[Service]" >/etc/systemd/system/testsuite-55-testbloat.service.d/override.conf
-    echo "ManagedOOMPreference=avoid" >>/etc/systemd/system/testsuite-55-testbloat.service.d/override.conf
+    mkdir -p /run/systemd/system/testsuite-55-testbloat.service.d/
+    echo "[Service]" >/run/systemd/system/testsuite-55-testbloat.service.d/override.conf
+    echo "ManagedOOMPreference=avoid" >>/run/systemd/system/testsuite-55-testbloat.service.d/override.conf
 
     systemctl daemon-reload
     systemctl start testsuite-55-testchill.service