diff options
36 files changed, 1045 insertions, 13 deletions
diff --git a/dvm/2051/testcase b/dvm/2051/testcase new file mode 100755 index 0000000..f1071da --- /dev/null +++ b/dvm/2051/testcase @@ -0,0 +1,33 @@ +#!/bin/bash + +source $cwd/regression_helpers + +VOLNAME="vol$global_bug_id"; + +$GLUSTERFSDIR/gluster volume create $VOLNAME $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null; + +$GLUSTERFSDIR/gluster volume start $VOLNAME 2>/dev/null 1>/dev/null; +if [ $? -ne 0 ]; then + exit 22; +fi + +mount_nfs $VOLNAME 2>/dev/null 1>/dev/null; +if [ $? -ne 0 ]; then + exit 22; +fi + +sleep 10; + +df -h | grep $VOLNAME 2>/dev/null 1>/dev/null; +if [ $? -ne 0 ]; then + exit 22; +fi + +cp -r /etc/ $NFS_MOUNT; + +find $NFS_MOUNT | grep "find: File system loop detected" 2>/dev/null 1>/dev/null; +if [ $? -eq 0 ]; then + exit 22; +else + exit 0; +fi diff --git a/dvm/2059/testcase b/dvm/2059/testcase index 14b83e4..1dae3dd 100755 --- a/dvm/2059/testcase +++ b/dvm/2059/testcase @@ -10,13 +10,15 @@ $GLUSTERFSDIR/gluster volume start $VOLNAME 2>/dev/null 1>/dev/null; $GLUSTERFSDIR/glusterfs -s $(hostname) -p /tmp/client.pid -l /tmp/regr.log --volfile-id=$VOLNAME $FUSE_MOUNT; -FUSE_PID=`cat /tmp/client.pid` +sleep 5; -sleep 5 +FUSE_PID=`cat /tmp/client.pid`; -kill -USR1 $FUSE_PID +kill -USR1 $FUSE_PID &>/dev/null; -OUT=`grep 'xlator.mount.fuse.entry_timeout=1.000000' /tmp/glusterdump.$FUSE_PID | wc -l` +sleep 1; + +OUT=`grep "entry_timeout=1.000000" /tmp/glusterdump.$FUSE_PID.dump | wc -l` &>/dev/null; if [ "$OUT" -eq "0" ]; then RET="1"; @@ -24,5 +26,8 @@ else RET="0"; fi -rm -f /tmp/glusterdump.$FUSE_PID +rm -f /tmp/glusterdump.$FUSE_PID.dump &>/dev/null; +rm -f /tmp/client.pid &>/dev/null; +rm -f /tmp/regr.log &>/dev/null; + exit $RET; diff --git a/dvm/2095/testcase b/dvm/2095/testcase index 5fe7330..a6f2eac 100755 --- a/dvm/2095/testcase +++ b/dvm/2095/testcase @@ -21,7 +21,7 @@ function main () exit 22; fi - grep "option transport-type rdma" /etc/glusterd/vols/$global_bug_id/"$global_bug_id".rdma-fuse.vol 2>/dev/null 1>/dev/null; + grep "option transport-type rdma" /etc/glusterd/vols/$global_bug_id/"$global_bug_id"-fuse.vol 2>/dev/null 1>/dev/null; op_ret=$?; diff --git a/dvm/2483/testcase b/dvm/2483/testcase index a0a85d2..ccedbe8 100755 --- a/dvm/2483/testcase +++ b/dvm/2483/testcase @@ -5,7 +5,7 @@ source $cwd/regression_helpers VOLNAME="vol$global_bug_id" $GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null -$GLUSTERFSDIR/gluster volume create $VOLNAME replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/brick3 $(hostname):$EXPORT_DIR/$global_bug_id/brick4 2>/dev/null 1>/dev/null +$GLUSTERFSDIR/gluster volume create $VOLNAME replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/brick3 $(hostname):$EXPORT_DIR/$global_bug_id/brick4 --mode=script 2>/dev/null 1>/dev/null $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null $GLUSTERFSDIR/gluster volume start $VOLNAME 2>/dev/null 1>/dev/null diff --git a/dvm/2567/testcase b/dvm/2567/testcase index 3ab7262..54ba8c5 100755 --- a/dvm/2567/testcase +++ b/dvm/2567/testcase @@ -7,12 +7,16 @@ function _init () function self_heal () { - $GLUSTERFSDIR/gluster volume create $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null + $GLUSTERFSDIR/gluster --mode=script volume create $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + sleep 1; + mount_glusterfs $global_bug_id; + sleep 1; + for i in $(ls /etc/glusterd/vols/$global_bug_id/run) do pid=$(cat /etc/glusterd/vols/$global_bug_id/run/$i); diff --git a/dvm/2584/testcase b/dvm/2584/testcase index e3dc605..0a2b08e 100755 --- a/dvm/2584/testcase +++ b/dvm/2584/testcase @@ -2,7 +2,7 @@ source $cwd/regression_helpers -$GLUSTERFSDIR/gluster volume create $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 $(hostname):$EXPORT_DIR/$global_bug_id/brick3 $(hostname):$EXPORT_DIR/$global_bug_id/brick4 2>/dev/null 1>/dev/null; +$GLUSTERFSDIR/gluster volume create --mode=script $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 $(hostname):$EXPORT_DIR/$global_bug_id/brick3 $(hostname):$EXPORT_DIR/$global_bug_id/brick4 2>/dev/null 1>/dev/null; $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; diff --git a/dvm/2606/testcase b/dvm/2606/testcase new file mode 100755 index 0000000..46e548d --- /dev/null +++ b/dvm/2606/testcase @@ -0,0 +1,42 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/\ +$global_bug_id/brick 2>/dev/null 1>/dev/null; + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + +mount_glusterfs $global_bug_id 2>/dev/null 1>/dev/null; +sleep 2; + +for i in {1..100} +do + dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null; + dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null; +done + + +#First few lines of volume top open/read/write contains details like brick whose +#info is being displayed,and header for each column of the list. Volume top open +#in addition will have one line info about openfds. This means that every top +#open output will have 4 lines of details along with the actual list. For top +#read/write there will be 3 lines of details. For this reason we should grep out +#those lines containing details and take line count on the actual list. + + +temp1=`$GLUSTERFSDIR/gluster volume top $global_bug_id open | grep -v "Brick:\|\ +Current open fds:\|Count\|=" | wc -l` + +temp2=`$GLUSTERFSDIR/gluster volume top $global_bug_id read | grep -v "Brick:\|\ +Count\|=" |wc -l` + +temp3=`$GLUSTERFSDIR/gluster volume top $global_bug_id write | grep -v "Brick:\|\ +Count\|=" | wc -l` + + +if [ $temp1 -eq 100 ] && [ $temp3 -eq 100 ] && [ $temp2 -eq 100 ];then + exit 0; +else + exit 1; +fi diff --git a/dvm/2616/testcase b/dvm/2616/testcase new file mode 100755 index 0000000..a5f79b5 --- /dev/null +++ b/dvm/2616/testcase @@ -0,0 +1,17 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null; + +$GLUSTERFSDIR/gluster volume profile $global_bug_id start | grep "Starting volume profile on $global_bug_id has been successful" 2>/dev/null 1>/dev/null; +temp=$?; + +$GLUSTERFSDIR/gluster volume profile $global_bug_id stop | grep "Stopping volume profile on $global_bug_id has been successful" 2>/dev/null 1>/dev/null; +temp1=$?; + +if [ $temp -eq 0 ] && [ $temp1 -eq 0 ]; then + exit 0; +else + exit 1; +fi diff --git a/dvm/2628/testcase b/dvm/2628/testcase new file mode 100755 index 0000000..89e9abc --- /dev/null +++ b/dvm/2628/testcase @@ -0,0 +1,37 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create --mode=script $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null; + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + +mount_glusterfs $global_bug_id; +sleep 2; + +for i in {1..100} +do + dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null ; + dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null ; +done + +$GLUSTERFSDIR/gluster volume top $global_bug_id read-perf list-cnt fff | grep "list-cnt should be between 0 to 100" 2>/dev/null 1>/dev/null; +t1=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id read-perf bs abc list-cnt 0 | grep "block size should be an integer greater than zero" 2>/dev/null 1>/dev/null; +t2=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id read-perf bs 1024 count 1.5 list-cnt 0 | grep "count should be an integer greater than zero" 2>/dev/null 1>/dev/null; +t3=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 0 count 0 list-cnt 0 | grep "block size should be an integer greater than zero" 2>/dev/null 1>/dev/null; +t4=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf count fff list-cnt 0 | grep "count should be an integer greater than zero" 2>/dev/null 1>/dev/null; +t5=$?; + +if [ $t1 -eq 0 ] && [ $t2 -eq 0 ] && [ $t3 -eq 0 ] && [ $t4 -eq 0 ] && [ $t5 -eq 0 ]; then + exit 0; +else + exit 1; +fi diff --git a/dvm/2645/testcase b/dvm/2645/testcase new file mode 100755 index 0000000..9ac520b --- /dev/null +++ b/dvm/2645/testcase @@ -0,0 +1,42 @@ +#!/bin/bash + + +function create_data_on_mountpoint () +{ + for i in {1..100} + do + dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null; + dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null; + done +} + + +function check_volume_top_write_perf () +{ + $GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/null; + $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + sleep 2 + + #latency-measurement should be on for 'top write-perf' to capture throughput of files + $GLUSTERFSDIR/gluster volume set $global_bug_id latency-measurement on 2>/dev/null 1>/dev/null; + + mount_glusterfs $global_bug_id; + create_data_on_mountpoint; + + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024 count 100 2>/dev/null 1>/dev/null; + ret1=$? + + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 0 count 100 | grep "block size should be an integer greater than zero" 2>/dev/null 1>/dev/null; + ret2=$? + + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024 count 0 | grep "count should be an integer greater than zero" 2>/dev/null 1>/dev/null; + ret3=$? + + if [ $ret1 -eq 0 ] && [ $ret2 -eq 0 ] && [ $ret3 -eq 0 ]; then + return 0 + else + return 1 + fi +} + +source $cwd/regression_helpers; check_volume_top_write_perf diff --git a/dvm/2719/testcase b/dvm/2719/testcase new file mode 100755 index 0000000..fde2977 --- /dev/null +++ b/dvm/2719/testcase @@ -0,0 +1,7 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster help | grep "volume top" | grep "volume top operations" 2>/dev/null 1>/dev/null; + +exit $? diff --git a/dvm/2720/testcase b/dvm/2720/testcase new file mode 100755 index 0000000..a3a9e58 --- /dev/null +++ b/dvm/2720/testcase @@ -0,0 +1,41 @@ +#!/bin/bash + + +function create_data_on_mountpoint () +{ + for i in {1..100} + do + dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null; + dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null; + done +} + + +function check_glusterd_blockage () +{ + $GLUSTERFSDIR/gluster volume create $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 --mode=script 2>/dev/null 1>/dev/null; + $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + sleep 2 + + #'write/read perf' require latency-measurement to be on, in order to capture throughput of files + $GLUSTERFSDIR/gluster volume set $global_bug_id latency-measurement on 2>/dev/null 1>/dev/null; + + mount_glusterfs $global_bug_id + sleep 2 + create_data_on_mountpoint; + + $GLUSTERFSDIR/gluster volume top $global_bug_id read-perf bs 20480000000000 count 10000 brick $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/null; + ret1=$?; + + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 20480000000000 count 10000 brick $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null; + ret2=$?; + + if [ $ret1 -eq 0 ] && [ $ret2 -eq 0 ]; then + return 0 + else + return 1 + fi +} + + +source $cwd/regression_helpers; check_glusterd_blockage diff --git a/dvm/2722/testcase b/dvm/2722/testcase new file mode 100755 index 0000000..cbac158 --- /dev/null +++ b/dvm/2722/testcase @@ -0,0 +1,30 @@ +#!/bin/bash + + +function check_volume_top_messages () +{ + $GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/null; + $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + sleep 2; + + #'volume top successful' message should NOT be shown for all succeeded top operations. + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024000 count 100 | grep "volume top successful" 2>/dev/null 1>/dev/null; + ret1=$? + + #message 'no entries in the list' should NOT be displayed. + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024000 count 100 | grep "no entries in the list" 2>/dev/null 1>/dev/null; + ret2=$? + + #volume top on a non-existant brick should display the message 'volume top unsuccessful'. + $GLUSTERFSDIR/gluster volume top $global_bug_id write-perf bs 1024000 count 100 brick $(hostname):$EXPORT_DIR/$global_bug_id/brick11 | grep "volume top unsuccessful" 2>/dev/null 1>/dev/null; + ret3=$? + + if [ $ret1 -ne 0 ] && [ $ret2 -ne 0 ] && [ $ret3 -eq 0 ]; then + return 0 + else + return 1 + fi +} + + +source $cwd/regression_helpers; check_volume_top_messages diff --git a/dvm/2725/testcase b/dvm/2725/testcase new file mode 100755 index 0000000..596393d --- /dev/null +++ b/dvm/2725/testcase @@ -0,0 +1,40 @@ +#!/bin/bash + +function create_max_name_files () +{ + cd $FUSE_MOUNT; + for i in {1..10} + do + mkdir `perl -e "print 'a' x 255"` + cd `perl -e "print 'a' x 255"` + touch `perl -e "print 't' x 255"` + done +} + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null; + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + +sleep 2; + +mount_glusterfs $global_bug_id; +create_max_name_files; + +find $FUSE_MOUNT | xargs touch; + +$GLUSTERFSDIR/gluster volume top $global_bug_id open 2>/dev/null 1>/dev/null; +temp1=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id read 2>/dev/null 1>/dev/null; +temp2=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id write 2>/dev/null 1>/dev/null; +temp3=$?; + +if [ $temp1 -eq 0 ] && [ $temp2 -eq 0 ] && [ $temp3 -eq 0 ]; then + exit 0 +else + exit 1 +fi diff --git a/dvm/2771/testcase b/dvm/2771/testcase new file mode 100755 index 0000000..e67cb42 --- /dev/null +++ b/dvm/2771/testcase @@ -0,0 +1,28 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null; + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + +mount_glusterfs $global_bug_id; +sleep 2; + +for i in {1..10} +do + dd if=/dev/zero of=$FUSE_MOUNT/$i bs=128K count=100 2>/dev/null 1>/dev/null; + dd if=$FUSE_MOUNT/$i of=/dev/null bs=128K count=100 2>/dev/null 1>/dev/null; +done + +$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf list-cnt 10 bs 2048 brick $(hostname):$EXPORT_DIR/$global_bug_id/brick1 | grep "Usage: volume top" 2>/dev/null 1>/dev/null +temp1=$?; + +$GLUSTERFSDIR/gluster volume top $global_bug_id write-perf count 100 list-cnt 10 brick $(hostname):$EXPORT_DIR/$global_bug_id/brick2 | grep "Usage: volume top" 2>/dev/null 1>/dev/null +temp2=$?; + +if [ $temp1 -eq 0 ] && [ $temp2 -eq 0 ];then + exit 0; +else + exit 1; +fi diff --git a/dvm/3543/testcase b/dvm/3543/testcase new file mode 100755 index 0000000..7eaf202 --- /dev/null +++ b/dvm/3543/testcase @@ -0,0 +1,28 @@ +#!/usr/bin/python + +import subprocess +import re +import sys +import os + +def bug(gdir): + cmd = gdir+'/gluster volume set help' + cmd_obj= subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) + ret = cmd_obj.wait() + if ret: + return 1 + else: + return 0 + +def main(): + gdir = os.environ['GLUSTERFSDIR'] + return_status = bug(gdir) + if return_status: + #print 'unsuccess' + sys.exit(1) + else: + #print 'success' + sys.exit(0) + +if __name__ == '__main__': + main() diff --git a/dvm/3557/testcase b/dvm/3557/testcase new file mode 100755 index 0000000..423e71d --- /dev/null +++ b/dvm/3557/testcase @@ -0,0 +1,31 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function glustershd_no_gfid () +{ + $GLUSTERFSDIR/gluster volume create --mode=script $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null; + + touch $EXPORT_DIR/$global_bug_id/export1/{1..10}; + + $GLUSTERFSDIR/gluster volume start $global_bug_id &>/dev/null; + + ps aux | grep glusterfs | grep glustershd &>/dev/null; + + if [ $? -ne 0 ]; then + return 1; + fi + + $GLUSTERFSDIR/gluster volume heal $global_bug_id &>/dev/null; + + ps aux | grep glusterfs | grep glustershd &>/dev/null; + + if [ $? -ne 0 ]; then + return 1; + fi +} + +_init ; glustershd_no_gfid
\ No newline at end of file diff --git a/dvm/3666/testcase b/dvm/3666/testcase new file mode 100755 index 0000000..330c3a7 --- /dev/null +++ b/dvm/3666/testcase @@ -0,0 +1,31 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function glustershd_running () +{ + $GLUSTERFSDIR/gluster volume create $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 --mode=script 2>/dev/null 1>/dev/null + + $GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; + + ls /etc/glusterd/glustershd/run/glustershd.pid 2>/dev/null 1>/dev/null; + + if [ $? -ne 0 ]; then + return 2; + fi + + $GLUSTERFSDIR/gluster volume stop $global_bug_id --mode=script 2>/dev/null 1>/dev/null; + + ls /etc/glusterd/glustershd/run/glustershd.pid 2>/dev/null 1>/dev/null; + + if [ $? -ne 0 ]; then + return 0; + else + return 1; + fi +} + +_init ; glustershd_running diff --git a/dvm/3747/testcase b/dvm/3747/testcase new file mode 100755 index 0000000..12c2553 --- /dev/null +++ b/dvm/3747/testcase @@ -0,0 +1,46 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function backend_data () +{ + $GLUSTERFSDIR/gluster volume create --mode=script $global_bug_id replica 2 $(hostname):$EXPORT_DIR/$global_bug_id/export1\ + $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null; + + $GLUSTERFSDIR/gluster volume start $global_bug_id &>/dev/null; + + mount_glusterfs $global_bug_id; + + sleep 1; + + $GLUSTERFSDIR/gluster --mode=script volume stop $global_bug_id &>/dev/null; + + touch $EXPORT_DIR/$global_bug_id/export1/{1..10} ; + + $GLUSTERFSDIR/gluster volume start $global_bug_id &>/dev/null; + + sleep 2; + + find $FUSE_MOUNT | xargs stat &>/dev/null; + + $GLUSTERFSDIR/gluster --mode=script volume stop $global_bug_id &>/dev/null; + + rm -rf /$EXPORT_DIR/$global_bug_id/export{1,2}/*; + + touch $EXPORT_DIR/$global_bug_id/export1/{1..10} ; + + $GLUSTERFSDIR/gluster volume start $global_bug_id &>/dev/null; + + sleep 2; + + find $FUSE_MOUNT | xargs stat &>/dev/null; + + stat $FUSE_MOUNT &>/dev/null; + + return $?; +} + +_init ; backend_data
\ No newline at end of file diff --git a/dvm/764030/testcase b/dvm/764030/testcase new file mode 100755 index 0000000..6db9aca --- /dev/null +++ b/dvm/764030/testcase @@ -0,0 +1,15 @@ +#!/bin/bash + +source $cwd/regression_helpers + + +$GLUSTERFSDIR/gluster volume create $global_bug_id\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick1 \ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null + +$GLUSTERFSDIR/gluster --mode=script volume remove-brick $global_bug_id\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick1 \ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2 \ + | grep 'Deleting all the bricks of the volume is not allowed' 1>/dev/null + +exit $? diff --git a/dvm/764072/testcase b/dvm/764072/testcase new file mode 100755 index 0000000..3748820 --- /dev/null +++ b/dvm/764072/testcase @@ -0,0 +1,44 @@ +#!/bin/bash + +source $cwd/regression_helpers +mkdir -p /tmp/$global_bug_id &> /dev/null + +#create,start and mount +$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; +mount_glusterfs $global_bug_id; + +sleep 10; +#start gsyncd first +$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/$global_bug_id start &> /dev/null +if [ $? -ne 0 ]; then + exit 255; +fi + +sleep 10; + +ps aux | grep gsyncd.py | grep monitor &> /dev/null; +if [ $? -ne 0 ]; then + exit 255; +fi + +mkdir -p $FUSE_MOUNT/dir/dir{1..2}; +touch $FUSE_MOUNT/file{1..2}; + +sleep 5; + +ls -l $FUSE_MOUNT/* &> /dev/null; + +sleep 5; + +ps aux | grep gsyncd.py | grep monitor &> /dev/null; +if [ $? -ne 0 ]; then + $GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/$global_bug_id stop &> /dev/null + rm -rf /tmp/$global_bug_id &> /dev/null + exit 255; +else + $GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/$global_bug_id stop &> /dev/null + rm -rf /tmp/$global_bug_id &> /dev/null + exit 0; +fi diff --git a/dvm/764265/testcase b/dvm/764265/testcase new file mode 100755 index 0000000..952dd8f --- /dev/null +++ b/dvm/764265/testcase @@ -0,0 +1,27 @@ +#!/bin/bash +source $cwd/regression_helpers +mkdir -p /tmp/$global_bug_id &> /dev/null + +#create,start and mount +$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; +mount_glusterfs $global_bug_id + +#start gsyncd first +$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/$global_bug_id start &> /dev/null; + +sleep 10; + +#stop gsyncd +$GLUSTERFSDIR/gluster volume geo-replication $global_bug_id /tmp/$global_bug_id stop &> /dev/null; + +sleep 10; + +ps aux| grep gsyncd.py | grep monitor &> /dev/null +if [ $? -ne 0 ]; then + rm -rf /tmp/$global_bug_id &> /dev/null + exit 0; +else + rm -rf /tmp/$global_bug_id &> /dev/null + exit 255; +fi diff --git a/dvm/764548/testcase b/dvm/764548/testcase new file mode 100755 index 0000000..1c164d5 --- /dev/null +++ b/dvm/764548/testcase @@ -0,0 +1,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 diff --git a/dvm/764579/testcase b/dvm/764579/testcase new file mode 100755 index 0000000..70b15c1 --- /dev/null +++ b/dvm/764579/testcase @@ -0,0 +1,22 @@ +#!/bin/bash + +source $cwd/regression_helpers + +brick=`perl -e 'print "thisisbrickname"x40'` +longpath=`perl -e 'print "/reallylong/"x50'` + +mkdir -p $EXPORT_DIR/$global_bug_id/$longpath + +# This check is for NAME_MAX +name_status=$($GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/$brick\ + |grep 'too long'|wc -l ) + +# This check is for PATH_MAX +path_status=$($GLUSTERFSDIR/gluster volume create $global_bug_id \ + $(hostname):$EXPORT_DIR/$global_bug_id/$longpath/brick1|grep 'too long'|wc -l) + +if [ $name_status -ne 1 -o $path_status -ne 1 ]; then + exit 1 +else + exit 0 +fi diff --git a/dvm/764785/testcase b/dvm/764785/testcase index 513d5ba..513d5ba 100644..100755 --- a/dvm/764785/testcase +++ b/dvm/764785/testcase diff --git a/dvm/764797/testcase b/dvm/764797/testcase new file mode 100755 index 0000000..0e01a4a --- /dev/null +++ b/dvm/764797/testcase @@ -0,0 +1,20 @@ +#!/bin/bash -x + +source $cwd/regression_helpers + +VOLNAME=$global_bug_id +VOLNAME2=vol$global_bug_id + +$GLUSTERFSDIR/gluster volume create $VOLNAME $(hostname):$EXPORT_DIR/$global_bug_id/export1 \ + $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null + +$GLUSTERFSDIR/gluster volume start $VOLNAME 2>/dev/null 1>/dev/null +$GLUSTERFSDIR/gluster --mode=script volume stop $VOLNAME 2>/dev/null 1>/dev/null +$GLUSTERFSDIR/gluster --mode=script volume delete $VOLNAME 2>/dev/null 1>/dev/null + +$GLUSTERFSDIR/gluster volume create $VOLNAME2 $(hostname):$EXPORT_DIR/$global_bug_id/export1 \ + | grep 'has been part of a deleted volume with id' + + +exit $? + diff --git a/dvm/764802/testcase b/dvm/764802/testcase new file mode 100755 index 0000000..f0a344a --- /dev/null +++ b/dvm/764802/testcase @@ -0,0 +1,85 @@ +#!/bin/bash + +source $cwd/regression_helpers + +BRICK1=$(hostname):$EXPORT_DIR/$global_bug_id/brick1 +BRICK2=$(hostname):$EXPORT_DIR/$global_bug_id/brick2 + +$GLUSTERFSDIR/gluster volume create $global_bug_id $BRICK1 1>/dev/null 2>/dev/null + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null +sleep 5 + +mount_glusterfs $global_bug_id + +cd $FUSE_MOUNT + +for i in {1..10} +do + touch $i +done + + +# Capture the GFIDs of all the files +cd $EXPORT_DIR/$global_bug_id/brick1 + +for i in {1..10} +do + GFID_ARR[$i]=$(getfattr -d -e hex -n trusted.gfid -m . $i | grep trusted.gfid| cut -d "=" -f2) +done + +$GLUSTERFSDIR/gluster volume add-brick $global_bug_id $BRICK2 1>/dev/null 2>/dev/null +$GLUSTERFSDIR/gluster volume rebalance $global_bug_id start 1>/dev/null 2>/dev/null +sleep 2 + +status=0 +time_out=0 + +while [[ $status -ne 1 && $time_out -le 300 ]] +do + status=$($GLUSTERFSDIR/gluster volume rebalance $global_bug_id status| grep 'rebalance completed'|wc -l) + time_out=$(( $time_out + 1)) + sleep 1 +done + + +# for some reason rebalance is hung so we errout +# assuming 300 is fairly enough for rebalancing +# 10 files +if [ $time_out -gt 300 ]; then + exit 1 +fi + + +# now compare the GFIDs of all the files +# with the previously stored +for i in {1..10} +do + if [ -f "$EXPORT_DIR/$global_bug_id/brick1/$i" ] ; then + + GFID_ARR2[$i]=$(getfattr -d -e hex -n trusted.gfid -m . $EXPORT_DIR/$global_bug_id/brick1/$i 2>/dev/null\ + | grep trusted.gfid | cut -d "=" -f2) + + + if [ ${GFID_ARR[$i]} != ${GFID_ARR2[$i]} ]; then + exit 1 + fi + elif [ -f "$EXPORT_DIR/$global_bug_id/brick2/$i" ]; then + + GFID_ARR2[$i]=$(getfattr -d -e hex -n trusted.gfid -m . $EXPORT_DIR/$global_bug_id/brick2/$i 2>/dev/null\ + | grep trusted.gfid | cut -d "=" -f2) + + if [ ${GFID_ARR[$i]} != ${GFID_ARR2[$i]} ]; then + exit 1 + fi + else + echo "file not found" + exit 1 + fi +done + + +exit 0 + + + diff --git a/dvm/764829/testcase b/dvm/764829/testcase new file mode 100644 index 0000000..bf1d67f --- /dev/null +++ b/dvm/764829/testcase @@ -0,0 +1,27 @@ +#!/bin/bash +# Bug 764829 ".." entry in mount point missing + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/nul + + + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null +sleep 5 + +mount_glusterfs $global_bug_id +cd $FUSE_MOUNT + +# Check whether ".." entry exists + +ls -a | grep '\.\.' 1>/dev/null 2>/dev/null + +ret=$? + +if [ $ret -ne 0 ]; then + exit 1 +else + exit 0 +fi + 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 diff --git a/dvm/765293/testcase b/dvm/765293/testcase new file mode 100755 index 0000000..d1ccb5c --- /dev/null +++ b/dvm/765293/testcase @@ -0,0 +1,19 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/null +ret=$? + +if [ $ret -ne 0 ]; then + exit 1 +fi + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null +sleep 5 + +$GLUSTERFSDIR/gluster volume rebalance $global_bug_id start |tr '\n' ' ' \ +|grep 'Volume '"$global_bug_id"' is not a distribute volume + or contains only 1 brick. Not performing rebalance'2>/dev/null 1>/dev/null + +exit $? diff --git a/dvm/765307/testcase b/dvm/765307/testcase new file mode 100755 index 0000000..b00c04f --- /dev/null +++ b/dvm/765307/testcase @@ -0,0 +1,82 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null + +mount_glusterfs $global_bug_id + +cd $FUSE_MOUNT + +# Creating directory tree with depth 100 + +for i in {1..100} +do + mkdir $i + cd $i + touch $i +done + +# come back to topmost directory +cd $FUSE_MOUNT + +# replace a brick with force +$GLUSTERFSDIR/gluster volume replace-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick2 \ + $(hostname):$EXPORT_DIR/$global_bug_id/brick3 start 1>/dev/null 2>/dev/null + +time_out=0 +status=0 + +while [[ $status -ne 1 && $time_out -le 300 ]] +do + status=$($GLUSTERFSDIR/gluster volume replace-brick $global_bug_id\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick3 status | grep 'Migration complete'|wc -l) + + time_out=$(( $time_out + 1)) + sleep 1 +done + +if [ $time_out -gt 300 ]; then + exit 1 +fi + +$GLUSTERFSDIR/gluster volume replace-brick $global_bug_id\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick3 commit\ + |grep 'replace-brick commit successful' 1>/dev/null 2>/dev/null + +ret=$? +if [ $ret -ne 0 ]; then + exit 1 +fi + +# unmount and mount +# to see the files immediately on the mount point +# otherwise some of the files shown as not present +# on the replaced brick + +cd / +umount -f $FUSE_MOUNT +sleep 5 +mount_glusterfs $global_bug_id +sleep 5 +cd $FUSE_MOUNT + +# now check the directories in all levels are preserved +for i in {1..100} +do + if [ ! -d "$i" ]; then + exit 1 + else + cd $i + if [ ! -f "$i" ]; then + exit 1 + fi + fi +done + +exit 0 diff --git a/dvm/765362/testcase b/dvm/765362/testcase new file mode 100755 index 0000000..0dd0f67 --- /dev/null +++ b/dvm/765362/testcase @@ -0,0 +1,24 @@ +#!/bin/bash + +# Bug 765362- Add brick fails for pure distribute volumes + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1 2>/dev/null 1>/dev/null + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null +sleep 5 + +# Add another brick to the volume +$GLUSTERFSDIR/gluster volume add-brick $global_bug_id \ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2 | grep 'Add Brick successful' 1>/dev/null 2>/dev/null + +ret=$? + +if [ $ret -ne 0 ]; then + exit 1 +else + exit 0 +fi + + diff --git a/dvm/765453/testcase b/dvm/765453/testcase new file mode 100755 index 0000000..3a9792c --- /dev/null +++ b/dvm/765453/testcase @@ -0,0 +1,76 @@ +#!/bin/bash + +source $cwd/regression_helpers + + + +ATTR=trusted.glusterfs.testattr +VAL="thisistestattrib" +START="start" +STATUS="status" + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick1\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick2 2>/dev/null 1>/dev/null + +ret=$? + +if [ $ret -ne 0 ]; then + exit 1 +fi + + +$GLUSTERFSDIR/gluster volume start $global_bug_id 2>/dev/null 1>/dev/null; +sleep 5; + +ret=$? +if [ $ret -ne 0 ]; then + exit 1 +fi + + + +mount_glusterfs $global_bug_id; + +for i in {1..10} +do + touch $FUSE_MOUNT/$i + setfattr -n $ATTR -v $VAL $FUSE_MOUNT/$i 2>/dev/null 1>/dev/null +done + +#add a new brick to the volume +$GLUSTERFSDIR/gluster volume add-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/brick3\ + $(hostname):$EXPORT_DIR/$global_bug_id/brick4 2>/dev/null 1>/dev/null + +#Initiate rebalance + +$GLUSTERFSDIR/gluster volume rebalance $global_bug_id $START 2>/dev/null 1>/dev/null + +status=0 + +time_out=0 +while [[ $status -ne 1 && $time_out -le 300 ]] +do + status=$($GLUSTERFSDIR/gluster volume rebalance $global_bug_id status| grep 'rebalance completed'|wc -l); + time_out=$(( $time_out + 1)) + sleep 1; +done + +# for some reason rebalance is hung so we errout +# assuming 300 is fairly enough for rebalancing +# 10 files +if [ $time_out -gt 300 ]; then + exit 1 +fi + +#check whether xattrs are preserved after rebalance + +for i in {1..10} +do + getfattr -d -e text -n $ATTR -m . $FUSE_MOUNT/$i 2>/dev/null | grep "$VAL" 2>/dev/null 1>/dev/null + ret=$? + if [ $ret -ne 0 ]; then + exit 1 + fi +done + +exit 0 diff --git a/dvm/765590/testcase b/dvm/765590/testcase new file mode 100755 index 0000000..8d56203 --- /dev/null +++ b/dvm/765590/testcase @@ -0,0 +1,20 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function glusterd_stripe_add () +{ + $GLUSTERFSDIR/gluster volume create --mode=script $global_bug_id stripe 2 $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 &>/dev/null; + + $GLUSTERFSDIR/gluster volume add-brick $global_bug_id stripe 3 $(hostname):$EXPORT_DIR/$global_bug_id/export3 &>/dev/null; + + pgrep glusterd &>/dev/null; + if [ $? -ne 0 ]; then + return 1; + fi +} + +_init ; glusterd_stripe_add
\ No newline at end of file diff --git a/dvm/2042/testcase b/legacy/2042/testcase index 8f08c78..8f08c78 100755 --- a/dvm/2042/testcase +++ b/legacy/2042/testcase diff --git a/regression_helpers b/regression_helpers index 6cad82f..3873c86 100644 --- a/regression_helpers +++ b/regression_helpers @@ -80,7 +80,12 @@ start_glusterd () mount_glusterfs () { - local volname=$1; + if [ $# -lt 1 ]; then + echo "Volume name missing. Please provide gluster volume name to 'mount_glusterfs'" + exit 1 + else + local volname=$1; + fi $GLUSTERFSDIR/glusterfs --volfile-server=$(hostname) --volfile-id=$volname $FUSE_MOUNT; sleep 5; @@ -88,7 +93,12 @@ mount_glusterfs () mount_glusterfs_with_acl () { - local volname=$1; + if [ $# -lt 1 ]; then + echo "Volume name missing. Please provide gluster volume name to 'mount_glusterfs_with_acl'" + exit 1 + else + local volname=$1; + fi $GLUSTERFSDIR/glusterfs --acl --volfile-server=$(hostname) --volfile-id=$volname $FUSE_MOUNT; sleep 5; @@ -97,10 +107,16 @@ mount_glusterfs_with_acl () mount_nfs () { - local volname=$1; + if [ $# -lt 1 ]; then + echo "Volume name missing. Please provide gluster volume name to 'mount_nfs'" + exit 1 + else + local volname=$1; + fi + opts="-t nfs -o nolock,vers=3"; + mount $opts $(hostname):$volname $NFS_MOUNT; sleep 5; - mount $(hostname):$volname $NFS_MOUNT; } run_testcase () |