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

source $cwd/regression_helpers;
mkdir -p /tmp/file$global_bug_id &> /dev/null;

function assert ()
{
    if [ $1 -ne 0 ]; then
        rm -rf /tmp/file$global_bug_id &> /dev/null;
        exit 255;
    fi
}
#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;

#start gsyncd
$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/file$global_bug_id start &> /dev/null;
assert $?;

sleep 10;
ps aux|grep gsyncd.py | grep monitor &> /dev/null;
assert $?;

val=`$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/file$global_bug_id config | grep "^log_file" | cut -f2 -d' '` &> /dev/null;
sleep 5;

$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/file$global_bug_id log-rotate &> /dev/null;
assert $?;

sleep 5;

ret=`ls -l $val* | wc -l`
$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/file$global_bug_id stop &> /dev/null;
rm -rf /tmp/file$global_bug_id &> /dev/null;
rm -rf $val*

if [ $ret -ne 2 ]; then
    exit 255;
else
    exit 0;
fi