From 43ed6fa34b259b568ae1442b65a5004a894a2654 Mon Sep 17 00:00:00 2001 From: Rinku Kothiya Date: Thu, 9 Apr 2020 13:51:22 +0000 Subject: tests: Fix spurious failure of worm.t When the output of date command is a single digit number it is preceded by zero which is getting considered as an octal number. Removing the leading zero from the number solved the problem. Fixes: #1156 Change-Id: Iac4fa20607c0bb90d94dd8ff157ef6b60932c560 Signed-off-by: Rinku Kothiya --- tests/features/worm.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/features/worm.t b/tests/features/worm.t index 168d326571b..40b08cdee02 100755 --- a/tests/features/worm.t +++ b/tests/features/worm.t @@ -84,7 +84,7 @@ TEST $CLI volume set $V0 features.auto-commit-period 5 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'); @@ -99,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'); -- cgit