summary refs log tree commit diff
path: root/src/platform
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-10-24 21:01:12 +0200
committerMichael Biebl <biebl@debian.org>2018-10-24 21:01:12 +0200
commit3626b425d1bc017fdc6f1ea0cfd329d1e1681641 (patch)
treee3eb1ffa953bc2ca100c9c50ab2aaa8cbfffa8f0 /src/platform
parent6518e361171f64bcaaa4bf868139362ed95cc2e0 (diff)
New upstream version 1.14.4 upstream/1.14.4
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/tests/meson.build26
-rw-r--r--src/platform/tests/test-nmp-object.c8
2 files changed, 17 insertions, 17 deletions
diff --git a/src/platform/tests/meson.build b/src/platform/tests/meson.build
index 0571efac..bedc6916 100644
--- a/src/platform/tests/meson.build
+++ b/src/platform/tests/meson.build
@@ -1,28 +1,27 @@
 test_units = [
-  ['test-link-fake', 'test-link.c', 60],
-  ['test-link-linux', 'test-link.c', 60],
-  ['test-address-fake', 'test-address.c'],
-  ['test-address-linux', 'test-address.c'],
-  ['test-general', 'test-general.c'],
-  ['test-nmp-object', 'test-nmp-object.c'],
-  ['test-route-fake', 'test-route.c'],
-  ['test-route-linux', 'test-route.c'],
-  ['test-cleanup-fake', 'test-cleanup.c'],
-  ['test-cleanup-linux', 'test-cleanup.c'],
+  ['test-link-fake',     'test-link.c',       test_nm_dep_fake,  30],
+  ['test-link-linux',    'test-link.c',       test_nm_dep_linux, 180],
+  ['test-address-fake',  'test-address.c',    test_nm_dep_fake,  30],
+  ['test-address-linux', 'test-address.c',    test_nm_dep_linux, 30],
+  ['test-general',       'test-general.c',    test_nm_dep,       30],
+  ['test-nmp-object',    'test-nmp-object.c', test_nm_dep,       30],
+  ['test-route-fake',    'test-route.c',      test_nm_dep_fake,  30],
+  ['test-route-linux',   'test-route.c',      test_nm_dep_linux, 30],
+  ['test-cleanup-fake',  'test-cleanup.c',    test_nm_dep_fake,  30],
+  ['test-cleanup-linux', 'test-cleanup.c',    test_nm_dep_linux, 30],
 ]
 
 foreach test_unit: test_units
   exe = executable(
     'platform-' + test_unit[0],
     test_unit[1],
-    dependencies: test_nm_dep,
-    c_args: test_cflags_platform
+    dependencies: test_unit[2],
   )
 
   test(
     'platform/' + test_unit[0],
     test_script,
-    timeout: test_unit.length() > 2 ? test_unit[2] : 30,
+    timeout: test_unit[3],
     args: test_args + [exe.full_path()]
   )
 endforeach
@@ -33,5 +32,4 @@ executable(
   test,
   test + '.c',
   dependencies: test_nm_dep,
-  c_args: test_cflags_platform
 )
diff --git a/src/platform/tests/test-nmp-object.c b/src/platform/tests/test-nmp-object.c
index 047d7a85..12acf4a5 100644
--- a/src/platform/tests/test-nmp-object.c
+++ b/src/platform/tests/test-nmp-object.c
@@ -267,10 +267,11 @@ test_cache_link (void)
 	struct udev_device *udev_device_3 = g_list_nth_data (global.udev_devices, 0);
 	NMPCacheOpsType ops_type;
 	nm_auto_unref_dedup_multi_index NMDedupMultiIndex *multi_idx = NULL;
+	gboolean use_udev = nmtst_get_rand_int () % 2;
 
 	multi_idx = nm_dedup_multi_index_new ();
 
-	cache = nmp_cache_new (multi_idx, nmtst_get_rand_int () % 2);
+	cache = nmp_cache_new (multi_idx, use_udev);
 
 	/* if we have a link, and don't set is_in_netlink, adding it has no effect. */
 	objm1 = nmp_object_new (NMP_OBJECT_TYPE_LINK, (NMPlatformObject *) &pl_link_2);
@@ -387,7 +388,8 @@ test_cache_link (void)
 	} else {
 		g_assert (nmp_cache_lookup_obj (cache, objm1) == NULL);
 		g_assert (nmp_cache_lookup_obj (cache, nmp_object_stackinit_id_link (&objs1, pl_link_2.ifindex)) == NULL);
-		g_assert (nmp_object_is_visible (obj_new));
+		g_assert (!nmp_object_is_alive (obj_new));
+		g_assert (!nmp_object_is_visible (obj_new));
 	}
 	nmp_object_unref (objm1);
 	nmp_object_unref (obj_old);
@@ -587,7 +589,7 @@ main (int argc, char **argv)
 
 	while (global.udev_devices) {
 		udev_device_unref (global.udev_devices->data);
-		global.udev_devices = g_list_remove (global.udev_devices, global.udev_devices->data);
+		global.udev_devices = g_list_delete_link (global.udev_devices, global.udev_devices);
 	}
 
 	nm_udev_client_unref (udev_client);