/tests/basic/tier/

n ENV_RC=$(dirname $0)/../../env.rc if [ ! -f $ENV_RC ]; then ENV_RC=$(dirname $0)/../../../env.rc fi fi if [ ! -f $ENV_RC ]; then echo "Aborting." | tee /dev/stderr echo | tee /dev/stderr echo "env.rc not found" | tee /dev/stderr echo | tee /dev/stderr echo "Please correct the problem and try again." | tee /dev/stderr echo | tee /dev/stderr exit 1 fi . $ENV_RC H0=${H0:=`hostname`}; # hostname MOUNT_TYPE_FUSE="fuse.glusterfs" GREP_MOUNT_OPT_RO="grep (ro" GREP_MOUNT_OPT_RW="grep (rw" PATH=$PATH:${PWD}/tests/utils case $OSTYPE in Linux) H0=${H0:=`hostname --fqdn`}; # hostname ;; NetBSD) MOUNT_TYPE_FUSE="puffs|perfuse|fuse.glusterfs" GREP_MOUNT_OPT_RO="grep (read-only" GREP_MOUNT_OPT_RW="grep -v (read-only" ;; *) ;; esac DEBUG=${DEBUG:=0} # turn on debugging? PROCESS_UP_TIMEOUT=20 NFS_EXPORT_TIMEOUT=20 CHILD_UP_TIMEOUT=20 PROBE_TIMEOUT=60 REBALANCE_TIMEOUT=360 REOPEN_TIMEOUT=20 HEAL_TIMEOUT=80 MARKER_UPDATE_TIMEOUT=20 JANITOR_TIMEOUT=60 UMOUNT_TIMEOUT=5 CONFIG_UPDATE_TIMEOUT=5 AUTH_REFRESH_INTERVAL=10 statedumpdir=`gluster --print-statedumpdir`; # Default directory for statedump CLI="gluster --mode=script --wignore"; GFS="glusterfs --attribute-timeout=0 --entry-timeout=0"; mkdir -p $WORKDIRS case $OSTYPE in FreeBSD | Darwin) wc () { if test "x$1" = "x-l"; then awk '{ lines++ } END {print lines}' fi if test "x$1" = "x-w"; then awk '{ words += NF } END {print words}' } fi if test "x$1" = "x-c"; then awk '{ chars += length($0) + 1 } END {print chars}' fi if test "x$1" = "x-m"; then awk '{ chars += length($0) + 1 } END {print chars}' fi } ;; NetBSD) wc() { /usr/bin/wc $@ | sed 's/^ *\([0-9]*\).*$/\1/g' } ;; esac testcnt=`egrep '^[[:space:]]*(EXPECT|EXPECT_NOT|TEST|EXPECT_WITHIN|EXPECT_KEYWORD)[[:space:]]' $0 | wc -l` expect_tests=`egrep '^[[:space:]]*TESTS_EXPECTED_IN_LOOP[[:space:]]*' $0` x_ifs=$IFS IFS=$'\n' for line in $expect_tests; do expect_tests=`echo $line | cut -f 2 -d =` testcnt=`expr $testcnt + $expect_tests` done IFS=$x_ifs echo "1..`echo $testcnt`" t=1 function dbg() { [ "x$DEBUG" = "x0" ] || echo "$*" >&2; } function test_header() { dbg "========================="; dbg "TEST $t (line $TESTLINE): $*"; saved_cmd="$*" } function test_footer() { RET=$? local err=$1 if [ $RET -eq 0 ]; then echo "ok $t"; else echo "not ok $t $err"; # With DEBUG, this was already printed out, so skip it. if [ x"$DEBUG" = x"0" ]; then echo "FAILED COMMAND: $saved_cmd" fi if [ "$EXIT_EARLY" = "1" ]; then exit $RET fi fi dbg "RESULT $t: $RET"; t=`expr $t + 1`; } function test_expect_footer() { local e=$1 local a=$2