1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

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)
This commit is contained in:
Lennart Poettering 2024-01-08 16:42:00 +01:00
parent 5ee5b1659a
commit 09c7bead29

View File

@ -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)"
}