]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-17-UDEV: add test cases for reverting/serializing/deserializing config 37067/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Apr 2025 20:26:09 +0000 (05:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Apr 2025 20:08:20 +0000 (05:08 +0900)
test/units/TEST-17-UDEV.global-property.sh
test/units/TEST-17-UDEV.sanity-check.sh

index 152922b364c17eba203fd217909ed26eb31a4e91..c9b070e2036ad77a54cce8cefd235197e48f7040 100755 (executable)
@@ -86,4 +86,33 @@ udevadm trigger --action change --settle /dev/null
 test_property /dev/null PROP_FOO foo
 test_not_property /dev/null PROP_BAR
 
+: revert
+
+udevadm control --revert
+udevadm trigger --action change --settle /dev/null
+test_not_property /dev/null PROP_FOO
+test_not_property /dev/null PROP_BAR
+
+: set again, and restart
+
+udevadm control -p FOO=foo -p BAR=bar
+udevadm trigger --action change --settle /dev/null
+test_property /dev/null PROP_FOO foo
+test_property /dev/null PROP_BAR bar
+systemctl restart systemd-udevd.service
+udevadm trigger --action change --settle /dev/null
+test_property /dev/null PROP_FOO foo
+test_property /dev/null PROP_BAR bar
+
+: revert again, and restart
+
+udevadm control --revert
+udevadm trigger --action change --settle /dev/null
+test_not_property /dev/null PROP_FOO
+test_not_property /dev/null PROP_BAR
+systemctl restart systemd-udevd.service
+udevadm trigger --action change --settle /dev/null
+test_not_property /dev/null PROP_FOO
+test_not_property /dev/null PROP_BAR
+
 exit 0
index 5bbf42a5cf16fe6e93b6ee74b5b35fab1706f8c3..125a5946f729e77f7a8d130602d8278dd0d26f06 100755 (executable)
@@ -61,10 +61,13 @@ udevadm control -R
 udevadm control -p HELLO=world
 udevadm control -m 42
 udevadm control --ping -t 5
-udevadm control --trace yes
 udevadm control --trace no
+udevadm control --trace yes
 udevadm control --load-credentials
 udevadm control -h
+# Sanity check for serialization and deserialization
+systemctl restart systemd-udevd.service
+udevadm control --revert
 
 udevadm info /dev/null
 udevadm info /sys/class/net/$netdev