platform/test: disable bonding tests if no bonding module is available

Co-Authored-By: Thomas Haller <thaller@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Pavel Šimerda 2014-04-17 17:40:21 +02:00 committed by Thomas Haller
parent 79a99613c2
commit accd10b501

View file

@ -1,4 +1,5 @@
#include "test-common.h"
#include "nm-test-utils.h"
#define LO_INDEX 1
#define LO_NAME "lo"
@ -348,6 +349,13 @@ test_bridge (void)
static void
test_bond (void)
{
if (SETUP == nm_linux_platform_setup &&
!g_file_test ("/proc/1/net/bonding", G_FILE_TEST_IS_DIR) &&
system("modprobe --show bonding") != 0) {
g_test_skip ("Skipping test for bonding: bonding module not available");
return;
}
test_software (NM_LINK_TYPE_BOND, "bond");
}