summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-04-12 09:43:13 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-06-02 01:42:10 -0700
commit8697bc0b5e59fff3330e6cacc3693b3ca6459d04 (patch)
treec1173ea08c6f65ae439cf7bab52103dac9d2f8a5
parent3bd5c5858fd3df42374934ac8251a8620e6b62b9 (diff)
tests: fix regression failure from bug-1322772-real-path-fix-for-snapshot.t
Backport of http://review.gluster.org/#/c/13974 There is no need to unmount the brick as doing so we loose all the xattrs on the brick and while restarting glusterd brick doesn't come up Change-Id: Ic1fa8b72f6cfcad564c62bcef1d022b083263ecc Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/13974 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/14108 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r--tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t33
1 files changed, 27 insertions, 6 deletions
diff --git a/tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t b/tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t
index 68dc0bbe0f7..bf625eca89b 100644
--- a/tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t
+++ b/tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t
@@ -5,9 +5,11 @@
. $(dirname $0)/../../include.rc
cleanup;
+TESTS_EXPECTED_IN_LOOP=2
+
TEST verify_lvm_version
-TEST init_n_bricks 1
-TEST setup_lvm 1
+TEST init_n_bricks 2
+TEST setup_lvm 2
TEST glusterd
TEST pidof glusterd
@@ -15,20 +17,39 @@ TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$L1
EXPECT 'Created' volinfo_field $V0 'Status'
+TEST $CLI volume create $V1 $H0:$L2
+EXPECT 'Created' volinfo_field $V1 'Status'
+
TEST $CLI volume start $V0
EXPECT 'Started' volinfo_field $V0 'Status'
-TEST $CLI snapshot create ${V0}_snap $V0
+TEST $CLI volume start $V1
+EXPECT 'Started' volinfo_field $V1 'Status'
+
+TEST $CLI snapshot create ${V0}_snap $V0 no-timestamp
+TEST $CLI snapshot create ${V1}_snap $V1 no-timestamp
# Simulate a node reboot by unmounting the brick, snap_brick and followed by
# deleting the brick. Now once glusterd restarts, it should be able to construct
# and remount the snap brick
-snap_brick=`gluster snap status | grep "Brick Path" | awk -F ":" '{print $3}'`
+snap_bricks=`gluster snap status | grep "Brick Path" | awk -F ":" '{print $3}'`
+
+TEST $CLI volume stop $V1
+TEST $CLI snapshot restore ${V1}_snap;
pkill gluster
-EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $L1
-EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $snap_brick
+for snap_brick in $snap_bricks
+do
+ echo "Unmounting snap brick" $snap_brick
+ EXPECT_WITHIN_TEST_IN_LOOP $UMOUNT_TIMEOUT "Y" force_umount $snap_brick
+done
+
rm -rf $snap_brick
TEST glusterd
TEST pidof glusterd
+
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $L1
+
+cleanup
+