path: root/tests/bitrot
diff options
authorKotresh HR <>2016-08-05 09:03:22 +0530
committerVijay Bellur <>2016-08-25 14:39:38 -0700
commit0b3e4130b576c11156d6327e4cc3c9310a74c143 (patch)
treef0fe66209f2bbd778d34a80a531b8add9c6175bc /tests/bitrot
parent218c9b033fa44eacbc27d87491abd830548b362e (diff)
feature/bitrot: Ondemand scrub option for bitrot
The bitrot scrubber takes 'hourly/daily/biweekly/monthly' as the values for 'scrub-frequency'. There is no way to schedule the scrubbing when the admin wants it. Ondemand scrubbing brings in the new option 'ondemand' with which the admin can start scrubbing ondemand. It starts the scrubbing immediately. Ondemand scrubbing is successful only if the scrubber is in 'Active (Idle)' (waiting for it's next frequency cycle to start scrubbing). It is not entertained when the scrubber is in 'Paused' or already running. Here is the command line syntax. gluster volume bitrot <vol name> scrub ondemand Change-Id: I84c28904367eed827a7dae8d6a535c14b28e9f4d BUG: 1366195 Signed-off-by: Kotresh HR <> Reviewed-on: Smoke: Gluster Build System <> NetBSD-regression: NetBSD Build System <> CentOS-regression: Gluster Build System <> Reviewed-by: Venky Shankar <>
Diffstat (limited to 'tests/bitrot')
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/bitrot/bug-1207627-bitrot-scrub-status.t b/tests/bitrot/bug-1207627-bitrot-scrub-status.t
index bca3919..a361986 100644
--- a/tests/bitrot/bug-1207627-bitrot-scrub-status.t
+++ b/tests/bitrot/bug-1207627-bitrot-scrub-status.t
@@ -12,7 +12,7 @@ TEST glusterd;
TEST pidof glusterd;
## Lets create and start the volume
-TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2}
+TEST $CLI volume create $V0 $H0:$B0/${V0}1
TEST $CLI volume start $V0
## Enable bitrot for volume $V0
@@ -26,11 +26,27 @@ TEST $CLI volume bitrot $V0 scrub-frequency hourly
## Setting scrubber throttle value lazy
TEST $CLI volume bitrot $V0 scrub-throttle lazy
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Active' scrub_status $V0 'State of scrub'
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'lazy' scrub_status $V0 'Scrub impact'
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'hourly' scrub_status $V0 'Scrub frequency'
EXPECT_WITHIN $PROCESS_UP_TIMEOUT '/var/log/glusterfs/bitd.log' scrub_status $V0 'Bitrot error log location'
EXPECT_WITHIN $PROCESS_UP_TIMEOUT '/var/log/glusterfs/scrub.log' scrub_status $V0 'Scrubber error log location'
+## Set expiry-timeout to 1 sec
+TEST $CLI volume set $V0 features.expiry-time 1
+##Mount $V0
+TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0
+#Create sample file
+TEST `echo "1234" > $M0/FILE1`
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'trusted.bit-rot.signature' check_for_xattr 'trusted.bit-rot.signature' "/$B0/${V0}1/FILE1"
+##Corrupt the file
+TEST `echo "corrupt" >> /$B0/${V0}1/FILE1`
+## Ondemand scrub
+TEST $CLI volume bitrot $V0 scrub ondemand
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'trusted.bit-rot.bad-file' check_for_xattr 'trusted.bit-rot.bad-file' "/$B0/${V0}1/FILE1"