[PATCH] selftests/powerpc: make the test check in eeh-basic.sh posix compliant

Frederic Barrat fbarrat at linux.ibm.com
Mon Jan 4 20:46:25 AEDT 2021



On 28/12/2020 05:34, Po-Hsu Lin wrote:
> The == operand is a bash extension, thus this will fail on Ubuntu with
> 

Error message is somehow missing. It should read:
"./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 at canonical.com>
> ---


With the above,
Reviewed-by: Frederic Barrat <fbarrat at linux.ibm.com>

Thanks!

>   tools/testing/selftests/powerpc/eeh/eeh-basic.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/powerpc/eeh/eeh-basic.sh b/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
> index 0d783e1..64779f0 100755
> --- a/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
> +++ b/tools/testing/selftests/powerpc/eeh/eeh-basic.sh
> @@ -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 $?
> 


More information about the Linuxppc-dev mailing list