From 00a4dc058a0573d18e9c1bd3692fecee151a9285 Mon Sep 17 00:00:00 2001 From: luneo7 Date: Wed, 23 Aug 2017 15:25:57 -0300 Subject: 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. Change-Id: I63c6bbabb7bb456ebedf201cc77b878ffda62229 BUG: 1484490 Signed-off-by: luneo7 Reviewed-on: https://review.gluster.org/18104 Tested-by: jiffin tony Thottan Tested-by: Prashanth Pai Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Prashanth Pai Reviewed-by: Karthik U S Reviewed-by: Amar Tumballi --- tests/features/worm.t | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/features/worm.t') 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' -- cgit