mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 11:46:51 +07:00
selftests/bpf: fail test_tunnel.sh if subtests fail
Right now test_tunnel.sh always exits with success even if some of the subtests fail. Since the output is very verbose, it's hard to spot the issues with subtests. Let's fail the script if any subtest fails. Signed-off-by: Stanislav Fomichev <sdf@google.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
463910a5dd
commit
486d3f22c0
@ -696,30 +696,57 @@ check_err()
|
|||||||
|
|
||||||
bpf_tunnel_test()
|
bpf_tunnel_test()
|
||||||
{
|
{
|
||||||
|
local errors=0
|
||||||
|
|
||||||
echo "Testing GRE tunnel..."
|
echo "Testing GRE tunnel..."
|
||||||
test_gre
|
test_gre
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IP6GRE tunnel..."
|
echo "Testing IP6GRE tunnel..."
|
||||||
test_ip6gre
|
test_ip6gre
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IP6GRETAP tunnel..."
|
echo "Testing IP6GRETAP tunnel..."
|
||||||
test_ip6gretap
|
test_ip6gretap
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing ERSPAN tunnel..."
|
echo "Testing ERSPAN tunnel..."
|
||||||
test_erspan v2
|
test_erspan v2
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IP6ERSPAN tunnel..."
|
echo "Testing IP6ERSPAN tunnel..."
|
||||||
test_ip6erspan v2
|
test_ip6erspan v2
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing VXLAN tunnel..."
|
echo "Testing VXLAN tunnel..."
|
||||||
test_vxlan
|
test_vxlan
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IP6VXLAN tunnel..."
|
echo "Testing IP6VXLAN tunnel..."
|
||||||
test_ip6vxlan
|
test_ip6vxlan
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing GENEVE tunnel..."
|
echo "Testing GENEVE tunnel..."
|
||||||
test_geneve
|
test_geneve
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IP6GENEVE tunnel..."
|
echo "Testing IP6GENEVE tunnel..."
|
||||||
test_ip6geneve
|
test_ip6geneve
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IPIP tunnel..."
|
echo "Testing IPIP tunnel..."
|
||||||
test_ipip
|
test_ipip
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IPIP6 tunnel..."
|
echo "Testing IPIP6 tunnel..."
|
||||||
test_ipip6
|
test_ipip6
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
echo "Testing IPSec tunnel..."
|
echo "Testing IPSec tunnel..."
|
||||||
test_xfrm_tunnel
|
test_xfrm_tunnel
|
||||||
|
errors=$(( $errors + $? ))
|
||||||
|
|
||||||
|
return $errors
|
||||||
}
|
}
|
||||||
|
|
||||||
trap cleanup 0 3 6
|
trap cleanup 0 3 6
|
||||||
@ -728,4 +755,9 @@ trap cleanup_exit 2 9
|
|||||||
cleanup
|
cleanup
|
||||||
bpf_tunnel_test
|
bpf_tunnel_test
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "$(basename $0): ${RED}FAIL${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo -e "$(basename $0): ${GREEN}PASS${NC}"
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user