aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2018-01-20 23:24:00 -0800
committerEryu Guan <eguan@redhat.com>2018-01-22 18:32:17 +0800
commitcdd360da7b279f5fe19b71a0ee2173da2f5fcf44 (patch)
treee1fb861e062486ad40c133f7aa5301c38263e3f4
parent5acc29ad70488411d35b22e1c96552e92a7e628e (diff)
downloadxfstests-cdd360da7b279f5fe19b71a0ee2173da2f5fcf44.tar.gz
check: move expunge test into a helper
Move the expunge test into a helper. [eguan: make TEST_ID local and use grep -q not io redirection] Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rwxr-xr-xcheck20
1 files changed, 15 insertions, 5 deletions
diff --git a/check b/check
index 6078b1ef3c..84752dae36 100755
--- a/check
+++ b/check
@@ -487,6 +487,18 @@ _check_filesystems()
fi
}
+_expunge_test()
+{
+ local TEST_ID="$1"
+ if [ -s $tmp.xlist ]; then
+ if grep -q $TEST_ID $tmp.xlist; then
+ echo " [expunged]"
+ return 1
+ fi
+ fi
+ return 0
+}
+
_prepare_test_list
if $OPTIONS_HAVE_SECTIONS; then
@@ -674,11 +686,9 @@ for section in $HOST_OPTIONS_SECTIONS; do
rm -f $seqres.out.bad
# check if we really should run it
- if [ -s $tmp.xlist ]; then
- if grep $seqnum $tmp.xlist > /dev/null 2>&1 ; then
- echo " [expunged]"
- continue
- fi
+ _expunge_test $seqnum
+ if [ $? -eq 1 ]; then
+ continue
fi
# slashes now in names, sed barfs on them so use grep