]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: explicitly configure oomd stuff via dropins
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 6 Jan 2022 20:37:21 +0000 (21:37 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 9 Jan 2022 17:56:57 +0000 (17:56 +0000)
so we don't get overridden by distro-shipped ones.

Fixes: #22030
test/units/testsuite-55.sh

index 379ea9e56974c567cacbee5a2a731454154cbe9f..f0837d22a3eff09c6f44e5e593920b1c19d9ae1c 100755 (executable)
@@ -22,7 +22,13 @@ fi
 
 rm -rf /etc/systemd/system/testsuite-55-testbloat.service.d
 
-echo "DefaultMemoryPressureDurationSec=2s" >>/etc/systemd/oomd.conf
+# 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 /etc/systemd/system/systemd-oomd.service.d/
 echo -e "[Service]\nEnvironment=SYSTEMD_LOG_LEVEL=debug" >/etc/systemd/system/systemd-oomd.service.d/debug.conf