Skip to contentSkip to conversation

xfstests: Fix test wildcard expansion.

PATCH In review Rich Johnston 2 participants 5 messages May 30, 2013 – May 31, 2013

lore
Share & tools
lore
#0 lore raw

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
index 8d32486..eb5d9be 100755
@@ -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

#1 lore raw
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
#2 lore raw
In reply to 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.

---
V1-V2
Use egrep instead of my bulky method

check +1 -1
index 8d32486..ff8fbcf 100755
@@ -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

Reviewed-by
#3 lore raw
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:

Change to use egrep to fix the parsing.

---
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
#4 lore raw
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

---
V1-V2
Use egrep instead of my bulky method

looks 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

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