selftests: mptcp: diag: fix bash warnings on older kernels
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Thu, 15 Feb 2024 18:25:36 +0000 (19:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Feb 2024 10:25:00 +0000 (10:25 +0000)
commit694bd45980a61045eb5ec07799e3b94c76db830e
tree7c3d08df4345f30c1b1ea576aa27a1db2edcd588
parent662f084f3396d8a804d56cb53ac05c9e39902a7b
selftests: mptcp: diag: fix bash warnings on older kernels

Since the 'Fixes' commit mentioned below, the command that is executed
in __chk_nr() helper can return nothing if the feature is not supported.
This is the case when the MPTCP CURRESTAB counter is not supported.

To avoid this warning ...

  ./diag.sh: line 65: [: !=: unary operator expected

... we just need to surround '$nr' with double quotes, to support an
empty string when the feature is not supported.

Fixes: 81ab772819da ("selftests: mptcp: diag: check CURRESTAB counters")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/mptcp/diag.sh