Skip to contentSkip to conversation

xfstests: Add -s option to run only specified sections

PATCH In review Lukas Czerner 2 participants 2 messages Apr 10, 2014 – Apr 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: Add -s option to run only specified sections

This commit adds -s option which allows you to specify only certain sections from the config file to be run. The '-s' argument can be specified multiple times to allow multiple sections to be run.

The options are still carried between section, that includes the sections which are not going to be run.

Update README.config-sections as well.

---
 README.config-sections | 30 ++++++++++++++++++++++++++++++
 check                  | 16 +++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)
README.config-sections +30 -0
index 2849fd5..865ca93 100644
@@ -57,6 +57,36 @@ system.
 
 You can also force the file system recreation by specifying RECREATE_TEST_DEV.
 
+Run specified section only
+--------------------------
+
+Specifying '-s' argument with section name will run only the section
+specified. The '-s' argument can be specified multiple times to allow multiple
+sections to be run.
+
+The options are still carried between section, that includes the sections
+which are not going to be run. So you can do something like
+
+[ext4]
+TEST_DEV=/dev/sda1
+TEST_DIR=/mnt/test
+SCRATCH_DEV=/dev/sdb1
+SCRATCH_MNT=/mnt/test1
+FSTYP=ext4
+
+[xfs]
+FSTYP=xfs
+
+[btrfs]
+FSTYP=btrfs
+
+
+and run
+
+./check -s xfs -s btrfs
+
+to check xfs and btrfs only. All the devices and mounts are still going to
+be parsed from the section [ext4].
 
 Example
 -------
check +15 -1
index 09d753b..e7ace63 100755
@@ -75,6 +75,7 @@ check options
     -T			output timestamps
     -r			randomize test order
     --large-fs		optimise scratch device for large filesystems
+    -s section		run only specified section from config file
 
 testlist options
     -g group[,group...]	include tests from these groups
@@ -221,7 +222,7 @@ while [ $# -gt 0 ]; do
 			done
 		done
 		;;
-
+	-s)	RUN_SECTION="$RUN_SECTION $2"; shift ;;
 	-l)	diff="diff" ;;
 	-udiff)	diff="$diff -u" ;;
 
@@ -389,6 +390,19 @@ for section in $HOST_OPTIONS_SECTIONS; do
 	OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS
 	get_next_config $section
 
+	# Do we need to run only some sections ?
+	if [ ! -z "$RUN_SECTION" ]; then
+		skip=true
+		for s in $RUN_SECTION; do
+			if [ $section == $s ]; then
+				skip=false
+			fi
+		done
+		if $skip; then
+			continue
+		fi
+	fi
+
 	mkdir -p $RESULT_BASE
 	if [ ! -d $RESULT_BASE ]; then
 		echo "failed to create results directory $RESULT_BASE"
Signature · 6 lines
1.8.3.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Lukas Czerner

This commit adds -s option which allows you to specify only certain sections from the config file to be run. The '-s' argument can be specified multiple times to allow multiple sections to be run.

The options are still carried between section, that includes the sections which are not going to be run.

Update README.config-sections as well.

Neat. Looks simple enough.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs