]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-71-HOSTNAME: Ignore error from reset-failed
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 30 Apr 2024 12:47:48 +0000 (14:47 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 30 Apr 2024 20:10:05 +0000 (22:10 +0200)
On OpenSUSE the systemd-hostnamed does not fail and is unloaded which
causes reset-failed to fail. So let's ignore any errors from reset-failed
to make the test more robust.

test/units/testsuite-71.sh

index 813a676c928d28218f3c88f729acebd943af5195..dc3f587ea3906c487b061135d1a8cd02be4871cd 100755 (executable)
@@ -63,7 +63,8 @@ get_chassis() (
 
 stop_hostnamed() {
     systemctl stop systemd-hostnamed.service
-    systemctl reset-failed systemd-hostnamed # reset trigger limit
+    # Reset trigger limit. This might fail if the unit was unloaded already, so ignore any errors.
+    systemctl reset-failed systemd-hostnamed || :
 }
 
 testcase_chassis() {