]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: tcp_fastopen_backup_key.sh: fix shellcheck issue
authorAnders Roxell <anders.roxell@linaro.org>
Thu, 15 Aug 2019 07:58:26 +0000 (09:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Aug 2019 18:34:32 +0000 (11:34 -0700)
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>
tools/testing/selftests/net/tcp_fastopen_backup_key.sh

index 41476399e184f9cbb13f4541918e80fea4f18cbf..f6e65674b83cec86c215605048a81e63e0d7c20d 100755 (executable)
@@ -30,7 +30,7 @@ do_test() {
        ip netns exec "${NETNS}" ./tcp_fastopen_backup_key "$1"
        val=$(ip netns exec "${NETNS}" nstat -az | \
                grep TcpExtTCPFastOpenPassiveFail | awk '{print $2}')
-       if [ $val -ne 0 ]; then
+       if [ "$val" != 0 ]; then
                echo "FAIL: TcpExtTCPFastOpenPassiveFail non-zero"
                return 1
        fi