summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-03-31 14:58:02 +0530
committerVijay Bellur <vbellur@redhat.com>2016-04-05 21:02:09 -0700
commit6bcae5cc8081697eca0ac72631e31327e1a786a9 (patch)
treef87d4e94877d24507012636e1841c541535bbc1d /tests
parent13f18e61e70218121991bd761ef37f17a89c7edb (diff)
glusterd: build realpath post recreate of brick mount for snapshot
Backport of http://review.gluster.org/#/c/13869 Commit a60c39d introduced a new field called real_path in brickinfo to hold the realpath() conversion. However at restore path for all snapshots and snapshot restored volumes the brickpath gets recreated post restoration of bricks which means the realpath () call will fail here for all the snapshots and cloned volumes. Fix is to store the realpath for snapshots and clones post recreating the brick mounts. For normal volume it would be done during retrieving the brick details from the store. Change-Id: Ia34853acddb28bcb7f0f70ca85fabcf73276ef13 BUG: 1324014 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/13869 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-on: http://review.gluster.org/13905 Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t34
1 files changed, 34 insertions, 0 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
new file mode 100644
index 00000000000..68dc0bbe0f7
--- /dev/null
+++ b/tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+. $(dirname $0)/../../volume.rc
+. $(dirname $0)/../../snapshot.rc
+. $(dirname $0)/../../include.rc
+cleanup;
+
+TEST verify_lvm_version
+TEST init_n_bricks 1
+TEST setup_lvm 1
+
+TEST glusterd
+TEST pidof glusterd
+
+TEST $CLI volume create $V0 $H0:$L1
+EXPECT 'Created' volinfo_field $V0 'Status'
+
+TEST $CLI volume start $V0
+EXPECT 'Started' volinfo_field $V0 'Status'
+
+TEST $CLI snapshot create ${V0}_snap $V0
+
+# 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}'`
+
+pkill gluster
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $L1
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $snap_brick
+rm -rf $snap_brick
+
+TEST glusterd
+TEST pidof glusterd