From 9f049094fcce37aff4e8cc45317b0d8dfc3e1560 Mon Sep 17 00:00:00 2001 From: Rahul C S Date: Tue, 10 Jan 2012 13:24:41 +0530 Subject: Check if geo-rep log-rotate works fine Change-Id: I854a531f49c631d0f89c292010108fc979e7e48c BUG: 765251 Signed-off-by: Rahul C S --- dvm/765251/testcase | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 dvm/765251/testcase (limited to 'dvm/765251/testcase') 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 -- cgit