From efcbad25ee85c2f672ba8f4e30be9fe07d6c34a7 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 2 Jul 2017 21:56:10 +0200 Subject: [PATCH] tests: drop wc -l when grep -c works --- test/shell/pv-duplicate-uuid.sh | 2 +- test/shell/thin-dmeventd-warns.sh | 2 +- test/shell/vgcfgbackup-usage.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/shell/pv-duplicate-uuid.sh b/test/shell/pv-duplicate-uuid.sh index d1664a4c7..43eb830b7 100644 --- a/test/shell/pv-duplicate-uuid.sh +++ b/test/shell/pv-duplicate-uuid.sh @@ -35,7 +35,7 @@ pvs -o+uuid 2>&1 | tee out grep WARNING out > warn || true grep -v WARNING out > main || true -test $(grep $UUID1 main | wc -l) -eq 1 +test "$(grep -c $UUID1 main)" -eq 1 COUNT=$(grep --count "was already found" warn) [ "$COUNT" -eq 2 ] diff --git a/test/shell/thin-dmeventd-warns.sh b/test/shell/thin-dmeventd-warns.sh index 29d3c4f0e..d87410262 100644 --- a/test/shell/thin-dmeventd-warns.sh +++ b/test/shell/thin-dmeventd-warns.sh @@ -29,7 +29,7 @@ wait_warn_() { for i in $(seq 1 7) do - test $(egrep "WARNING: Thin pool.*is now" debug.log_DMEVENTD_out | wc -l) -eq $1 && return 0 + test "$(grep -E -c "WARNING: Thin pool.*is now" debug.log_DMEVENTD_out)" -eq "$1" && return 0 sleep 2 done diff --git a/test/shell/vgcfgbackup-usage.sh b/test/shell/vgcfgbackup-usage.sh index 6183490cd..6bf6cea8a 100644 --- a/test/shell/vgcfgbackup-usage.sh +++ b/test/shell/vgcfgbackup-usage.sh @@ -47,7 +47,7 @@ invalid vgcfgrestore -f "bak-$vg1" $vg1-inv@lid invalid vgcfgrestore -f "bak-$vg1" $vg1 $vg2 vgcfgrestore -l $vg1 | tee out -test $(grep Description out | wc -l) -eq 2 +test "$(grep -c Description out)" -eq 2 vgcfgrestore -l -f "bak-$vg1" $vg1