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

selftests: net: tcp_fastopen_backup_key.sh: fix shellcheck issue

When running tcp_fastopen_backup_key.sh the following issue was seen in
a busybox environment.
./tcp_fastopen_backup_key.sh: line 33: [: -ne: unary operator expected

Shellcheck showed the following issue.
$ shellcheck tools/testing/selftests/net/tcp_fastopen_backup_key.sh

In tools/testing/selftests/net/tcp_fastopen_backup_key.sh line 33:
if [ $val -ne 0 ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.

Rework to do a string comparison instead.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Anders Roxell and committed by
David S. Miller
2aafdf5a c554336e

+1 -1
+1 -1
tools/testing/selftests/net/tcp_fastopen_backup_key.sh
··· 30 30 ip netns exec "${NETNS}" ./tcp_fastopen_backup_key "$1" 31 31 val=$(ip netns exec "${NETNS}" nstat -az | \ 32 32 grep TcpExtTCPFastOpenPassiveFail | awk '{print $2}') 33 - if [ $val -ne 0 ]; then 33 + if [ "$val" != 0 ]; then 34 34 echo "FAIL: TcpExtTCPFastOpenPassiveFail non-zero" 35 35 return 1 36 36 fi