aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/net/pmtu.sh
diff options
context:
space:
mode:
authorPo-Hsu Lin <po-hsu.lin@canonical.com>2020-11-10 10:00:49 +0800
committerJakub Kicinski <kuba@kernel.org>2020-11-12 07:56:30 -0800
commit2a9d3716b810a4f2c8291b7aa8f358d11693f6e5 (patch)
treeb3950632ab3a462907da3d90ee8f55b9f21cc34f /tools/testing/selftests/net/pmtu.sh
parentselftests: pmtu.sh: use $ksft_skip for skipped return code (diff)
downloadwireguard-linux-2a9d3716b810a4f2c8291b7aa8f358d11693f6e5.tar.xz
wireguard-linux-2a9d3716b810a4f2c8291b7aa8f358d11693f6e5.zip
selftests: pmtu.sh: improve the test result processing
This test will treat all non-zero return codes as failures, it will make the pmtu.sh test script being marked as FAILED when some sub-test got skipped. Improve the result processing by * Only mark the whole test script as SKIP when all of the sub-tests were skipped * If the sub-tests were either passed or skipped, the overall result will be PASS * If any of them has failed with return code 1 or anything bad happened (e.g. return code 127 for command not found), the overall result will be FAIL Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/pmtu.sh')
-rwxr-xr-xtools/testing/selftests/net/pmtu.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index fb53987ab64b..464e31eabc73 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -1652,7 +1652,19 @@ run_test() {
return $ret
)
ret=$?
- [ $ret -ne 0 ] && exitcode=1
+ case $ret in
+ 0)
+ all_skipped=false
+ [ $exitcode=$ksft_skip ] && exitcode=0
+ ;;
+ $ksft_skip)
+ [ $all_skipped = true ] && exitcode=$ksft_skip
+ ;;
+ *)
+ all_skipped=false
+ exitcode=1
+ ;;
+ esac
return $ret
}
@@ -1786,6 +1798,7 @@ usage() {
#
exitcode=0
desc=0
+all_skipped=true
while getopts :ptv o
do