public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@google.com>
To: tytso@mit.edu
Cc: fstests@vger.kernel.org, Eric Biggers <ebiggers@google.com>
Subject: [PATCH] [xfstests-bld] kvm-xfstests: forbid conflicting specifications of FSTESTCFG
Date: Fri, 23 Sep 2016 13:56:12 -0700	[thread overview]
Message-ID: <1474664172-84173-3-git-send-email-ebiggers@google.com> (raw)
In-Reply-To: <1474664172-84173-1-git-send-email-ebiggers@google.com>

It was possible to run kvm-xfstests with arguments like '-c encrypt
smoke', in which case FSTESTCFG ended up set to "4k" because 'smoke'
implies '-c 4k' and the second config specification overrode the first.
If the user tries something like this, fail with a helpful error message
rather than proceeding with a configuration that likely wasn't intended.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 kvm-xfstests/util/parse_cli | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/kvm-xfstests/util/parse_cli b/kvm-xfstests/util/parse_cli
index 6dae32f..a170931 100644
--- a/kvm-xfstests/util/parse_cli
+++ b/kvm-xfstests/util/parse_cli
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-FSTESTCFG=all
+FSTESTCFG=""
 SNAPSHOT=",snapshot=on"
 DO_AEX="yes"
 API="1.3"
@@ -118,6 +118,12 @@ while [ "$1" != "" ]; do
 	    DO_AEX=""
 	    ;;
 	-c) shift
+	    if test -n "$FSTESTCFG" ; then
+		echo "The '-c' option (or 'smoke') can only be specified once. "
+		echo "If you want to run tests in multiple configurations," \
+			"use -c CFG1,CFG2,..."
+		exit 1
+	    fi
 	    for i in ${1//,/ }
 	    do
 		validate_config_name "$i"
@@ -317,6 +323,11 @@ while [ "$1" != "" ]; do
 	    fi
 	    ;;
 	smoke)
+	    if test -n "$FSTESTCFG" ; then
+		echo "You can use either '-c' or 'smoke', not both! " \
+			"'smoke' means '-c 4k -g quick'."
+		exit 1
+	    fi
 	    FSTESTCFG=4k
 	    FSTESTSET="$FSTESTSET,-g,quick"
 	    ;;
@@ -357,6 +368,10 @@ while [ "$1" != "" ]; do
     shift
 done
 
+if test -z "$FSTESTCFG" ; then
+    FSTESTCFG=all
+fi
+
 if test -z "$FSTESTSET" -a -z "$ARG"
 then
     echo -e "No tests specified!\n"
-- 
2.8.0.rc3.226.g39d4020


  parent reply	other threads:[~2016-09-23 20:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 20:56 [PATCH] [xfstests-bld] Remove redundant gce-xfstests documentation Eric Biggers
2016-09-23 20:56 ` [PATCH] [xfstests-bld] Fix typos in xfstests-bld documentation Eric Biggers
2016-09-30 22:21   ` Theodore Ts'o
2016-09-23 20:56 ` Eric Biggers [this message]
2016-09-30 22:21   ` [PATCH] [xfstests-bld] kvm-xfstests: forbid conflicting specifications of FSTESTCFG Theodore Ts'o
2016-10-21 20:55     ` Eric Biggers
2016-10-21 21:37       ` Theodore Ts'o
2016-09-30 22:19 ` [PATCH] [xfstests-bld] Remove redundant gce-xfstests documentation Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474664172-84173-3-git-send-email-ebiggers@google.com \
    --to=ebiggers@google.com \
    --cc=fstests@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox