From accd10b501c55e1c62a6021b803375b05e0cd342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C5=A0imerda?= Date: Thu, 17 Apr 2014 17:40:21 +0200 Subject: [PATCH] platform/test: disable bonding tests if no bonding module is available Co-Authored-By: Thomas Haller Signed-off-by: Thomas Haller --- src/platform/tests/test-link.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c index 1767d3c874..c0a92062bf 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -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"); }