summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRinku Kothiya <rkothiya@redhat.com>2020-04-09 13:51:22 +0000
committerMOHIT AGRAWAL <moagrawa@redhat.com>2020-04-13 14:51:55 +0000
commit43ed6fa34b259b568ae1442b65a5004a894a2654 (patch)
tree46a67f4a38c39387c2398fc33d162c3f67ba2f82
parent0644fce4e52cd738f7ebb5e0596481a256fed3da (diff)
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 <rkothiya@redhat.com>
-rwxr-xr-xtests/features/worm.t4
1 files 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');