xfstests: Fix test wildcard expansion.
PATCH 1/1 xfstests: Fix test wildcard expansion.
Before commit 38d58591 "xfstests: fix typo in check", check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:
'if grep "^$testname" $group_file >/dev/null' returns the contents of $group_file because $testname="".
Therefore xfs/[0-9]?? was echoed to $tmp.list
Fix the parsing in check to expand the regular expressions for test names.
---
check +9 -7
@@ -242,13 +242,15 @@ if $have_test_arg; then test_name=`basename $1` group_file=$SRC_DIR/$test_dir/group - if grep "^$test_name" $group_file >/dev/null ; then - # in group file ... OK - echo $SRC_DIR/$1 >>$tmp.list - else - # oops - echo "$1 - unknown test, ignored" - fi + for f in `cd $SRC_DIR/$test_dir; ls $test_name`; do + if grep "^$f" $group_file >/dev/null ; then + # in group file ... OK + echo $SRC_DIR/$test_dir/$f >>$tmp.list + else + # oops + echo "$test_dir/$f - unknown test, ignored" + fi + done ;; esac
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Rich Johnston
Before commit
38d58591"xfstests: fix typo in check", check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:'if grep "^$testname" $group_file >/dev/null' returns the contents of $group_file because $testname="".
Therefore xfs/[0-9]?? was echoed to $tmp.list
Fix the parsing in check to expand the regular expressions for test names.
I just fixed this locally myself:
- if grep "^$test_name" $group_file >/dev/null ; then
+ if egrep "^$test_name" $group_file >/dev/null ; then
Which just tells grep to treat the pattern as an extended regex....
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Before commit 38d58591 "xfstests: fix typo in check", check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:
Change to use egrep to fix the parsing.
---
V1-V2
Use egrep instead of my bulky method
check +1 -1
@@ -242,7 +242,7 @@ if $have_test_arg; then test_name=`basename $1` group_file=$SRC_DIR/$test_dir/group - if grep "^$test_name" $group_file >/dev/null ; then + if egrep "^$test_name" $group_file >/dev/null ; then # in group file ... OK echo $SRC_DIR/$1 >>$tmp.list else
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Dave Chinner
Reviewed-byQuoted 10 lines · Rich Johnston
Before commit
38d58591"xfstests: fix typo in check", check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:Change to use egrep to fix the parsing.
Signed-off-by Rich Johnston <[email protected]>---
V1-V2
Use egrep instead of my bulky method
looks like you lost a bit of the commit message. Otherwise it works fine here ;)
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Rich Johnston
Before commit
38d58591"xfstests: fix typo in check", check xfs/[0-9]?? would execute all tests/xfs/[0-9]?? because:Change to use egrep to fix the parsing.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Rich Johnston <[email protected]>---
V1-V2
Use egrep instead of my bulky methodlooks like you lost a bit of the commit message. Otherwise it works fine here ;)
Oops dang cut/paste, I put it back.
Quoted 3 lines
Reviewed-by Dave Chinner <[email protected]>
Thanks for the review Dave.
commit 9267afb16b8e861888e54f829015667753034980
Author: Rich Johnston <[email protected]> Date: Fri May 31 07:02:48 2013 -0500
xfstests: Fix test wildcard expansion.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs