diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-02-06 08:43:34 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-02-06 08:43:34 +0100 |
commit | 9ffb90964f16d730d495ff160e63a24b482ec898 (patch) | |
tree | 964a7cfa510a2f73f220a26ca801233375f02b24 /src | |
parent | sd-device: fix device_copy_properties() (diff) | |
download | systemd-9ffb90964f16d730d495ff160e63a24b482ec898.tar.xz systemd-9ffb90964f16d730d495ff160e63a24b482ec898.zip |
test: add a test case for issue #11652
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd/sd-device/test-sd-device-monitor.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsystemd/sd-device/test-sd-device-monitor.c b/src/libsystemd/sd-device/test-sd-device-monitor.c index 287100d5d3..aa1edaaf3c 100644 --- a/src/libsystemd/sd-device/test-sd-device-monitor.c +++ b/src/libsystemd/sd-device/test-sd-device-monitor.c @@ -157,6 +157,15 @@ static void test_sd_device_monitor_filter_remove(sd_device *device) { assert_se(sd_event_loop(sd_device_monitor_get_event(monitor_client)) == 100); } +static void test_device_copy_properties(sd_device *device) { + _cleanup_(sd_device_unrefp) sd_device *copy = NULL; + + assert_se(device_shallow_clone(device, ©) >= 0); + assert_se(device_copy_properties(copy, device) >= 0); + + test_send_receive_one(copy, false, false, false); +} + int main(int argc, char *argv[]) { _cleanup_(sd_device_unrefp) sd_device *loopback = NULL, *sda = NULL; int r; @@ -186,6 +195,7 @@ int main(int argc, char *argv[]) { test_subsystem_filter(loopback); test_sd_device_monitor_filter_remove(loopback); + test_device_copy_properties(loopback); r = sd_device_new_from_subsystem_sysname(&sda, "block", "sda"); if (r < 0) { |