summary refs log tree commit diff
path: root/src/core/platform/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/platform/tests')
-rw-r--r--src/core/platform/tests/test-common.c15
-rw-r--r--src/core/platform/tests/test-route.c2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/core/platform/tests/test-common.c b/src/core/platform/tests/test-common.c
index 87e5329a..4a117d59 100644
--- a/src/core/platform/tests/test-common.c
+++ b/src/core/platform/tests/test-common.c
@@ -2563,7 +2563,20 @@ main(int argc, char **argv)
 
         if (unshare(CLONE_NEWNET | CLONE_NEWNS) != 0) {
             errsv = errno;
-            g_error("unshare(CLONE_NEWNET|CLONE_NEWNS) failed with %s (%d)",
+            if (errsv == EPERM) {
+#ifdef REQUIRE_ROOT_TESTS
+                g_print("Fail test: unshare(CLONE_NEWNET|CLONE_NEWNS) failed with %s (%d)\n",
+                        nm_strerror_native(errsv),
+                        errsv);
+                return EXIT_FAILURE;
+#else
+                g_print("Skipping test: unshare(CLONE_NEWNET|CLONE_NEWNS) failed with %s (%d)\n",
+                        nm_strerror_native(errsv),
+                        errsv);
+                return g_test_run();
+#endif
+            }
+            g_error("Fail test: unshare(CLONE_NEWNET|CLONE_NEWNS) failed with %s (%d)",
                     nm_strerror_native(errsv),
                     errsv);
         }
diff --git a/src/core/platform/tests/test-route.c b/src/core/platform/tests/test-route.c
index 47587865..645bb5b1 100644
--- a/src/core/platform/tests/test-route.c
+++ b/src/core/platform/tests/test-route.c
@@ -446,7 +446,7 @@ test_ip6_route(void)
                          metric,
                          mss);
     g_assert(nmtstp_ip6_route_get(NM_PLATFORM_GET, ifindex, &network, plen, metric, NULL, 0));
-    accept_signal(route_added);
+    accept_signals(route_added, 1, 2);
 
     /* Add route again */
     nmtstp_ip6_route_add(NM_PLATFORM_GET,