]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add fake action and seqnum
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 11 Aug 2022 18:12:03 +0000 (03:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 11 Aug 2022 18:13:22 +0000 (03:13 +0900)
Otherwise, the receiver refuses the devices. See device_verify().

src/libsystemd/sd-device/test-sd-device-monitor.c

index 67f9bf4ae11283b795e04b2138522751c741d729..82c2b55e3693cba829286a3ce2f2b48b4ad2e304 100644 (file)
@@ -115,6 +115,9 @@ static void test_subsystem_filter(sd_device *device) {
                 assert_se(sd_device_get_syspath(d, &p) >= 0);
                 assert_se(sd_device_get_subsystem(d, &s) >= 0);
 
+                assert_se(device_add_property(d, "ACTION", "add") >= 0);
+                assert_se(device_add_property(d, "SEQNUM", "10") >= 0);
+
                 log_device_debug(d, "Sending device subsystem:%s syspath:%s", s, p);
                 assert_se(device_monitor_send_device(monitor_server, monitor_client, d) >= 0);
         }
@@ -150,6 +153,9 @@ static void test_tag_filter(sd_device *device) {
 
                 assert_se(sd_device_get_syspath(d, &p) >= 0);
 
+                assert_se(device_add_property(d, "ACTION", "add") >= 0);
+                assert_se(device_add_property(d, "SEQNUM", "10") >= 0);
+
                 log_device_debug(d, "Sending device syspath:%s", p);
                 assert_se(device_monitor_send_device(monitor_server, monitor_client, d) >= 0);
         }
@@ -192,6 +198,9 @@ static void test_sysattr_filter(sd_device *device, const char *sysattr) {
 
                 assert_se(sd_device_get_syspath(d, &p) >= 0);
 
+                assert_se(device_add_property(d, "ACTION", "add") >= 0);
+                assert_se(device_add_property(d, "SEQNUM", "10") >= 0);
+
                 log_device_debug(d, "Sending device syspath:%s", p);
                 assert_se(device_monitor_send_device(monitor_server, monitor_client, d) >= 0);
         }
@@ -236,6 +245,9 @@ static void test_parent_filter(sd_device *device) {
 
                 assert_se(sd_device_get_syspath(d, &p) >= 0);
 
+                assert_se(device_add_property(d, "ACTION", "add") >= 0);
+                assert_se(device_add_property(d, "SEQNUM", "10") >= 0);
+
                 log_device_debug(d, "Sending device syspath:%s", p);
                 assert_se(device_monitor_send_device(monitor_server, monitor_client, d) >= 0);
         }