]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add a test case for issue #11652 11655/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Feb 2019 07:43:34 +0000 (08:43 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Feb 2019 07:43:34 +0000 (08:43 +0100)
src/libsystemd/sd-device/test-sd-device-monitor.c

index 287100d5d3d6140e508333959a8c0086897924fe..aa1edaaf3c1eaa4a96b71cde89fd76e2eb2fa931 100644 (file)
@@ -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, &copy) >= 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) {