Skip to content

Commit

Permalink
selftests: rtnetlink: remove testns on test fail
Browse files Browse the repository at this point in the history
This patch removes testns after test failure so that next test can
continue with clean ns

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Prashant Bhole authored and David S. Miller committed Mar 4, 2018
1 parent faa083b commit 053533f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/testing/selftests/net/rtnetlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ kci_test_gretap()
ip link help gretap 2>&1 | grep -q "^Usage:"
if [ $? -ne 0 ];then
echo "SKIP: gretap: iproute2 too old"
ip netns del "$testns"
return 1
fi

Expand All @@ -543,6 +544,7 @@ kci_test_gretap()

if [ $ret -ne 0 ]; then
echo "FAIL: gretap"
ip netns del "$testns"
return 1
fi
echo "PASS: gretap"
Expand All @@ -565,6 +567,7 @@ kci_test_ip6gretap()
ip link help ip6gretap 2>&1 | grep -q "^Usage:"
if [ $? -ne 0 ];then
echo "SKIP: ip6gretap: iproute2 too old"
ip netns del "$testns"
return 1
fi

Expand All @@ -591,6 +594,7 @@ kci_test_ip6gretap()

if [ $ret -ne 0 ]; then
echo "FAIL: ip6gretap"
ip netns del "$testns"
return 1
fi
echo "PASS: ip6gretap"
Expand Down Expand Up @@ -655,6 +659,7 @@ kci_test_erspan()

if [ $ret -ne 0 ]; then
echo "FAIL: erspan"
ip netns del "$testns"
return 1
fi
echo "PASS: erspan"
Expand Down Expand Up @@ -720,6 +725,7 @@ kci_test_ip6erspan()

if [ $ret -ne 0 ]; then
echo "FAIL: ip6erspan"
ip netns del "$testns"
return 1
fi
echo "PASS: ip6erspan"
Expand Down

0 comments on commit 053533f

Please sign in to comment.