Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: ktap_helpers: Make it POSIX-compliant

There are a couple uses of bash specific syntax in the script. Change
them to the equivalent POSIX syntax. This doesn't change functionality
and allows non-bash test scripts to make use of these helpers.

Reported-by: Mike Looijmans <mike.looijmans@topic.nl>
Closes: https://lore.kernel.org/all/efae4037-c22a-40be-8ba9-7c1c12ece042@topic.nl/
Fixes: 2dd0b5a8fcc4 ("selftests: ktap_helpers: Add a helper to finish the test")
Fixes: 14571ab1ad21 ("kselftest: Add new test for detecting unprobed Devicetree devices")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Nícolas F. R. A. Prado and committed by
Shuah Khan
45d5a2b1 c7e84706

+2 -2
+2 -2
tools/testing/selftests/kselftest/ktap_helpers.sh
··· 43 43 directive="$3" # optional 44 44 45 45 local directive_str= 46 - [[ ! -z "$directive" ]] && directive_str="# $directive" 46 + [ ! -z "$directive" ] && directive_str="# $directive" 47 47 48 48 echo $result $KTAP_TESTNO $description $directive_str 49 49 ··· 99 99 ktap_finished() { 100 100 ktap_print_totals 101 101 102 - if [ $(("$KTAP_CNT_PASS" + "$KTAP_CNT_SKIP")) -eq "$KSFT_NUM_TESTS" ]; then 102 + if [ $((KTAP_CNT_PASS + KTAP_CNT_SKIP)) -eq "$KSFT_NUM_TESTS" ]; then 103 103 exit "$KSFT_PASS" 104 104 else 105 105 exit "$KSFT_FAIL"