From 76d72094cf86764a17fbd1f8a668e203c64e4144 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 7 Sep 2011 14:39:38 +0530 Subject: more testcases (2095, 2287, 2298, 2567, 2803) and some small changes to the framework --- dvm/2095/testcase | 31 ++++++++++++++++++++++++++++ dvm/2287/testcase | 26 ++++++++++++++++++++++++ dvm/2298/testcase | 27 +++++++++++++++++++++++++ dvm/2567/testcase | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ dvm/2803/testcase | 11 ++++++++++ 5 files changed, 155 insertions(+) create mode 100755 dvm/2095/testcase create mode 100755 dvm/2287/testcase create mode 100755 dvm/2298/testcase create mode 100755 dvm/2567/testcase create mode 100755 dvm/2803/testcase (limited to 'dvm') diff --git a/dvm/2095/testcase b/dvm/2095/testcase new file mode 100755 index 0000000..a6f2eac --- /dev/null +++ b/dvm/2095/testcase @@ -0,0 +1,31 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function create_rdma_volume () +{ + $GLUSTERFSDIR/gluster volume create $global_bug_id transport rdma $(hostname):$EXPORT_DIR/$global_bug_id/export 2>/dev/null 1>/dev/null + ret=$?; + return $ret; +} + +function main () +{ + create_rdma_volume; + op_ret=$?; + + if [ $op_ret -ne 0 ]; then + exit 22; + fi + + grep "option transport-type rdma" /etc/glusterd/vols/$global_bug_id/"$global_bug_id"-fuse.vol 2>/dev/null 1>/dev/null; + + op_ret=$?; + + exit $op_ret; +} + +_init && main "$@" diff --git a/dvm/2287/testcase b/dvm/2287/testcase new file mode 100755 index 0000000..065d99b --- /dev/null +++ b/dvm/2287/testcase @@ -0,0 +1,26 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers +} + +function absent_volinfo () +{ + $GLUSTERFSDIR/gluster volume info new_volume 2>/dev/null 1>/dev/null; + ret=$?; + return $ret; +} + +function main () +{ + absent_volinfo; + op_ret=$?; + if [ $op_ret -ne 0 ]; then + exit 0; + else + exit 1; + fi +} + +_init && main "$@" diff --git a/dvm/2298/testcase b/dvm/2298/testcase new file mode 100755 index 0000000..090e006 --- /dev/null +++ b/dvm/2298/testcase @@ -0,0 +1,27 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers; +} + +function remove_brick () +{ + $GLUSTERFSDIR/gluster volume create $global_bug_id $(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 remove-brick $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export2 2>/dev/null 1>/dev/null; + + $GLUSTERFSDIR/gluster volume info | grep "export1" 2>/dev/null 1>/dev/null; + + ret=$?; + return $ret; +} + +function main () +{ + remove_brick; + op_ret=$?; + exit $op_ret; +} + +_init && main "$@" diff --git a/dvm/2567/testcase b/dvm/2567/testcase new file mode 100755 index 0000000..3ab7262 --- /dev/null +++ b/dvm/2567/testcase @@ -0,0 +1,60 @@ +#!/bin/bash + +function _init () +{ + source $cwd/regression_helpers +} + +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 volume start $global_bug_id 2>/dev/null 1>/dev/null; + + mount_glusterfs $global_bug_id; + + for i in $(ls /etc/glusterd/vols/$global_bug_id/run) + do + pid=$(cat /etc/glusterd/vols/$global_bug_id/run/$i); + kill -KILL $pid; + break; + done + + sleep 1; + + mknod $FUSE_MOUNT/file c 2 2; + + $GLUSTERFSDIR/gluster volume start $global_bug_id force 2>/dev/null 1>/dev/null; + sleep 3; + df -h 2>/dev/null 1>/dev/null + + ls -l $FUSE_MOUNT/file 2>/dev/null 1>/dev/null; + stat $FUSE_MOUNT/file 2>/dev/null 1>/dev/null; + + sleep 2; +} + +function main () +{ + self_heal; + + hex_major1=$(stat --printf=%t $EXPORT_DIR/$global_bug_id/export1/file); + hex_minor1=$(stat --printf=%t $EXPORT_DIR/$global_bug_id/export1/file); + + hex_major2=$(stat --printf=%t $EXPORT_DIR/$global_bug_id/export2/file); + hex_minor2=$(stat --printf=%t $EXPORT_DIR/$global_bug_id/export2/file); + + dec_major1=$(printf "%d" 0x$hex_major1); + dec_minor1=$(printf "%d" 0x$hex_minor1); + + dec_major2=$(printf "%d" 0x$hex_major2); + dec_minor2=$(printf "%d" 0x$hex_minor2); + + if [ $dec_major1 -ne $dec_major2 ] || [ $dec_minor1 -ne $dec_minor2 ]; then + exit 1; + else + exit 0; + fi +} + +_init && main "$@" diff --git a/dvm/2803/testcase b/dvm/2803/testcase new file mode 100755 index 0000000..b2b6fbd --- /dev/null +++ b/dvm/2803/testcase @@ -0,0 +1,11 @@ +#!/bin/bash + +source $cwd/regression_helpers + +$GLUSTERFSDIR/gluster volume create $global_bug_id $(hostname):$EXPORT_DIR/$global_bug_id/export1 $(hostname):$EXPORT_DIR/$global_bug_id/export1/export2 2>/dev/null 1>/dev/null; + +if [ $? -eq 0 ]; then + exit 1; +else + exit 0; +fi -- cgit