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

Configure Feed

Select the types of activity you want to include in your feed.

selftests: net: Remove unnecessary backslashes in fq_band_pktlimit.sh

Address "grep: warning: stray \ before white space" warning from GNU
grep 3.12. This warns the misplaced backslashes before whitespaces
(e.g. \\' ' or '\ ') which leads to unspecified behavior [1].

We can just remove the backslashes before whitespaces as POSIX says:

Enclosing characters in single-quotes ('') shall preserve the literal
value of each character within the single-quotes.

and bourne-compatible shells behave so.

[1]: https://lists.gnu.org/r/bug-gnulib/2022-05/msg00057.html

Signed-off-by: Yohei Kojima <yk@y-koj.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/dd0bbd48cdf468da56ec34fd61cecd4d2111d7ba.1774372510.git.yk@y-koj.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yohei Kojima and committed by
Jakub Kicinski
5f70b0aa e1877cf6

+8 -8
+8 -8
tools/testing/selftests/net/fq_band_pktlimit.sh
··· 32 32 DELAY=400000 33 33 34 34 ./cmsg_sender -6 -p u -d "${DELAY}" -n 20 fdaa::2 8000 35 - OUT1="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 35 + OUT1="$(tc -s qdisc show dev dummy0 | grep '^ Sent')" 36 36 37 37 ./cmsg_sender -6 -p u -d "${DELAY}" -n 20 fdaa::2 8000 38 - OUT2="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 38 + OUT2="$(tc -s qdisc show dev dummy0 | grep '^ Sent')" 39 39 40 40 ./cmsg_sender -6 -p u -d "${DELAY}" -n 20 -P 7 fdaa::2 8000 41 - OUT3="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 41 + OUT3="$(tc -s qdisc show dev dummy0 | grep '^ Sent')" 42 42 43 43 # Initial stats will report zero sent, as all packets are still 44 44 # queued in FQ. Sleep for at least the delay period and see that 45 45 # twenty are now sent. 46 46 sleep 0.6 47 - OUT4="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 47 + OUT4="$(tc -s qdisc show dev dummy0 | grep '^ Sent')" 48 48 49 49 # Log the output after the test 50 50 echo "${OUT1}" ··· 53 53 echo "${OUT4}" 54 54 55 55 # Test the output for expected values 56 - echo "${OUT1}" | grep -q '0\ pkt\ (dropped\ 10' || die "unexpected drop count at 1" 57 - echo "${OUT2}" | grep -q '0\ pkt\ (dropped\ 30' || die "unexpected drop count at 2" 58 - echo "${OUT3}" | grep -q '0\ pkt\ (dropped\ 40' || die "unexpected drop count at 3" 59 - echo "${OUT4}" | grep -q '20\ pkt\ (dropped\ 40' || die "unexpected accept count at 4" 56 + echo "${OUT1}" | grep -q '0 pkt (dropped 10' || die "unexpected drop count at 1" 57 + echo "${OUT2}" | grep -q '0 pkt (dropped 30' || die "unexpected drop count at 2" 58 + echo "${OUT3}" | grep -q '0 pkt (dropped 40' || die "unexpected drop count at 3" 59 + echo "${OUT4}" | grep -q '20 pkt (dropped 40' || die "unexpected accept count at 4"