mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 03:48:09 +02:00
platform/tests: disable tests touching sysctl when they're not writable
This is basically the case in the COPR build system where this (mount -o bind,ro /proc/sys /proc/sys) is the case for reasons unknown.
This commit is contained in:
parent
a25d2e0a17
commit
984e9d5655
1 changed files with 17 additions and 0 deletions
|
|
@ -1978,6 +1978,17 @@ _test_netns_check_skip (void)
|
||||||
return FALSE;
|
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) \
|
#define _sysctl_assert_eq(plat, path, value) \
|
||||||
|
|
@ -2002,6 +2013,9 @@ test_netns_general (gpointer fixture, gconstpointer test_data)
|
||||||
if (_test_netns_check_skip ())
|
if (_test_netns_check_skip ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (_check_sysctl_skip ())
|
||||||
|
return;
|
||||||
|
|
||||||
platform_1 = nm_linux_platform_new (TRUE, TRUE);
|
platform_1 = nm_linux_platform_new (TRUE, TRUE);
|
||||||
platform_2 = _test_netns_create_platform ();
|
platform_2 = _test_netns_create_platform ();
|
||||||
|
|
||||||
|
|
@ -2197,6 +2211,9 @@ test_netns_push (gpointer fixture, gconstpointer test_data)
|
||||||
if (_test_netns_check_skip ())
|
if (_test_netns_check_skip ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (_check_sysctl_skip ())
|
||||||
|
return;
|
||||||
|
|
||||||
pl[0].platform = platform_0 = nm_linux_platform_new (TRUE, TRUE);
|
pl[0].platform = platform_0 = nm_linux_platform_new (TRUE, TRUE);
|
||||||
pl[1].platform = platform_1 = _test_netns_create_platform ();
|
pl[1].platform = platform_1 = _test_netns_create_platform ();
|
||||||
pl[2].platform = platform_2 = _test_netns_create_platform ();
|
pl[2].platform = platform_2 = _test_netns_create_platform ();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue