Commit 1c429c10 authored by David S. Miller's avatar David S. Miller

Merge branch 'selftests-fix'

Po-Hsu Lin says:

====================
selftests: net: fix for arp_ndisc_evict_nocarrier test

This patchset will fix a false-positive issue caused by the command in
cleanup_v6() of the arp_ndisc_evict_nocarrier test.

Also, it will make the test to return a non-zero value for any failure
reported in the test for us to avoid false-negative results.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6d4cfcf9 1856628b
...@@ -18,14 +18,15 @@ readonly V4_ADDR1=10.0.10.2 ...@@ -18,14 +18,15 @@ readonly V4_ADDR1=10.0.10.2
readonly V6_ADDR0=2001:db8:91::1 readonly V6_ADDR0=2001:db8:91::1
readonly V6_ADDR1=2001:db8:91::2 readonly V6_ADDR1=2001:db8:91::2
nsid=100 nsid=100
ret=0
cleanup_v6() cleanup_v6()
{ {
ip netns del me ip netns del me
ip netns del peer ip netns del peer
sysctl -w net.ipv4.conf.veth0.ndisc_evict_nocarrier=1 >/dev/null 2>&1 sysctl -w net.ipv6.conf.veth1.ndisc_evict_nocarrier=1 >/dev/null 2>&1
sysctl -w net.ipv4.conf.all.ndisc_evict_nocarrier=1 >/dev/null 2>&1 sysctl -w net.ipv6.conf.all.ndisc_evict_nocarrier=1 >/dev/null 2>&1
} }
create_ns() create_ns()
...@@ -61,7 +62,7 @@ setup_v6() { ...@@ -61,7 +62,7 @@ setup_v6() {
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
cleanup_v6 cleanup_v6
echo "failed" echo "failed"
exit exit 1
fi fi
# Set veth2 down, which will put veth1 in NOCARRIER state # Set veth2 down, which will put veth1 in NOCARRIER state
...@@ -88,7 +89,7 @@ setup_v4() { ...@@ -88,7 +89,7 @@ setup_v4() {
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
cleanup_v4 cleanup_v4
echo "failed" echo "failed"
exit exit 1
fi fi
# Set veth1 down, which will put veth0 in NOCARRIER state # Set veth1 down, which will put veth0 in NOCARRIER state
...@@ -115,6 +116,7 @@ run_arp_evict_nocarrier_enabled() { ...@@ -115,6 +116,7 @@ run_arp_evict_nocarrier_enabled() {
if [ $? -eq 0 ];then if [ $? -eq 0 ];then
echo "failed" echo "failed"
ret=1
else else
echo "ok" echo "ok"
fi fi
...@@ -134,6 +136,7 @@ run_arp_evict_nocarrier_disabled() { ...@@ -134,6 +136,7 @@ run_arp_evict_nocarrier_disabled() {
echo "ok" echo "ok"
else else
echo "failed" echo "failed"
ret=1
fi fi
cleanup_v4 cleanup_v4
...@@ -164,6 +167,7 @@ run_ndisc_evict_nocarrier_enabled() { ...@@ -164,6 +167,7 @@ run_ndisc_evict_nocarrier_enabled() {
if [ $? -eq 0 ];then if [ $? -eq 0 ];then
echo "failed" echo "failed"
ret=1
else else
echo "ok" echo "ok"
fi fi
...@@ -182,6 +186,7 @@ run_ndisc_evict_nocarrier_disabled() { ...@@ -182,6 +186,7 @@ run_ndisc_evict_nocarrier_disabled() {
echo "ok" echo "ok"
else else
echo "failed" echo "failed"
ret=1
fi fi
cleanup_v6 cleanup_v6
...@@ -198,6 +203,7 @@ run_ndisc_evict_nocarrier_disabled_all() { ...@@ -198,6 +203,7 @@ run_ndisc_evict_nocarrier_disabled_all() {
echo "ok" echo "ok"
else else
echo "failed" echo "failed"
ret=1
fi fi
cleanup_v6 cleanup_v6
...@@ -218,3 +224,4 @@ if [ "$(id -u)" -ne 0 ];then ...@@ -218,3 +224,4 @@ if [ "$(id -u)" -ne 0 ];then
fi fi
run_all_tests run_all_tests
exit $ret
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment