xfs
[Top] [All Lists]

Re: [PATCH 3/3] xfstests: Fix setting FSTYP automatically

To: Lukas Czerner <lczerner@xxxxxxxxxx>
Subject: Re: [PATCH 3/3] xfstests: Fix setting FSTYP automatically
From: Filipe David Manana <fdmanana@xxxxxxxxx>
Date: Tue, 8 Apr 2014 17:52:21 +0100
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, "linux-btrfs@xxxxxxxxxxxxxxx" <linux-btrfs@xxxxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=spzN4ADGYWAMve8q+0UUO67CqChSGptSNOV3uS9Fm1M=; b=XzdkXVBwI0aDEIHE+Az8/NsP8cX6oxoDrfqLlcrixVaSgsHDpJfUUvk1K6YCPKcN3f jSszLh1K66VnvushCs0QQYqTynJeH3PhvqS7ZZ/SRT3fTjgX2OS0eyHfnS80uaVCNgu7 2IWQl/xQaaHOck38AtHXUSRLU8UqYRKpi6XsXYPLIp3fr13lyL2zVttOI0F2fuSwLrwM s8yRSgZRzXUHcZsZC19Z2widm6OtzdImoLOO+nQDQtu5HQapzsULm+Oa0p2S1ce6xUEB khnxnavow9HZTAgm9043CZhcoxNT0lTN/T6JlA1qgy7OlAFZyqEszz0QIaJpq2htekLD W1hw==
In-reply-to: <1396971770-23553-3-git-send-email-lczerner@xxxxxxxxxx>
References: <20140404211224.GX17603@dastard> <1396971770-23553-1-git-send-email-lczerner@xxxxxxxxxx> <1396971770-23553-3-git-send-email-lczerner@xxxxxxxxxx>
Reply-to: fdmanana@xxxxxxxxx
On Tue, Apr 8, 2014 at 4:42 PM, Lukas Czerner <lczerner@xxxxxxxxxx> wrote:
> 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@xxxxxxxxxx>

Tested-by: Filipe David Manana <fdmanana@xxxxxxxxx>

Tests working for btrfs now.
Thanks Lukas.

> ---
>  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
>



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

<Prev in Thread] Current Thread [Next in Thread>