1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

test: add fake action and seqnum

Otherwise, the receiver refuses the devices. See device_verify().
This commit is contained in:
Yu Watanabe 2022-08-12 03:12:03 +09:00
parent c8340822cf
commit 46c1223b24

View 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);
}