From c50606aa56609ab91a35f647635e77db3a625497 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Apr 2025 05:26:09 +0900 Subject: [PATCH] TEST-17-UDEV: add test cases for reverting/serializing/deserializing config --- test/units/TEST-17-UDEV.global-property.sh | 29 ++++++++++++++++++++++ test/units/TEST-17-UDEV.sanity-check.sh | 5 +++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/test/units/TEST-17-UDEV.global-property.sh b/test/units/TEST-17-UDEV.global-property.sh index 152922b364c..c9b070e2036 100755 --- a/test/units/TEST-17-UDEV.global-property.sh +++ b/test/units/TEST-17-UDEV.global-property.sh @@ -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 diff --git a/test/units/TEST-17-UDEV.sanity-check.sh b/test/units/TEST-17-UDEV.sanity-check.sh index 5bbf42a5cf1..125a5946f72 100755 --- a/test/units/TEST-17-UDEV.sanity-check.sh +++ b/test/units/TEST-17-UDEV.sanity-check.sh @@ -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 -- 2.47.3