summaryrefslogtreecommitdiffstats
path: root/tests/bugs/snapshot/bug-1322772-real-path-fix-for-snapshot.t
blob: bf625eca89b141c8a7fec3b5a8c9e52fc43a94c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../snapshot.rc
. $(dirname $0)/../../include.rc
cleanup;

TESTS_EXPECTED_IN_LOOP=2

TEST verify_lvm_version
TEST init_n_bricks 2
TEST setup_lvm 2

TEST glusterd
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 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_bricks=`gluster snap status | grep "Brick Path" | awk -F ":"  '{print $3}'`

TEST $CLI volume stop $V1
TEST $CLI snapshot restore ${V1}_snap;

pkill gluster
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