From patchwork Tue Sep 26 15:53:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9972295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 933546037E for ; Tue, 26 Sep 2017 15:52:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82AC428DE1 for ; Tue, 26 Sep 2017 15:52:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7723828DF0; Tue, 26 Sep 2017 15:52:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D2F728DFC for ; Tue, 26 Sep 2017 15:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966429AbdIZPwj (ORCPT ); Tue, 26 Sep 2017 11:52:39 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37750 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966056AbdIZPwi (ORCPT ); Tue, 26 Sep 2017 11:52:38 -0400 Received: by mail-wr0-f194.google.com with SMTP id u48so2755551wrf.4 for ; Tue, 26 Sep 2017 08:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/D9z2yLsDmTfGEiTVvrx5BGy1klF8GTftAiTi0didRA=; b=AdCSWO5Qp0We5jqreobd66yoB7NGT/ZUHjxfETSyscdgw5/Gx+9xJPFK3MT0HIDvTQ 0uimZyKHlFlJyC82o1mhhjenA/WREcYRhztstS/kADH/mKrt2EI4fhrKV2Bu/BGTvsp3 ZPtgKlttdBlmGd/xnuK2TUNDOhLQf7c9u6Nq1PCsqetuZEVv4q+sAxKvn/kgTsxDuBJL 24si4WSmf3mrsXkoXgih1UI51oX5oNfnc4xSuDfKh1yHohau7CmviEFKVrzH5sG81rvN HfKxh1rTjtYL8/L6VxMbXpgOfW3vMR7WeD9XZtl+9wOnmBQzK5MNANKre68CM6xinxPB b2lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/D9z2yLsDmTfGEiTVvrx5BGy1klF8GTftAiTi0didRA=; b=QFNeS2jvzpNhnh9qV3z7T6Hx1lSxrzfj6q3c6l6YKaO4f7gWxl1nGHVmgAybY8NrAY mU+7T80KFFPTiyz6WFENgdQfSGWG/au0tPr+6jDlFwlCF/pwEt49+6Z5N8wC3o8xvFSZ JLOTqa5+8RzEe6Z/QrLIfd0d5xGdeVoznfK5XzlPMu0FBU1PtoE+oTNKEZ7rMhkG5B6G x/G8LCuGsUyKvbfyxKB0paevSrp98UVTXdXyet7VibQB+WOvz5DnqYo+CCIMQws7BD8s osLfXn6uLD+aDshth2O0/BZ4ExIrwqPmUn82wWSU1nk11aLwRZ7LhgaFEGfD4gt0qQHE pwnQ== X-Gm-Message-State: AHPjjUgvZuyBK9UDMkzNYC+Plh8caqCtQt81GkbCni1thM3B1SvaH3zi J4TGM0oqhOn4UXGA8gTCr7lDpg== X-Google-Smtp-Source: AOwi7QCoK122d5nz4Ri3jg3N7e/UqDvTNvCx6ol3OM7Ito1+7AZiz2p5ZvBs4W3zXdnbXwuAyRtcJA== X-Received: by 10.223.139.200 with SMTP id w8mr11004906wra.172.1506441156658; Tue, 26 Sep 2017 08:52:36 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id w14sm1927174wmd.9.2017.09.26.08.52.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Sep 2017 08:52:34 -0700 (PDT) From: Amir Goldstein To: Theodore Ts'o Cc: Eryu Guan , fstests@vger.kernel.org Subject: [PATCH] test-appliance: fix MNTOPTS parsing Date: Tue, 26 Sep 2017 18:53:05 +0300 Message-Id: <1506441185-9690-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When passing MNTOPTS via kvm-xfstests -m command, mount options where not exported to environment, unless the specific fs cfg file had already exported the mount options variable. Signed-off-by: Amir Goldstein --- Ted, While working on overlayfs tests, I found out that kvm-xfstests -m was broken for overlayfs. I decided to fix the problem in overlay/config instead of in individual cfg/* files. I made a similar fix to all other fs, although there may not be a problem with specific cfg files and although I tested the -m option only with overlayfs. This fix is based on an eariler overlay config change from March and added to the same pull request: https://github.com/tytso/xfstests-bld/pull/4 If you want to pick only this fix, there will be a very trivial merge conflict in the overlay cfg files. Please pull. Thanks, Amir. kvm-xfstests/test-appliance/files/root/fs/btrfs/config | 4 ++-- kvm-xfstests/test-appliance/files/root/fs/ext2/config | 4 ++-- kvm-xfstests/test-appliance/files/root/fs/ext4/config | 6 +++--- kvm-xfstests/test-appliance/files/root/fs/f2fs/config | 4 ++-- kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/large | 1 - kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/small | 1 - kvm-xfstests/test-appliance/files/root/fs/overlay/config | 6 +++--- kvm-xfstests/test-appliance/files/root/fs/tmpfs/config | 4 ++-- kvm-xfstests/test-appliance/files/root/fs/xfs/config | 4 ++-- 9 files changed, 16 insertions(+), 18 deletions(-) diff --git a/kvm-xfstests/test-appliance/files/root/fs/btrfs/config b/kvm-xfstests/test-appliance/files/root/fs/btrfs/config index bd51112..51e0e63 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/btrfs/config +++ b/kvm-xfstests/test-appliance/files/root/fs/btrfs/config @@ -30,9 +30,9 @@ function setup_mount_opts() { if test -n "$MNTOPTS" ; then if test -n "$MOUNT_OPTIONS" ; then - MOUNT_OPTIONS="$MOUNT_OPTIONS,$MNTOPTS" + export MOUNT_OPTIONS="$MOUNT_OPTIONS,$MNTOPTS" else - MOUNT_OPTIONS="-o $MNTOPTS" + export MOUNT_OPTIONS="-o $MNTOPTS" fi fi } diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext2/config b/kvm-xfstests/test-appliance/files/root/fs/ext2/config index 58803ae..e2ad484 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/ext2/config +++ b/kvm-xfstests/test-appliance/files/root/fs/ext2/config @@ -30,9 +30,9 @@ function setup_mount_opts() { if test -n "$MNTOPTS" ; then if test -n "$EXT_MOUNT_OPTIONS" ; then - EXT_MOUNT_OPTIONS="$EXT_MOUNT_OPTIONS,$MNTOPTS" + export EXT_MOUNT_OPTIONS="$EXT_MOUNT_OPTIONS,$MNTOPTS" else - EXT_MOUNT_OPTIONS="-o $MNTOPTS" + export EXT_MOUNT_OPTIONS="-o $MNTOPTS" fi fi } diff --git a/kvm-xfstests/test-appliance/files/root/fs/ext4/config b/kvm-xfstests/test-appliance/files/root/fs/ext4/config index 3ef2dd6..0a02284 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/ext4/config +++ b/kvm-xfstests/test-appliance/files/root/fs/ext4/config @@ -30,12 +30,12 @@ function setup_mount_opts() { export MKFS_OPTIONS="$EXT_MKFS_OPTIONS" if test -n "$EXT_MOUNT_OPTIONS" ; then - EXT_MOUNT_OPTIONS="-o block_validity,$EXT_MOUNT_OPTIONS" + export EXT_MOUNT_OPTIONS="-o block_validity,$EXT_MOUNT_OPTIONS" else - EXT_MOUNT_OPTIONS="-o block_validity" + export EXT_MOUNT_OPTIONS="-o block_validity" fi if test -n "$MNTOPTS" ; then - EXT_MOUNT_OPTIONS="$EXT_MOUNT_OPTIONS,$MNTOPTS" + export EXT_MOUNT_OPTIONS="$EXT_MOUNT_OPTIONS,$MNTOPTS" fi if echo "$EXT_MOUNT_OPTIONS" | grep -q test_dummy_encryption; then local mode='\x00\x00\x00\x00' diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config index 3cab963..45fb2dd 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config @@ -28,9 +28,9 @@ function setup_mount_opts() { if test -n "$MNTOPTS" ; then if test -n "$F2FS_MOUNT_OPTIONS" ; then - F2FS_MOUNT_OPTIONS="$F2FS_MOUNT_OPTIONS,$MNTOPTS" + export F2FS_MOUNT_OPTIONS="$F2FS_MOUNT_OPTIONS,$MNTOPTS" else - F2FS_MOUNT_OPTIONS="-o $MNTOPTS" + export F2FS_MOUNT_OPTIONS="-o $MNTOPTS" fi fi } diff --git a/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/large b/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/large index ab9a2bb..413462e 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/large +++ b/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/large @@ -13,6 +13,5 @@ export TEST_DEV=$LG_TST_DEV export TEST_DIR=$LG_TST_MNT export SCRATCH_DEV=$LG_SCR_DEV export SCRATCH_MNT=$LG_SCR_MNT -export EXT_MOUNT_OPTIONS="" TESTNAME="overlayfs large" mkdir -p /test/tmp /test/scratch diff --git a/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/small b/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/small index 552e302..7abb055 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/small +++ b/kvm-xfstests/test-appliance/files/root/fs/overlay/cfg/small @@ -13,6 +13,5 @@ export TEST_DEV=$SM_TST_DEV export TEST_DIR=$SM_TST_MNT export SCRATCH_DEV=$SM_SCR_DEV export SCRATCH_MNT=$SM_SCR_MNT -export EXT_MOUNT_OPTIONS="" TESTNAME="overlayfs small" mkdir -p /test/tmp /test/scratch diff --git a/kvm-xfstests/test-appliance/files/root/fs/overlay/config b/kvm-xfstests/test-appliance/files/root/fs/overlay/config index 3ea3a84..79c87d7 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/overlay/config +++ b/kvm-xfstests/test-appliance/files/root/fs/overlay/config @@ -92,10 +92,10 @@ function format_filesystem() function setup_mount_opts() { if test -n "$MNTOPTS" ; then - if test -n "OVERLAY_MOUNT_OPTIONS" ; then - OVERLAY_MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS,$MNTOPTS" + if test -n "$OVERLAY_MOUNT_OPTIONS" ; then + export OVERLAY_MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS,$MNTOPTS" else - OVERLAY_MOUNT_OPTIONS="-o $MNTOPTS" + export OVERLAY_MOUNT_OPTIONS="-o $MNTOPTS" fi fi } diff --git a/kvm-xfstests/test-appliance/files/root/fs/tmpfs/config b/kvm-xfstests/test-appliance/files/root/fs/tmpfs/config index 31acc11..fa83208 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/tmpfs/config +++ b/kvm-xfstests/test-appliance/files/root/fs/tmpfs/config @@ -18,9 +18,9 @@ function setup_mount_opts() { if test -n "$MNTOPTS" ; then if test -n "$TMPFS_MOUNT_OPTIONS" ; then - TMPFS_MOUNT_OPTIONS="$TMPFS_MOUNT_OPTIONS,$MNTOPTS" + export TMPFS_MOUNT_OPTIONS="$TMPFS_MOUNT_OPTIONS,$MNTOPTS" else - TMPFS_MOUNT_OPTIONS="-o $MNTOPTS" + export TMPFS_MOUNT_OPTIONS="-o $MNTOPTS" fi fi } diff --git a/kvm-xfstests/test-appliance/files/root/fs/xfs/config b/kvm-xfstests/test-appliance/files/root/fs/xfs/config index 943c8a3..ec03649 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/xfs/config +++ b/kvm-xfstests/test-appliance/files/root/fs/xfs/config @@ -30,9 +30,9 @@ function setup_mount_opts() { if test -n "$MNTOPTS" ; then if test -n "$XFS_MOUNT_OPTIONS" ; then - XFS_MOUNT_OPTIONS="$XFS_MOUNT_OPTIONS,$MNTOPTS" + export XFS_MOUNT_OPTIONS="$XFS_MOUNT_OPTIONS,$MNTOPTS" else - XFS_MOUNT_OPTIONS="-o $MNTOPTS" + export XFS_MOUNT_OPTIONS="-o $MNTOPTS" fi fi }