From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH v4 1/5] fstests: implement require of multiple overlayfs features
Date: Tue, 30 Jan 2018 08:12:18 +0200 [thread overview]
Message-ID: <1517292742-15624-2-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1517292742-15624-1-git-send-email-amir73il@gmail.com>
Some overlayfs features must be checked together, because they cannot
be enabled without a dependent feature (e.g. nfs_export and index).
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
common/overlay | 27 ++++++++++++++++++++++-----
common/rc | 2 +-
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/common/overlay b/common/overlay
index 1da4ab1..ad2f3be 100644
--- a/common/overlay
+++ b/common/overlay
@@ -122,8 +122,8 @@ _overlay_scratch_unmount()
_overlay_base_unmount "$OVL_BASE_SCRATCH_DEV" "$OVL_BASE_SCRATCH_MNT"
}
-# Require a specific overlayfs feature
-_require_scratch_overlay_feature()
+# Check that a specific overlayfs feature is supported
+__check_scratch_overlay_feature()
{
local feature=$1
@@ -138,9 +138,6 @@ _require_scratch_overlay_feature()
[ "$default" = Y ] || [ "$default" = N ] || \
_notrun "feature '${feature}' not supported by ${FSTYP}"
- _scratch_mkfs > /dev/null 2>&1
- _scratch_mount -o ${feature}=on || \
- _notrun "${FSTYP} feature '${feature}' cannot be enabled on ${SCRATCH_DEV}"
# Check options to be sure. For example, Overlayfs will fallback to
# index=off if underlying fs does not support file handles.
# Overlayfs only displays mount option if it differs from the default.
@@ -149,5 +146,25 @@ _require_scratch_overlay_feature()
( [ "$default" = Y ] && ! _fs_options $SCRATCH_DEV | grep -q "${feature}=off" )) && \
touch $SCRATCH_MNT/foo 2>/dev/null ) || \
_notrun "${FSTYP} feature '${feature}' cannot be enabled on ${SCRATCH_DEV}"
+}
+
+# Require a set of overlayfs features
+_require_scratch_overlay_features()
+{
+ local features=( $* )
+ local opts="rw"
+
+ for feature in ${features[*]}; do
+ opts+=",${feature}=on"
+ done
+
+ _scratch_mkfs > /dev/null 2>&1
+ _scratch_mount -o $opts || \
+ _notrun "overlay options '$opts' cannot be enabled on ${SCRATCH_DEV}"
+
+ for feature in ${features[*]}; do
+ __check_scratch_overlay_feature ${feature}
+ done
+
_scratch_unmount
}
diff --git a/common/rc b/common/rc
index 2e3a83a..4ad59b1 100644
--- a/common/rc
+++ b/common/rc
@@ -3726,7 +3726,7 @@ _require_scratch_feature()
case "$FSTYP" in
overlay)
- _require_scratch_overlay_feature ${feature}
+ _require_scratch_overlay_features ${feature}
;;
*)
_fail "Test for feature '${feature}' of ${FSTYP} is not implemented"
--
2.7.4
next prev parent reply other threads:[~2018-01-30 6:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 6:12 [PATCH v4 0/5] Overlayfs exportfs tests Amir Goldstein
2018-01-30 6:12 ` Amir Goldstein [this message]
2018-01-30 6:12 ` [PATCH v4 2/5] overlay: test encode/decode overlay file handles Amir Goldstein
2018-01-30 6:12 ` [PATCH v4 3/5] overlay: test encode/decode of non-samefs " Amir Goldstein
2018-01-30 6:12 ` [PATCH v4 4/5] overlay: test encode/decode overlay file handles with renames Amir Goldstein
2018-01-30 6:12 ` [PATCH v4 5/5] overlay: test encode/decode of non-samefs " Amir Goldstein
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=1517292742-15624-2-git-send-email-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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