diff mbox series

[X,B,SRU,1/1] selftests/net: correct the return value for run_afpackettests

Message ID 20191206120741.26478-2-po-hsu.lin@canonical.com
State New
Headers show
Series selftests/net: correct the return value for run_afpackettests | expand

Commit Message

Po-Hsu Lin Dec. 6, 2019, 12:07 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1825778

The run_afpackettests will be marked as passed regardless the return
value of those sub-tests in the script:
    --------------------
    running psock_tpacket test
    --------------------
    [FAIL]
    selftests: run_afpackettests [PASS]

Fix this by changing the return value for each tests.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(backported from commit 8c03557c3f25271e62e39154af66ebdd1b59c9ca)
[PHLin: backported with the same logic]
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/run_afpackettests | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thadeu Lima de Souza Cascardo Dec. 6, 2019, 12:25 p.m. UTC | #1
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Connor Kuehl Dec. 6, 2019, 9:10 p.m. UTC | #2
On 12/6/19 4:07 AM, Po-Hsu Lin wrote:
> BugLink: https://bugs.launchpad.net/bugs/1825778
> 
> The run_afpackettests will be marked as passed regardless the return
> value of those sub-tests in the script:
>      --------------------
>      running psock_tpacket test
>      --------------------
>      [FAIL]
>      selftests: run_afpackettests [PASS]
> 
> Fix this by changing the return value for each tests.
> 
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (backported from commit 8c03557c3f25271e62e39154af66ebdd1b59c9ca)
> [PHLin: backported with the same logic]
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>

Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/run_afpackettests b/tools/testing/selftests/net/run_afpackettests
index 5246e78..e33a555 100755
--- a/tools/testing/selftests/net/run_afpackettests
+++ b/tools/testing/selftests/net/run_afpackettests
@@ -5,12 +5,14 @@  if [ $(id -u) != 0 ]; then
 	exit 0
 fi
 
+ret=0
 echo "--------------------"
 echo "running psock_fanout test"
 echo "--------------------"
 ./psock_fanout
 if [ $? -ne 0 ]; then
 	echo "[FAIL]"
+	ret=1
 else
 	echo "[PASS]"
 fi
@@ -21,6 +23,8 @@  echo "--------------------"
 ./psock_tpacket
 if [ $? -ne 0 ]; then
 	echo "[FAIL]"
+	ret=1
 else
 	echo "[PASS]"
 fi
+exit $ret