From: Lennart Poettering Date: Mon, 8 Jan 2024 15:42:00 +0000 (+0100) Subject: testsuite-71: reset startlimit counter manually X-Git-Tag: v256-rc1~1226^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09c7bead29a6664341ddb8ec06467632cf28e896;p=thirdparty%2Fsystemd.git testsuite-71: reset startlimit counter manually The test cases will call quite a lot of "systemctl stop systemd-hostnamed", hence let's make sure we reset the start limit counter each time, to not make this eventually fail. (At other places we disabled the start limit counter, but here I opted for resetting it manually via 'systemctl reset-failed', to test another facet of the mechanism) --- diff --git a/test/units/testsuite-71.sh b/test/units/testsuite-71.sh index da765a9d97c..92c0beb32b6 100755 --- a/test/units/testsuite-71.sh +++ b/test/units/testsuite-71.sh @@ -61,6 +61,11 @@ get_chassis() ( echo "$CHASSIS" ) +stop_hostnamed() { + systemctl stop systemd-hostnamed.service + systemctl reset-failed systemd-hostnamed # reset trigger limit +} + testcase_chassis() { local i @@ -80,7 +85,7 @@ testcase_chassis() { assert_eq "$(get_chassis)" "$i" done - systemctl stop systemd-hostnamed.service + stop_hostnamed rm -f /etc/machine-info # fallback chassis type @@ -95,7 +100,7 @@ restore_sysfs_dmi() { umount /sys/class/dmi/id rm -rf /run/systemd/system/systemd-hostnamed.service.d systemctl daemon-reload - systemctl stop systemd-hostnamed + stop_hostnamed } testcase_firmware_date() { @@ -120,15 +125,15 @@ EOF echo '1' >/sys/class/dmi/id/uevent echo '09/08/2000' >/sys/class/dmi/id/bios_date - systemctl stop systemd-hostnamed + stop_hostnamed assert_in '2000-09-08' "$(hostnamectl)" echo '2022' >/sys/class/dmi/id/bios_date - systemctl stop systemd-hostnamed + stop_hostnamed assert_not_in 'Firmware Date' "$(hostnamectl)" echo 'garbage' >/sys/class/dmi/id/bios_date - systemctl stop systemd-hostnamed + stop_hostnamed assert_not_in 'Firmware Date' "$(hostnamectl)" }