All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test
@ 2022-12-30  9:18 Po-Hsu Lin
  2022-12-30  9:18 ` [PATCH 1/2] selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier Po-Hsu Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Po-Hsu Lin @ 2022-12-30  9:18 UTC (permalink / raw)
  To: linux-kernel, linux-kselftest, netdev
  Cc: po-hsu.lin, dsahern, prestwoj, shuah, pabeni, kuba, edumazet, davem

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.

Po-Hsu Lin (2):
  selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier
  selftests: net: return non-zero for failures reported in
    arp_ndisc_evict_nocarrier

 tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier
  2022-12-30  9:18 [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test Po-Hsu Lin
@ 2022-12-30  9:18 ` Po-Hsu Lin
  2022-12-30  9:18 ` [PATCH 2/2] selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier Po-Hsu Lin
  2023-01-01 12:10 ` [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Po-Hsu Lin @ 2022-12-30  9:18 UTC (permalink / raw)
  To: linux-kernel, linux-kselftest, netdev
  Cc: po-hsu.lin, dsahern, prestwoj, shuah, pabeni, kuba, edumazet, davem

The cleanup_v6() will cause the arp_ndisc_evict_nocarrier script exit
with 255 (No such file or directory), even the tests are good:

 # selftests: net: arp_ndisc_evict_nocarrier.sh
 # run arp_evict_nocarrier=1 test
 # RTNETLINK answers: File exists
 # ok
 # run arp_evict_nocarrier=0 test
 # RTNETLINK answers: File exists
 # ok
 # run all.arp_evict_nocarrier=0 test
 # RTNETLINK answers: File exists
 # ok
 # run ndisc_evict_nocarrier=1 test
 # ok
 # run ndisc_evict_nocarrier=0 test
 # ok
 # run all.ndisc_evict_nocarrier=0 test
 # ok
 not ok 1 selftests: net: arp_ndisc_evict_nocarrier.sh # exit=255

This is because it's trying to modify the parameter for ipv4 instead.

Also, tests for ipv6 (run_ndisc_evict_nocarrier_enabled() and
run_ndisc_evict_nocarrier_disabled() are working on veth1, reflect
this fact in cleanup_v6().

Fixes: f86ca07eb531 ("selftests: net: add arp_ndisc_evict_nocarrier")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh b/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh
index b5af08a..b4ec1ee 100755
--- a/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh
+++ b/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh
@@ -24,8 +24,8 @@ cleanup_v6()
     ip netns del me
     ip netns del peer
 
-    sysctl -w net.ipv4.conf.veth0.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.veth1.ndisc_evict_nocarrier=1 >/dev/null 2>&1
+    sysctl -w net.ipv6.conf.all.ndisc_evict_nocarrier=1 >/dev/null 2>&1
 }
 
 create_ns()
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier
  2022-12-30  9:18 [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test Po-Hsu Lin
  2022-12-30  9:18 ` [PATCH 1/2] selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier Po-Hsu Lin
@ 2022-12-30  9:18 ` Po-Hsu Lin
  2023-01-01 12:10 ` [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Po-Hsu Lin @ 2022-12-30  9:18 UTC (permalink / raw)
  To: linux-kernel, linux-kselftest, netdev
  Cc: po-hsu.lin, dsahern, prestwoj, shuah, pabeni, kuba, edumazet, davem

Return non-zero return value if there is any failure reported in this
script during the test. Otherwise it can only reflect the status of
the last command.

Fixes: f86ca07eb531 ("selftests: net: add arp_ndisc_evict_nocarrier")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh b/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh
index b4ec1ee..4a110bb 100755
--- a/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh
+++ b/tools/testing/selftests/net/arp_ndisc_evict_nocarrier.sh
@@ -18,6 +18,7 @@ readonly V4_ADDR1=10.0.10.2
 readonly V6_ADDR0=2001:db8:91::1
 readonly V6_ADDR1=2001:db8:91::2
 nsid=100
+ret=0
 
 cleanup_v6()
 {
@@ -61,7 +62,7 @@ setup_v6() {
     if [ $? -ne 0 ]; then
         cleanup_v6
         echo "failed"
-        exit
+        exit 1
     fi
 
     # Set veth2 down, which will put veth1 in NOCARRIER state
@@ -88,7 +89,7 @@ setup_v4() {
     if [ $? -ne 0 ]; then
         cleanup_v4
         echo "failed"
-        exit
+        exit 1
     fi
 
     # Set veth1 down, which will put veth0 in NOCARRIER state
@@ -115,6 +116,7 @@ run_arp_evict_nocarrier_enabled() {
 
     if [ $? -eq 0 ];then
         echo "failed"
+        ret=1
     else
         echo "ok"
     fi
@@ -134,6 +136,7 @@ run_arp_evict_nocarrier_disabled() {
         echo "ok"
     else
         echo "failed"
+        ret=1
     fi
 
     cleanup_v4
@@ -164,6 +167,7 @@ run_ndisc_evict_nocarrier_enabled() {
 
     if [ $? -eq 0 ];then
         echo "failed"
+        ret=1
     else
         echo "ok"
     fi
@@ -182,6 +186,7 @@ run_ndisc_evict_nocarrier_disabled() {
         echo "ok"
     else
         echo "failed"
+        ret=1
     fi
 
     cleanup_v6
@@ -198,6 +203,7 @@ run_ndisc_evict_nocarrier_disabled_all() {
         echo "ok"
     else
         echo "failed"
+        ret=1
     fi
 
     cleanup_v6
@@ -218,3 +224,4 @@ if [ "$(id -u)" -ne 0 ];then
 fi
 
 run_all_tests
+exit $ret
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test
  2022-12-30  9:18 [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test Po-Hsu Lin
  2022-12-30  9:18 ` [PATCH 1/2] selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier Po-Hsu Lin
  2022-12-30  9:18 ` [PATCH 2/2] selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier Po-Hsu Lin
@ 2023-01-01 12:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-01 12:10 UTC (permalink / raw)
  To: Po-Hsu Lin
  Cc: linux-kernel, linux-kselftest, netdev, dsahern, prestwoj, shuah,
	pabeni, kuba, edumazet, davem

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 30 Dec 2022 17:18:27 +0800 you wrote:
> 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.
> 
> Po-Hsu Lin (2):
>   selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier
>   selftests: net: return non-zero for failures reported in
>     arp_ndisc_evict_nocarrier
> 
> [...]

Here is the summary with links:
  - [1/2] selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier
    https://git.kernel.org/netdev/net/c/9c4d7f45d607
  - [2/2] selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier
    https://git.kernel.org/netdev/net/c/1856628baa17

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-01 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-30  9:18 [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test Po-Hsu Lin
2022-12-30  9:18 ` [PATCH 1/2] selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier Po-Hsu Lin
2022-12-30  9:18 ` [PATCH 2/2] selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier Po-Hsu Lin
2023-01-01 12:10 ` [PATCH 0/2] selftests: net: fix for arp_ndisc_evict_nocarrier test patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.