diff options
author | Rahul C S <rahulcs@redhat.com> | 2012-01-10 13:24:41 +0530 |
---|---|---|
committer | Rahul C S <rahulcs@redhat.com> | 2012-01-10 16:35:37 +0530 |
commit | 9f049094fcce37aff4e8cc45317b0d8dfc3e1560 (patch) | |
tree | bd53504c8263f3562ae9d0293f6640cd4df5dd3c | |
parent | 7ae87eb9158bbd29af6beb561616b2ce75a85cd2 (diff) |
Check if geo-rep log-rotate works fine
Change-Id: I854a531f49c631d0f89c292010108fc979e7e48c
BUG: 765251
Signed-off-by: Rahul C S <rahulcs@redhat.com>
-rwxr-xr-x | dvm/765251/testcase | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dvm/765251/testcase b/dvm/765251/testcase new file mode 100755 index 0000000..dafedf2 --- /dev/null +++ b/dvm/765251/testcase @@ -0,0 +1,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 |