about summary refs log tree commit diff
path: root/src/platform/tests/test-link.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-03-13 01:30:38 +0100
committerMichael Biebl <biebl@debian.org>2018-03-13 01:30:38 +0100
commitbd71023d735a1dd11b1da3779850df573f134ad1 (patch)
treee53ddb1bdc1f700b61377ec8a264cfce40515488 /src/platform/tests/test-link.c
parentd0408a3e3b1cc6effec321d098008ef0c4acf91b (diff)
parent7e9ff09fcb2366b383b7ebbec80d2f6fff117290 (diff)
Update upstream source from tag 'upstream/1.10.6'
Update to upstream version '1.10.6'
with Debian dir c37b318f40a9e6c07a543a8093e311df21e75045
Diffstat (limited to 'src/platform/tests/test-link.c')
-rw-r--r--src/platform/tests/test-link.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c
index d3a10bd6..ef78cc24 100644
--- a/src/platform/tests/test-link.c
+++ b/src/platform/tests/test-link.c
@@ -1949,6 +1949,17 @@ _test_netns_check_skip (void)
 	return FALSE;
 }
 
+static gboolean
+_check_sysctl_skip (void)
+{
+	if (access ("/proc/sys/net/ipv4/ip_forward", W_OK) == -1) {
+		g_test_skip ("Can not write sysctls");
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
 /*****************************************************************************/
 
 #define _sysctl_assert_eq(plat, path, value) \
@@ -1973,6 +1984,9 @@ test_netns_general (gpointer fixture, gconstpointer test_data)
 	if (_test_netns_check_skip ())
 		return;
 
+	if (_check_sysctl_skip ())
+		return;
+
 	platform_1 = nm_linux_platform_new (TRUE, TRUE);
 	platform_2 = _test_netns_create_platform ();
 
@@ -2168,6 +2182,9 @@ test_netns_push (gpointer fixture, gconstpointer test_data)
 	if (_test_netns_check_skip ())
 		return;
 
+	if (_check_sysctl_skip ())
+		return;
+
 	pl[0].platform = platform_0 = nm_linux_platform_new (TRUE, TRUE);
 	pl[1].platform = platform_1 = _test_netns_create_platform ();
 	pl[2].platform = platform_2 = _test_netns_create_platform ();