diff mbox series

[1/2,linux-aws/disco] UBUNTU: SAUCE: selftests: net: don't fail test_bpf when module is not present

Message ID 20190405205113.22762-2-seth.forshee@canonical.com
State New
Headers show
Series fix selftests which fail due to missing modules | expand

Commit Message

Seth Forshee April 5, 2019, 8:51 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1823407
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 tools/testing/selftests/net/test_bpf.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/test_bpf.sh b/tools/testing/selftests/net/test_bpf.sh
index 65677909c574..fa1ec4aa0ada 100755
--- a/tools/testing/selftests/net/test_bpf.sh
+++ b/tools/testing/selftests/net/test_bpf.sh
@@ -2,7 +2,10 @@ 
 # SPDX-License-Identifier: GPL-2.0
 # Runs bpf test using test_bpf kernel module
 
-if /sbin/modprobe -q test_bpf ; then
+# Test whether test_bpf module exists
+if ! /sbin/modprobe -q -n test_bpf; then
+	echo "SKIP: test_bpf module not found"
+elif /sbin/modprobe -q test_bpf ; then
 	/sbin/modprobe -q -r test_bpf;
 	echo "test_bpf: ok";
 else