linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests: Add -s option to run only specified sections
@ 2014-04-10 17:35 Lukas Czerner
  2014-04-11  0:16 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Czerner @ 2014-04-10 17:35 UTC (permalink / raw)
  To: xfs; +Cc: Lukas Czerner, linux-ext4

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.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 README.config-sections | 30 ++++++++++++++++++++++++++++++
 check                  | 16 +++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/README.config-sections b/README.config-sections
index 2849fd5..865ca93 100644
--- a/README.config-sections
+++ b/README.config-sections
@@ -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
 -------
diff --git a/check b/check
index 09d753b..e7ace63 100755
--- a/check
+++ b/check
@@ -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"
-- 
1.8.3.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfstests: Add -s option to run only specified sections
  2014-04-10 17:35 [PATCH] xfstests: Add -s option to run only specified sections Lukas Czerner
@ 2014-04-11  0:16 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2014-04-11  0:16 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4, xfs

On Thu, Apr 10, 2014 at 07:35:52PM +0200, Lukas Czerner wrote:
> 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.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Neat. Looks simple enough.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-11  0:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-10 17:35 [PATCH] xfstests: Add -s option to run only specified sections Lukas Czerner
2014-04-11  0:16 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).