public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: xfs@oss.sgi.com
Cc: Lukas Czerner <lczerner@redhat.com>,
	fdmanana@gmail.com, linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] xfstests: Fix setting FSTYP automatically
Date: Tue,  8 Apr 2014 17:42:50 +0200	[thread overview]
Message-ID: <1396971770-23553-3-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1396971770-23553-1-git-send-email-lczerner@redhat.com>

Currently if the FSTYP is not set, the code to get FSTYP using blikd
would not work. This is because we're using HOSTOS environment variable
which might not be set (at least not on my system) and because it's
already late in the code path.

Fix this by using OSTYP environment variable as a fallback in the case
that HOSTOS does not work and move the check to common/config.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 check         |  8 --------
 common/config | 18 +++++++++++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/check b/check
index 8f1a6e1..ed1834d 100755
--- a/check
+++ b/check
@@ -58,14 +58,6 @@ then
     exit 1
 fi
 
-# 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]"
 SRC_GROUPS="generic shared"
 export SRC_DIR="tests"
diff --git a/common/config b/common/config
index 3163801..00249e6 100644
--- a/common/config
+++ b/common/config
@@ -297,11 +297,6 @@ _fsck_opts()
 	esac
 }
 
-[ -z "$FSTYP" ] && export FSTYP=xfs
-[ -z "$MOUNT_OPTIONS" ] && _mount_opts
-[ -z "$MKFS_OPTIONS" ] && _mkfs_opts
-[ -z "$FSCK_OPTIONS" ] && _fsck_opts
-
 known_hosts()
 {
 	[ "$HOST_CONFIG_DIR" ] || HOST_CONFIG_DIR=`pwd`/configs
@@ -446,6 +441,19 @@ get_next_config() {
 if [ -z "$CONFIG_INCLUDED" ]; then
 	get_next_config `echo $HOST_OPTIONS_SECTIONS | cut -f1 -d" "`
 	export CONFIG_INCLUDED=true
+
+	# Autodetect fs type based on what's on $TEST_DEV unless it's been set
+	# externally
+	if [ -z "$FSTYP" ] && \
+	   [ "$HOSTOS" == "Linux" -o "$OSTYPE" == "linux-gnu" ] && \
+	   [ ! -z "$TEST_DEV" ]; then
+		FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
+	fi
+	FSTYP=${FSTYP:=xfs}
+	export FSTYP
+	[ -z "$MOUNT_OPTIONS" ] && _mount_opts
+	[ -z "$MKFS_OPTIONS" ] && _mkfs_opts
+	[ -z "$FSCK_OPTIONS" ] && _fsck_opts
 fi
 
 # make sure this script returns success
-- 
1.8.3.1

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

  parent reply	other threads:[~2014-04-08 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  9:03 [ANNOUNCE] xfstests: updated to cf1ed54 Dave Chinner
2014-04-04 13:07 ` Filipe David Manana
2014-04-04 21:12   ` Dave Chinner
2014-04-08 10:07     ` Lukáš Czerner
2014-04-08 15:42     ` [PATCH 1/3] xfstests: Fix SCRATCH_DEV_POOL handling Lukas Czerner
2014-04-08 15:42       ` [PATCH 2/3] xfstests: Unset SCRATCH_DEV when deduced from SCRATCH_DEV_POOL Lukas Czerner
2014-04-08 16:52         ` Filipe David Manana
2014-04-08 15:42       ` Lukas Czerner [this message]
2014-04-08 16:52         ` [PATCH 3/3] xfstests: Fix setting FSTYP automatically Filipe David Manana
2014-04-08 16:51       ` [PATCH 1/3] xfstests: Fix SCRATCH_DEV_POOL handling Filipe David Manana
2014-04-08  0:14   ` [ANNOUNCE] xfstests: updated to cf1ed54 Dave Chinner
2014-04-08 15:16     ` Filipe David Manana

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=1396971770-23553-3-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox