aboutsummaryrefslogtreecommitdiffstats
path: root/check
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-01-24 12:05:01 +1100
committerDave Chinner <david@fromorbit.com>2014-01-24 12:05:01 +1100
commit586a06c5b9ef996e5d6dbc5874e6106083a49e6f (patch)
tree8146dcc5fce5c79a7f69346f2e7c4728dcecd5cc /check
parent80622a6b4aaee6b4b72c09530367ca7ca3542a3f (diff)
downloadxfstests-dev-586a06c5b9ef996e5d6dbc5874e6106083a49e6f.tar.gz
xfstests: use value of FSTYP if defined externally
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> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'check')
-rwxr-xr-xcheck7
1 files changed, 4 insertions, 3 deletions
diff --git a/check b/check
index e8d39438a3..268417c258 100755
--- a/check
+++ b/check
@@ -33,7 +33,6 @@ showme=false
have_test_arg=false
randomize=false
here=`pwd`
-FSTYP=xfs
xfile=""
# start the initialisation work now
@@ -57,10 +56,12 @@ 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
FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
fi
+FSTYP=${FSTYP:=xfs}
export FSTYP
SUPPORTED_TESTS="[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]"