summaryrefslogtreecommitdiffstats
path: root/dvm/764548/testcase
blob: 1c164d52b6f4006118d58294d2c5924c6c2790cb (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
#!/bin/bash

source $cwd/regression_helpers;

#create, start volume
$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null;

$GLUSTERFSDIR/gluster volume start $global_bug_id &> /dev/null;

sleep 10;

$GLUSTERFSDIR/gluster volume create backup $(hostname):$EXPORT_DIR/$global_bug_id/export_bak  &>/dev/null;

$GLUSTERFSDIR/gluster volume start backup &> /dev/null;

#start gsyncd
$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id :backup start &> /dev/null;
if [ $? -ne 0 ]; then
    exit 255;
fi

sleep 10;
ps aux|grep gsyncd.py | grep monitor | grep backup &> /dev/null;
if [ $? -ne 0 ]; then
    exit 255;
fi

#stop master & create, start new master volume
$GLUSTERFSDIR/gluster --mode=script volume stop $global_bug_id &> /dev/null;

$GLUSTERFSDIR/gluster volume create newmaster $(hostname):$EXPORT_DIR/$global_bug_id/export4 $(hostname):$EXPORT_DIR/$global_bug_id/export5 &>/dev/null;

$GLUSTERFSDIR/gluster volume start newmaster &> /dev/null;

sleep 10;

$GLUSTERFSDIR/gluster volume geo-replication newmaster :backup start &> /dev/null;
if [ $? -ne 0 ]; then
    exit 255;
fi

sleep 10;
ps aux|grep gsyncd.py | grep monitor | grep newmaster &> /dev/null;
if [ $? -ne 0 ]; then
    exit 255;
else
    exit 0;
fi