From: Benjamin Poirier Date: Mon, 16 Dec 2019 06:43:38 +0000 (+0900) Subject: testsuite: Fix line count test X-Git-Tag: v5.5.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d88a6a98e86da9446487ecc4f1fea435323ef21d;p=thirdparty%2Fiproute2.git testsuite: Fix line count test a substring match is not enough, ex: 10 != 1 Fixes: 30383b074de1 ("tests: Add output testing") Signed-off-by: Benjamin Poirier Signed-off-by: Stephen Hemminger --- diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh index f92260fc4..e909008aa 100644 --- a/testsuite/lib/generic.sh +++ b/testsuite/lib/generic.sh @@ -121,7 +121,7 @@ test_on_not() test_lines_count() { echo -n "test on lines count ($1): " - if cat "$STD_OUT" | wc -l | grep -q "$1" + if [ $(cat "$STD_OUT" | wc -l) -eq "$1" ] then pr_success else