linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] overlay/075: fix wrong invocation of t_immutable
@ 2021-06-05  9:43 Amir Goldstein
  0 siblings, 0 replies; only message in thread
From: Amir Goldstein @ 2021-06-05  9:43 UTC (permalink / raw)
  To: Eryu Guan; +Cc: Miklos Szeredi, linux-unionfs, fstests

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>
---

Eryu,

While working on the kernel fix, I found this test bug.
Please merge this test bug fix in preparation of the kernel fix.

Thanks,
Amir.

 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-05  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05  9:43 [PATCH] overlay/075: fix wrong invocation of t_immutable Amir Goldstein

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).