summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorluneo7 <luneo7@gmail.com>2017-10-10 17:08:22 -0300
committerLucas Ferreira <luneo7@gmail.com>2017-10-25 14:07:19 +0000
commit80fbfef5c70b67838a391041e80a67e41c9142b6 (patch)
tree248d410e4de7de9320fb057cf09fbfe9dddb2fb2 /tests
parent7d72d5de2f978db30072f72caa559c1f5f543ef6 (diff)
features/worm: Adding check to newloc when doing rename
Problem: Since rename didn't check if newloc exists and it's retention state it was possible to rename a new file that wasn't in retention over a existing file that was in read-only state. Cherry picked from commit 00a4dc0: > Change-Id: I63c6bbabb7bb456ebedf201cc77b878ffda62229 > BUG: 1484490 > Signed-off-by: luneo7 <luneo7@gmail.com> > Reviewed-on: https://review.gluster.org/18104 > Tested-by: jiffin tony Thottan <jthottan@redhat.com> > Tested-by: Prashanth Pai <ppai@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Prashanth Pai <ppai@redhat.com> > Reviewed-by: Karthik U S <ksubrahm@redhat.com> > Reviewed-by: Amar Tumballi <amarts@redhat.com> Change-Id: I63c6bbabb7bb456ebedf201cc77b878ffda62229 BUG: 1484489 Signed-off-by: luneo7 <luneo7@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/features/worm.t9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/features/worm.t b/tests/features/worm.t
index 407b49a79ce..f8f05065918 100755
--- a/tests/features/worm.t
+++ b/tests/features/worm.t
@@ -48,6 +48,15 @@ TEST ! link $M0/file1 $M0/file2
sleep 5
TEST rm -f $M0/file1
+## Test for mv over WORM/Reatined state
+TEST `echo "worm 1" > $M0/file1`
+TEST chmod 0444 $M0/file1
+TEST `echo "worm 2" > $M0/file2`
+TEST ! mv $M0/file2 $M0/file1
+TEST rm -f $M0/file2
+sleep 10
+TEST rm -f $M0/file1
+
TEST $CLI volume stop $V0
EXPECT 'Stopped' volinfo_field $V0 'Status'