All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/2] overlay/075: add test coverage for clearing immutable/append-only flags
Date: Sun,  6 Jun 2021 18:18:11 +0300	[thread overview]
Message-ID: <20210606151811.420788-3-amir73il@gmail.com> (raw)
In-Reply-To: <20210606151811.420788-1-amir73il@gmail.com>

overlay/075 is a variant of check -overlay generic/079.

check -overlay generic/079 does the following operations on overlay fs:
1. Create files
2. Set immutable/append-only flags
3. Verify files/dirs behaving as immutable/append-only
4. Clear immutable/append-only flags
5. Remove files

overlay/075 performs steps 1,2,4,5 on upper and lower layers
and only step 3 is performed on overlay fs (before and after copy up
and mount cycle).

Add also steps 4,5 to be performed on overlay fs to increase the
test coverage of the "merged" inode xflags feature.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/075 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/overlay/075 b/tests/overlay/075
index 02df1599..f05858b3 100755
--- a/tests/overlay/075
+++ b/tests/overlay/075
@@ -69,6 +69,8 @@ _scratch_mount
 # Test immutability of files in overlay before copy up
 echo "Before directories copy up"
 $timmutable $SCRATCH_MNT/testdir.before 2>&1
+# Remove the immutable/append-only flags before mount cycle
+$timmutable -R $SCRATCH_MNT/testdir.before &> /dev/null
 
 # 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
@@ -88,9 +90,18 @@ done
 # After mount cycle, flags are forever lost
 _scratch_cycle_mount
 
+# Verify that files can be deleted from overlay fs after clearing
+# immutable/append-only flags and mount cycle
+rm -rf $SCRATCH_MNT/testdir.before
+
 # Test immutability of files in overlay after directories copy-up
 echo "After directories copy up"
 $timmutable $SCRATCH_MNT/testdir 2>&1
 
+# Verify that files can be deleted from overlay fs after clearing
+# immutable/append-only flags
+$timmutable -R $SCRATCH_MNT/testdir &> /dev/null
+rm -rf $SCRATCH_MNT/testdir
+
 status=$?
 exit
-- 
2.31.1


  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 ` [PATCH v2 1/2] overlay/075: fix wrong invocation of t_immutable Amir Goldstein
2021-06-06 15:18 ` Amir Goldstein [this message]
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-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.