summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVishal Pandey <vishpandey2014@gmail.com>2017-11-02 19:16:26 +0530
committerAmar Tumballi <amarts@redhat.com>2017-11-20 11:41:27 +0000
commitdbd94d5bee93ca9ad4f485147b90b4ccf8a3b61e (patch)
treea45e286ae34fd2f6e03bbebf64455467a9a43fc1 /tests
parentc810ea1e2ba5c15b11808e2bd378e95c428b7f96 (diff)
features/worm: new config option to manage deletion of Worm files.
Add a new configuration option worm-files-deletable to file-level Worm in order to control behaviour of Worm files upon deletion. Steps to Test: 1. Add all the configuration options to a volume to activate file-level-worm 2. Option features.worm-files-deletable is set to 1 by default. 3. Create a new file and wait for the retention time to expire. 4. After retention time expires, do an truncate, rename, unlink, link or write to send the file in Worm state. 5. After that do `rm -f filename`. 6. The file is successfully removed. 7. Repeat from step 2 by setting features.worm-files-deletable 0. This time deletion should not be successful. Change-Id: Ibc89861ee296e065330b93a9f9606be5da40af31 BUG: 1508898 Signed-off-by: Vishal Pandey <vishpandey2014@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/features/worm.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/features/worm.t b/tests/features/worm.t
index c725f5858ec..9766dc1ad2b 100755
--- a/tests/features/worm.t
+++ b/tests/features/worm.t
@@ -64,6 +64,14 @@ TEST `echo "worm 2" >> $M0/file3`
EXPECT 'worm 1' cat $M0/file3
TEST ! rm -f $M0/file3
+## Test for checking if Worm files are undeletable after setting worm-files-deletable as 0.
+TEST $CLI volume set $V0 features.worm-files-deletable 0
+TEST `echo "worm 1" > $M0/file4`
+TEST chmod 0444 $M0/file4
+sleep 10
+TEST `echo "worm 1" >> $M0/file4`
+TEST ! rm -f $M0/file4
+
TEST $CLI volume stop $V0
EXPECT 'Stopped' volinfo_field $V0 'Status'