selftests/powerpc: Make the test check in eeh-basic.sh posix compliant
authorPo-Hsu Lin <po-hsu.lin@canonical.com>
Mon, 28 Dec 2020 04:34:59 +0000 (12:34 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 4 Jan 2021 13:00:29 +0000 (00:00 +1100)
The == operand is a bash extension, thus this will fail on Ubuntu
with:
  ./eeh-basic.sh: 89: test: 2: unexpected operator

As the /bin/sh on Ubuntu is pointed to DASH.

Use -eq to fix this posix compatibility issue.

Fixes: 996f9e0f93f162 ("selftests/powerpc: Fix eeh-basic.sh exit codes")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201228043459.14281-1-po-hsu.lin@canonical.com
tools/testing/selftests/powerpc/eeh/eeh-basic.sh

index 0d783e1..64779f0 100755 (executable)
@@ -86,5 +86,5 @@ echo "$failed devices failed to recover ($dev_count tested)"
 lspci | diff -u $pre_lspci -
 rm -f $pre_lspci
 
-test "$failed" == 0
+test "$failed" -eq 0
 exit $?