summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-11-14 15:36:38 +0100
committerThomas Haller <thaller@redhat.com>2017-11-16 12:26:22 +0100
commitb20384fac772a753b493aa28ea39f211d5de6b63 (patch)
treea7426a760f4544441df07de064d84d16bb7cd180
parent7a98ee78be7179cab576c31bd323f2593234d9a9 (diff)
downloadNetworkManager-th/platform-test-netns-bgo790214.tar.gz
platform/tests: skip netns tests if we fail to create a new NMPNetns instanceth/platform-test-netns-bgo790214
nmp_netns_new () might fail with: netns: failed mount --make-rslave: Invalid argument Skip the test in that case. https://bugzilla.gnome.org/show_bug.cgi?id=790214
-rw-r--r--src/platform/tests/test-link.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c
index 9c72371c33..d3a10bd68f 100644
--- a/src/platform/tests/test-link.c
+++ b/src/platform/tests/test-link.c
@@ -1916,6 +1916,7 @@ _test_netns_check_skip (void)
static int support = -1;
static int support_errsv = 0;
NMPNetns *netns;
+ gs_unref_object NMPNetns *netns2 = NULL;
netns = nmp_netns_get_current ();
if (!netns) {
@@ -1931,10 +1932,20 @@ _test_netns_check_skip (void)
support_errsv = errno;
}
if (!support) {
- _LOGD ("setns() failed with \"%s\". This indicates missing support (valgrind?)", g_strerror (support_errsv));
- g_test_skip ("No netns support (setns failed)");
+ _LOGD ("setns() failed with \"%s\". This indicates missing support (valgrind?)", g_strerror (support_errsv));
+ g_test_skip ("No netns support (setns failed)");
return TRUE;
}
+
+ netns2 = nmp_netns_new ();
+ if (!netns2) {
+ /* skip tests for https://bugzilla.gnome.org/show_bug.cgi?id=790214 */
+ g_assert_cmpint (errno, ==, EINVAL);
+ g_test_skip ("No netns support to create another netns");
+ return TRUE;
+ }
+ nmp_netns_pop (netns2);
+
return FALSE;
}