summaryrefslogtreecommitdiffstats
path: root/tests/bugs/bug-861015-index.t
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-01-22 14:48:38 +0530
committerAnand Avati <avati@redhat.com>2013-01-22 19:44:17 -0800
commitf935c12c50691af3196b3525206ad2df4de91cb8 (patch)
tree9eee74a503b28d4e859ae432b43fbd921ea4b6d8 /tests/bugs/bug-861015-index.t
parent2c65cdfd6484dc073241c46de041da2ab380bc09 (diff)
Tests: Check that stale indices are removed on heal-info
Change-Id: I1f652d0343053fb87e4979de8b94ba09b3f292f8 BUG: 861015 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4409 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'tests/bugs/bug-861015-index.t')
-rw-r--r--tests/bugs/bug-861015-index.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/bugs/bug-861015-index.t b/tests/bugs/bug-861015-index.t
new file mode 100644
index 00000000000..15758badf40
--- /dev/null
+++ b/tests/bugs/bug-861015-index.t
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1,2,3,4,5}
+TEST $CLI volume start $V0
+EXPECT_WITHIN 20 "Y" glustershd_up_status
+TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
+TEST kill_brick $V0 $H0 $B0/${V0}0
+TEST kill_brick $V0 $H0 $B0/${V0}2
+TEST kill_brick $V0 $H0 $B0/${V0}4
+cd $M0
+HEAL_FILES=0
+for i in {1..10}
+do
+ echo "abc" > $i
+ HEAL_FILES=$(($HEAL_FILES+1))
+done
+HEAL_FILES=$(($HEAL_FILES+3)) #count brick root distribute-subvol num of times
+
+cd ~
+EXPECT "$HEAL_FILES" afr_get_pending_heal_count $V0
+TEST rm -f $M0/*
+TEST umount $M0
+TEST $CLI volume heal $V0 info
+#Only root dir should be present now in the indices
+EXPECT "1" afr_get_num_indices_in_brick $B0/${V0}1
+EXPECT "1" afr_get_num_indices_in_brick $B0/${V0}3
+EXPECT "1" afr_get_num_indices_in_brick $B0/${V0}5
+cleanup