From: Dave Chinner <david@fromorbit.com>
To: David Sterba <dsterba@suse.cz>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/5] xfstests: use value of FSTYP if defined externally
Date: Mon, 20 Jan 2014 13:13:45 +1100 [thread overview]
Message-ID: <20140120021345.GG18112@dastard> (raw)
In-Reply-To: <efafb76f725148435b09a22c62c92a63eedb9b71.1389891730.git.dsterba@suse.cz>
On Thu, Jan 16, 2014 at 06:07:12PM +0100, David Sterba wrote:
> The initial value of FSTYP is unconditionally set to 'xfs' and the
> filesystem type is taken from the TEST_DEV. This could lead to confusion
> if the device hasn't been formatted yet, eg. an empty image in VM, or
> a different test setup took place before.
>
> Now one can specify the desired FSTYP in advance and be safe. If unset,
> the fallback to TEST_DEV type continues to work.
>
> Signed-off-by: David Sterba <dsterba@suse.cz>
> ---
> README | 3 +++
> check | 7 ++++---
> 2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/README b/README
> index a49ca7c3ff15..62974ef87b89 100644
> --- a/README
> +++ b/README
> @@ -65,6 +65,9 @@ Preparing system for tests (IRIX and Linux):
> environment variable set to "yes" will enable their use.
> - setenv DIFF_LENGTH "number of diff lines to print from a failed test",
> by default 10, set to 0 to print the full diff
> + - setenv FSTYP "the filesystem you want to test", the filesystem
> + type is devised from the TEST_DEV device, but you may want to
> + override it
> - or add a case to the switch in common/config assigning
> these variables based on the hostname of your test
> machine
> diff --git a/check b/check
> index 320ad26b7c2c..9e4275b1fa37 100755
> --- a/check
> +++ b/check
> @@ -33,7 +33,7 @@ showme=false
> have_test_arg=false
> randomize=false
> here=`pwd`
> -FSTYP=xfs
> +FSTYP=${FSTYP:-xfs}
":-xfs" means assign the value of $xfs if $FTYPE is null. xfs is not
a variable....
> xfile=""
>
> # start the initialisation work now
> @@ -57,8 +57,9 @@ then
> exit 1
> fi
>
> -# Autodetect fs type based on what's on $TEST_DEV
> -if [ "$HOSTOS" == "Linux" ]; then
> +# Autodetect fs type based on what's on $TEST_DEV unless it's been set
> +# externally
> +if [ -z "$FSTYP" -a "$HOSTOS" == "Linux" ]; then
If the default value expansion is fixed, FSTYP will always have a
value here Hence it will never, ever probe.
> FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
> fi
> export FSTYP
I suspect what you want is:
-FSTYP=xfs
.....
if [ -z "$FSTYP" -a "$HOSTOS" == "Linux" ]; then
FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
fi
FSTYP=${FSTYP:=xfs}
export FSTYP
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-01-20 2:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 17:07 [PATCH 0/5] xfstests: A few updates to non-test code David Sterba
2014-01-16 17:07 ` [PATCH 1/5] xfstests: fix minor build warning David Sterba
2014-01-16 22:11 ` Ben Myers
2014-01-16 17:07 ` [PATCH 2/5] xfstests: use value of FSTYP if defined externally David Sterba
2014-01-20 2:13 ` Dave Chinner [this message]
2014-01-20 18:19 ` David Sterba
2014-01-20 22:22 ` Dave Chinner
2014-01-16 17:07 ` [PATCH 3/5] xfstests: don't suggest to run full diff when DIFF_LENGTH is 0 David Sterba
2014-01-20 2:25 ` Dave Chinner
2014-01-16 17:07 ` [PATCH 4/5] xfstests: accept tests/ prefix for test name on commandline David Sterba
2014-01-16 17:07 ` [PATCH 5/5] xfstests: update lsqa.pl for new tests layout David Sterba
2014-01-20 5:46 ` [PATCH 0/5] xfstests: A few updates to non-test code Dave Chinner
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=20140120021345.GG18112@dastard \
--to=david@fromorbit.com \
--cc=dsterba@suse.cz \
--cc=xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.