blackhole_dev: add a selftest
Since this is not really a device with all capabilities, this test ensures that it has *enough* to make it through the data path without causing unwanted side-effects (read crash!). Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
8d7017fd62
commit
509e56b37c
@@ -5,7 +5,7 @@ CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
|
||||
CFLAGS += -I../../../../usr/include/
|
||||
|
||||
TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \
|
||||
rtnetlink.sh xfrm_policy.sh
|
||||
rtnetlink.sh xfrm_policy.sh test_blackhole_dev.sh
|
||||
TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh ip_defrag.sh
|
||||
TEST_PROGS += udpgso_bench.sh fib_rule_tests.sh msg_zerocopy.sh psock_snd.sh
|
||||
TEST_PROGS += udpgro_bench.sh udpgro.sh test_vxlan_under_vrf.sh reuseport_addr_any.sh
|
||||
|
@@ -27,3 +27,4 @@ CONFIG_NFT_CHAIN_NAT_IPV6=m
|
||||
CONFIG_NFT_CHAIN_NAT_IPV4=m
|
||||
CONFIG_NET_SCH_FQ=m
|
||||
CONFIG_NET_SCH_ETF=m
|
||||
CONFIG_TEST_BLACKHOLE_DEV=m
|
||||
|
11
tools/testing/selftests/net/test_blackhole_dev.sh
Executable file
11
tools/testing/selftests/net/test_blackhole_dev.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Runs blackhole-dev test using blackhole-dev kernel module
|
||||
|
||||
if /sbin/modprobe -q test_blackhole_dev ; then
|
||||
/sbin/modprobe -q -r test_blackhole_dev;
|
||||
echo "test_blackhole_dev: ok";
|
||||
else
|
||||
echo "test_blackhole_dev: [FAIL]";
|
||||
exit 1;
|
||||
fi
|
Reference in New Issue
Block a user