From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH v2 1/2] overlay/075: fix wrong invocation of t_immutable
Date: Sun, 6 Jun 2021 18:18:10 +0300 [thread overview]
Message-ID: <20210606151811.420788-2-amir73il@gmail.com> (raw)
In-Reply-To: <20210606151811.420788-1-amir73il@gmail.com>
t_immutable cannot be run twice on the same test directoty, because
append-only directory tests create files in append-only.d and those
file already exist from the first run.
Use separate test directories for the first and second t_immutable runs.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
tests/overlay/075 | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/overlay/075 b/tests/overlay/075
index 5a6c3be0..02df1599 100755
--- a/tests/overlay/075
+++ b/tests/overlay/075
@@ -30,6 +30,7 @@ _cleanup()
# we just need to remove the flags so use -R
$timmutable -R $upperdir/testdir &> /dev/null
$timmutable -R $lowerdir/testdir &> /dev/null
+ $timmutable -R $lowerdir/testdir.before &> /dev/null
rm -f $tmp.*
}
@@ -45,13 +46,16 @@ _require_scratch
_scratch_mkfs
-# Preparing test area files in lower dir and check chattr support of base fs
+# Check chattr support of base fs
mkdir -p $lowerdir
mkdir -p $upperdir
-$timmutable -C $lowerdir/testdir >$tmp.out 2>&1
+$timmutable -C $lowerdir/testdir.before >$tmp.out 2>&1
if grep -q -e 'Operation not supported' -e "Inappropriate ioctl" $tmp.out; then
_notrun "Setting immutable/append flag not supported"
fi
+
+# Prepare test area files in lower dir
+$timmutable -C $lowerdir/testdir >$tmp.out 2>&1
# Remove the immutable/append-only flags and create subdirs
$timmutable -R $lowerdir/testdir >$tmp.out 2>&1
for dir in $lowerdir/testdir/*.d; do
@@ -62,9 +66,9 @@ $timmutable -C $lowerdir/testdir >$tmp.out 2>&1
_scratch_mount
-# Test immutability of files in overlay
+# Test immutability of files in overlay before copy up
echo "Before directories copy up"
-$timmutable $SCRATCH_MNT/testdir 2>&1
+$timmutable $SCRATCH_MNT/testdir.before 2>&1
# Trigger copy-up of immutable/append-only dirs by touching their subdirs
# inode flags are not copied-up, so immutable/append-only flags are lost
--
2.31.1
next prev parent reply other threads:[~2021-06-06 15:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-06 15:18 [PATCH v2 0/2] Fixes to overlayfs immutable files tests Amir Goldstein
2021-06-06 15:18 ` Amir Goldstein [this message]
2021-06-06 15:18 ` [PATCH v2 2/2] overlay/075: add test coverage for clearing immutable/append-only flags Amir Goldstein
2021-06-06 16:00 ` [PATCH v2 0/2] Fixes to overlayfs immutable files tests 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=20210606151811.420788-2-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).