From: Yu Watanabe Date: Wed, 16 Oct 2024 05:52:49 +0000 (+0900) Subject: TEST-55-OOMD: check global config earlier X-Git-Tag: v257-rc1~207^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23fb9b63cd12f2040419dbc846d7a87e5193935c;p=thirdparty%2Fsystemd.git TEST-55-OOMD: check global config earlier 'Default Memory Pressure Duration' field in oomctl, which can be configured with DefaultMemoryPressureDurationSec= in oomd.conf, is a global config. Let's check it earlier. This also drops unnecessary cleanup at the beginning. --- diff --git a/test/units/TEST-55-OOMD.sh b/test/units/TEST-55-OOMD.sh index 4a7c7f78aec..2b003c9f73d 100755 --- a/test/units/TEST-55-OOMD.sh +++ b/test/units/TEST-55-OOMD.sh @@ -19,8 +19,6 @@ if [[ -s /skipped ]]; then exit 77 fi -rm -rf /run/systemd/system/TEST-55-OOMD-testbloat.service.d - # Activate swap file if we are in a VM if systemd-detect-virt --vm --quiet; then swapoff --all @@ -73,6 +71,9 @@ if systemctl is-active systemd-oomd.service; then systemctl restart systemd-oomd.service fi +# Check if the oomd.conf drop-in config is loaded. +assert_in 'Default Memory Pressure Duration: 2s' "$(oomctl)" + if [[ -v ASAN_OPTIONS || -v UBSAN_OPTIONS ]]; then # If we're running with sanitizers, sd-executor might pull in quite a significant chunk of shared # libraries, which in turn causes a lot of pressure that can put us in the front when sd-oomd decides to @@ -99,7 +100,6 @@ systemctl start TEST-55-OOMD-testbloat.service timeout 1m bash -xec 'until oomctl | grep "/TEST-55-OOMD-workload.slice"; do sleep 1; done' oomctl | grep "/TEST-55-OOMD-workload.slice" oomctl | grep "20.00%" -oomctl | grep "Default Memory Pressure Duration: 2s" systemctl status TEST-55-OOMD-testchill.service @@ -128,7 +128,6 @@ systemctl start --machine "testuser@.host" --user TEST-55-OOMD-testbloat.service timeout 1m bash -xec 'until oomctl | grep "/TEST-55-OOMD-workload.slice"; do sleep 1; done' oomctl | grep -E "/user.slice.*/TEST-55-OOMD-workload.slice" oomctl | grep "20.00%" -oomctl | grep "Default Memory Pressure Duration: 2s" systemctl --machine "testuser@.host" --user status TEST-55-OOMD-testchill.service