public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Omer Zilberberg <Omer.Zilberberg@netapp.com>
To: fstests@vger.kernel.org
Cc: Omer Zilberberg <Omer.Zilberberg@netapp.com>
Subject: [PATCH] generic/4[13,62]: restore TEST mount options
Date: Mon, 30 Oct 2017 10:08:31 +0200	[thread overview]
Message-ID: <20171030080831.7339-1-Omer.Zilberberg@netapp.com> (raw)

These tests locally change the TEST_FS_MOUNT_OPTS/MOUNT_OPTIONS
environment variables, and run _test_cycle_mount. As a result, following
tests using the TEST mount point may start with different mount options,
depending on run order.

This patch restores the TEST mount point's options.

Signed-off-by: Omer Zilberberg <Omer.Zilberberg@netapp.com>
---
 tests/generic/413 | 7 +++++++
 tests/generic/462 | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/tests/generic/413 b/tests/generic/413
index a1cc51443..94633a4d4 100755
--- a/tests/generic/413
+++ b/tests/generic/413
@@ -136,6 +136,8 @@ fi
 _scratch_mkfs "$mkfs_opts" > /dev/null 2>&1
 
 # mount SCRATCH_DEV with dax option, TEST_DEV not
+mount_options_orig=$MOUNT_OPTIONS
+test_fs_mount_opts_orig=$TEST_FS_MOUNT_OPTS
 export MOUNT_OPTIONS=""
 export TEST_FS_MOUNT_OPTS=""
 _test_cycle_mount
@@ -147,6 +149,11 @@ tsize=$((128 * 1024 * 1024))
 
 do_tests
 
+# restore TEST_FS to original mount options
+export MOUNT_OPTIONS=$mount_options_orig
+export TEST_FS_MOUNT_OPTS=$test_fs_mount_opts_orig
+_test_cycle_mount
+
 # success, all done
 echo "Silence is golden"
 status=0
diff --git a/tests/generic/462 b/tests/generic/462
index a5d6c4f85..176035ddc 100755
--- a/tests/generic/462
+++ b/tests/generic/462
@@ -64,6 +64,7 @@ _scratch_mkfs >>$seqres.full 2>&1
 _scratch_mount "-o dax"
 
 # remount TEST_DEV wo/ dax
+test_fs_mount_opts_orig=$TEST_FS_MOUNT_OPTS
 export TEST_FS_MOUNT_OPTS=""
 _test_cycle_mount
 
@@ -90,6 +91,10 @@ md5_2="$(_md5_checksum $SCRATCH_MNT/readonlyfile)"
 
 [ "$md5_1" != "$md5_2" ] && echo "read only file changed"
 
+# restore TEST_FS to original mount options
+export TEST_FS_MOUNT_OPTS=$test_fs_mount_opts_orig
+_test_cycle_mount
+
 # success, all done
 status=0
 exit
-- 
2.13.6


             reply	other threads:[~2017-10-30  8:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30  8:08 Omer Zilberberg [this message]
2017-10-30 20:36 ` [PATCH] generic/4[13,62]: restore TEST mount options Dave Chinner
2017-10-31  4:37   ` Eryu Guan
2017-10-31 10:25     ` Omer Zilberberg
2017-10-31 11:34       ` Eryu Guan
2017-11-01 12:06         ` Omer Zilberberg
2017-11-01 12:52           ` Eryu Guan
2017-11-01 15:03             ` Omer Zilberberg
2017-11-02 12:13               ` Eryu Guan
2017-11-05 14:20                 ` Omer Zilberberg
2017-10-31 22:08     ` Dave Chinner

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=20171030080831.7339-1-Omer.Zilberberg@netapp.com \
    --to=omer.zilberberg@netapp.com \
    --cc=fstests@vger.kernel.org \
    /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