From 55161435db59d7f8ab1fa14395139c511f3fdea1 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 7 Sep 2011 15:34:21 +0530 Subject: regression testcases for the bugs 2042 and 2503 --- dvm/2042/testcase | 37 +++++++++++++++++++++++++++++++++++++ dvm/2503/testcase | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100755 dvm/2042/testcase create mode 100755 dvm/2503/testcase diff --git a/dvm/2042/testcase b/dvm/2042/testcase new file mode 100755 index 0000000..8f08c78 --- /dev/null +++ b/dvm/2042/testcase @@ -0,0 +1,37 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function add_and_log () +{ + mkdir /tmp/logs_path; + + $GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export 2>/dev/null 1>/dev/null; + + #set the log file path for the volume + $GLUSTERFSDIR/gluster volume log filename $global_bug_id /tmp/logs_path 2>/dev/null 1>/dev/null; + $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + $GLUSTERFSDIR/gluster volume add-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null; + + #set the log file path for the newly added brick + $GLUSTERFSDIR/gluster volume log filename $global_bug_id $(hostname):$EXPOR_DIR/$global_bug_id/export2 /tmp/logs_path 2>/dev/null 1>/dev/null; + + ls /tmp/logs_path | grep "export2" 2>/dev/null 1>/dev/null; + ret=$?; + + rm -rf /tmp/logs_path 2>/dev/null 1>/dev/null; + return $ret; +} + +function main () +{ + add_and_log; + + op_ret=$?; + exit $op_ret; +} + +_init && main "$@" diff --git a/dvm/2503/testcase b/dvm/2503/testcase new file mode 100755 index 0000000..c6e6deb --- /dev/null +++ b/dvm/2503/testcase @@ -0,0 +1,40 @@ +#!/bin/bash + +source $cwd/regression_helpers + +mkdir -p /tmp/$global_bug_id +#create,start and mount +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 &>/dev/null ; + +$GLUSTERFSDIR/gluster volume start $global_bug_id &>/dev/null; +mount_glusterfs $global_bug_id + +mkdir $FUSE_MOUNT/dir +for i in {1..10};do + touch $FUSE_MOUNT/dir/$i.txt +done + +sleep 2; + +$GLUSTERFSDIR/gluster volume add-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null +sleep 2; +$GLUSTERFSDIR/gluster volume rebalance $global_bug_id start &> /dev/null +sleep 10; +rm -rf $FUSE_MOUNT/dir/* +sleep 2; +$GLUSTERFSDIR/gluster --mode=script volume remove-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null +sleep 10; + +for i in {1..10}; do + touch $FUSE_MOUNT/dir/$i.txt +done +if [ `ls $FUSE_MOUNT/dir | wc -l` -eq 10 ]; then + rm -rf $FUSE_MOUNT/dir/*; + if [ $? -eq 0 ]; then + exit 0; + else + exit 127; + fi +else + exit 127; +fi -- cgit