]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: avoid starting/stopping unwanted units during fuzzing
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 28 Dec 2023 22:42:47 +0000 (23:42 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 29 Dec 2023 20:26:49 +0000 (21:26 +0100)
Skip calling start and stop methods on unit objects, as doing that is
not only time consuming, but it also starts/stops units that interfere
with the machine state. The actual code paths should be covered (to some
degree) by the respective method counterparts on the manager object.

test/units/testsuite-21.sh

index ed0f88e2b23d1ba83d062e8e6a9d3502ccc4401d..7b2013fb51c484a783ae968cf05dd88f0d0abf47 100755 (executable)
@@ -39,6 +39,13 @@ add_suppression "org.freedesktop.systemd1" "org.freedesktop.systemd1.Manager:Ree
 add_suppression "org.freedesktop.systemd1" "org.freedesktop.systemd1.Manager:SoftReboot destructive"
 add_suppression "org.freedesktop.login1" "Sleep destructive"
 
+# Skip calling start and stop methods on unit objects, as doing that is not only time consuming, but it also
+# starts/stops units that interfere with the machine state. The actual code paths should be covered (to some
+# degree) by the respective method counterparts on the manager object.
+for method in Start Stop Restart ReloadOrRestart ReloadOrTryRestart Kill; do
+    add_suppression "org.freedesktop.systemd1" "org.freedesktop.systemd1.Unit:$method"
+done
+
 cat /etc/dfuzzer.conf
 
 # TODO