summaryrefslogtreecommitdiffstats
path: root/tests/features/worm.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features/worm.t')
-rwxr-xr-xtests/features/worm.t12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/features/worm.t b/tests/features/worm.t
index 8b2574c..40b08cd 100755
--- a/tests/features/worm.t
+++ b/tests/features/worm.t
@@ -72,11 +72,19 @@ sleep 10
TEST `echo "worm 1" >> $M0/file4`
TEST ! rm -f $M0/file4
+## Test for state transition if auto-commit-period is 0
+TEST $CLI volume set $V0 features.auto-commit-period 0
+TEST `echo "worm 1" > $M0/file5`
+EXPECT '3/10/0' echo $(getfattr -e text --absolute-names --only-value -n "trusted.reten_state" $B0/${V0}1/file5)
+EXPECT 'worm 1' cat $M0/file5
+TEST ! rm -f $M0/file5
+TEST $CLI volume set $V0 features.auto-commit-period 5
+
## Test for checking if retention-period is updated on increasing the access time of a WORM-RETAINED file.
TEST $CLI volume set $V0 features.worm-files-deletable 1
TEST `echo "worm 1" >> $M0/file1`
initial_timestamp=$(date +%s)
-current_time_seconds=$(date +%S);
+current_time_seconds=$(date +%S | sed 's/^0*//' );
TEST chmod 0444 $M0/file1
EXPECT '3/10/5' echo $(getfattr -e text --absolute-names --only-value -n "trusted.reten_state" $B0/${V0}1/file1)
changed_timestamp=$(date +%Y%m%d%H%M --date '60 seconds');
@@ -91,7 +99,7 @@ EXPECT "$initial_timestamp" echo $(stat --printf %X $M0/file1)
## Test for checking if retention-period is updated on decreasing the access time of a WORM-RETAINED file
TEST $CLI volume set $V0 features.default-retention-period 120
initial_timestamp=$(date +%s)
-current_time_seconds=$(date +%S);
+current_time_seconds=$(date +%S | sed 's/^0*//' );
TEST chmod 0444 $M0/file1
EXPECT '3/120/5' echo $(getfattr -e text --absolute-names --only-value -n "trusted.reten_state" $B0/${V0}1/file1)
changed_timestamp=$(date +%Y%m%d%H%M --date '60 seconds');