From patchwork Tue Apr 8 15:42:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Czerner X-Patchwork-Id: 3949701 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AEDB09F3E2 for ; Tue, 8 Apr 2014 15:43:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D02E0203DB for ; Tue, 8 Apr 2014 15:43:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C14F1203B7 for ; Tue, 8 Apr 2014 15:43:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757483AbaDHPnN (ORCPT ); Tue, 8 Apr 2014 11:43:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47610 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757393AbaDHPnC (ORCPT ); Tue, 8 Apr 2014 11:43:02 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s38Fgxu0017302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Apr 2014 11:42:59 -0400 Received: from localhost.localdomain.com (dhcp-1-245.brq.redhat.com [10.34.1.245]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s38FgrQ8022692; Tue, 8 Apr 2014 11:42:57 -0400 From: Lukas Czerner To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org, fdmanana@gmail.com, david@fromorbit.com, Lukas Czerner Subject: [PATCH 3/3] xfstests: Fix setting FSTYP automatically Date: Tue, 8 Apr 2014 17:42:50 +0200 Message-Id: <1396971770-23553-3-git-send-email-lczerner@redhat.com> In-Reply-To: <1396971770-23553-1-git-send-email-lczerner@redhat.com> References: <20140404211224.GX17603@dastard> <1396971770-23553-1-git-send-email-lczerner@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Filipe David Manana --- 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