diff options
Diffstat (limited to 'kernel/filesystems/nfs')
-rw-r--r-- | kernel/filesystems/nfs/connectathon/434966lock.patch | 52 | ||||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/Makefile | 87 | ||||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/PURPOSE | 22 | ||||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/a.tar | bin | 0 -> 174080 bytes | |||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/filter_nroff_warnings.patch | 25 | ||||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/hostnamefix.patch | 37 | ||||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/nfstests.tar.gz | bin | 0 -> 90309 bytes | |||
-rw-r--r-- | kernel/filesystems/nfs/connectathon/patch | 163 | ||||
-rwxr-xr-x | kernel/filesystems/nfs/connectathon/runtest.sh | 278 |
9 files changed, 664 insertions, 0 deletions
diff --git a/kernel/filesystems/nfs/connectathon/434966lock.patch b/kernel/filesystems/nfs/connectathon/434966lock.patch new file mode 100644 index 0000000..3374879 --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/434966lock.patch @@ -0,0 +1,52 @@ +--- cthon04/lock/tlock.c.orig ++++ cthon04/lock/tlock.c +@@ -1399,7 +1399,6 @@ test12() + childfree(0); + + parentwait(); +- (void) lseek(testfd, (off_t)0, 0); + if (read(pidpipe[0], &target, sizeof (target)) != + sizeof (target)) { + perror("can't read pid to kill"); +@@ -1407,7 +1406,7 @@ test12() + } + kill(target, SIGINT); + comment("Killed child process."); +- sleep(wait_time); ++ parentwait(); + test(12, 1, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL); + childfree(0); + close_testfile(DO_UNLINK); +@@ -1437,14 +1436,8 @@ test12() + */ + if (subchild > 0) { + /* original child */ +- sleep(wait_time); +- (void) lseek(testfd, (off_t)0, 0); +- if (write(pidpipe[1], &subchild, sizeof (subchild)) != +- sizeof (subchild)) { +- perror("can't record pid to kill"); +- kill(subchild, SIGINT); +- testexit(1); +- } ++ parentfree(0); ++ wait((int *)0); + parentfree(0); + childwait(); + close_testfile(DO_UNLINK); +@@ -1452,8 +1445,14 @@ test12() + /* subchild */ + signal(SIGINT, SIG_DFL); + test(12, 0, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL); ++ subchild = getpid(); ++ if (write(pidpipe[1], &subchild, sizeof (subchild)) != ++ sizeof (subchild)) { ++ perror("can't record pid to kill"); ++ testexit(1); ++ } + for (;;) +- sleep(1); ++ pause(); + /* NOTREACHED */ + } + } diff --git a/kernel/filesystems/nfs/connectathon/Makefile b/kernel/filesystems/nfs/connectathon/Makefile new file mode 100644 index 0000000..5255ec7 --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/Makefile @@ -0,0 +1,87 @@ +# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Author: Bill Peck <bpeck@redhat.com> + +# The name of the package under test +PACKAGE_NAME=kernel + +# The toplevel namespace within which the test lives. +TOPLEVEL_NAMESPACE=/$(PACKAGE_NAME) + +# The path of the test below the package +RELATIVE_PATH=filesystems/nfs/connectathon + +# The relative path name to the test +export TEST=$(TOPLEVEL_NAMESPACE)/$(RELATIVE_PATH) + +# The redhat rpm test package version +export TESTVERSION=3.0 + +FILES= $(METADATA) \ + runtest.sh \ + nfstests.tar.gz \ + patch \ + 434966lock.patch \ + Makefile \ + hostnamefix.patch \ + filter_nroff_warnings.patch + +dopatch: + (cd cthon04; cat ../patch | patch -p1) + patch -p0<434966lock.patch + patch -p0<hostnamefix.patch + patch -p1<filter_nroff_warnings.patch + +unpack: + tar -zxvf ./nfstests.tar.gz + +build: unpack dopatch + (cd cthon04; make) + +clean: + rm -f *~ $(METADATA) + rm -f rh-tests-kernel-filesystems-nfs-connectathon* + +run: build + chmod a+x ./runtest.sh + ./runtest.sh + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): + @touch $(METADATA) + @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Connectathon Testsuite\ + to test NFS versions 2,3 and 4." >> $(METADATA) + @echo "TestTime: 150m" >> $(METADATA) + @echo "RunFor: kernel" >> $(METADATA) + @echo "RunFor: nfs-utils" >> $(METADATA) + @echo "Requires: nfs-utils" >> $(METADATA) + @echo "Requires: net-tools" >> $(METADATA) + @echo "Requires: net-snmp" >> $(METADATA) + @echo "Requires: ethereal" >> $(METADATA) + @echo "Requires: wireshark" >> $(METADATA) + @echo "Requires: tcpdump" >> $(METADATA) + @echo "Requires: rusers" >> $(METADATA) + @echo "Requires: bzip2" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Priority: Medium" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "Type: Tier1" >> $(METADATA) + @echo "Type: KernelTier1" >> $(METADATA) + @echo "License: GPL v2" >> $(METADATA) + rhts-lint $(METADATA) diff --git a/kernel/filesystems/nfs/connectathon/PURPOSE b/kernel/filesystems/nfs/connectathon/PURPOSE new file mode 100644 index 0000000..8d5325b --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/PURPOSE @@ -0,0 +1,22 @@ +This is the NFS Connectathon test suite from the Linux Test Project (LTP) it is configured to test NFS versions 2, 3, and 4 on all applicable releases. + + +Run alone, this is nfs client test, using other nfs server. + +Jian Li<jiali@redhat.com> +Sat Apr 21 16:07:58 CST 2012 + +OBSOLETE(N): NO +DISTRO(N): RHEL5, RHEL6, RHEL7 +NFSVERSION(N): ALL +TESTVERSION(O): ALL +TESTWRAPPED(N): YES +MULTIHOST(N): 1 +TESTTYPE(N): TIER1 +TESTTRANSPORT(O): +TESTPLAN(N): 5.1.2.1 +TCMS(O): +IMPORTANCE(O): HIGH +EXPANSIBILITY(O): +BUG(O): NO +NEEDMODIFY(O): NO diff --git a/kernel/filesystems/nfs/connectathon/a.tar b/kernel/filesystems/nfs/connectathon/a.tar Binary files differnew file mode 100644 index 0000000..9ab2162 --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/a.tar diff --git a/kernel/filesystems/nfs/connectathon/filter_nroff_warnings.patch b/kernel/filesystems/nfs/connectathon/filter_nroff_warnings.patch new file mode 100644 index 0000000..af3abbd --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/filter_nroff_warnings.patch @@ -0,0 +1,25 @@ +diff --git a/cthon04/general/runtests.wrk b/cthon04/general/runtests.wrk +index 5efc091..89ffa76 100644 +--- a/cthon04/general/runtests.wrk ++++ b/cthon04/general/runtests.wrk +@@ -82,11 +82,15 @@ set +e + echo "" + echo "Nroff" + rm -f nroff.time +-$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time +-$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time +-$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time +-$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time +-$TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time ++rm -f nroff.stderr ++$TIME -a -o nroff.time nroff < nroff.tbl > nroff.out 2>> nroff.stderr || cat nroff.time ++$TIME -a -o nroff.time nroff < nroff.tbl > nroff.out 2>> nroff.stderr || cat nroff.time ++$TIME -a -o nroff.time nroff < nroff.tbl > nroff.out 2>> nroff.stderr || cat nroff.time ++$TIME -a -o nroff.time nroff < nroff.tbl > nroff.out 2>> nroff.stderr || cat nroff.time ++$TIME -a -o nroff.time nroff < nroff.tbl > nroff.out 2>> nroff.stderr || cat nroff.time ++echo "nroff.stderr:" ++cat nroff.stderr ++echo "nroff.stderr END" + rm nroff.out nroff.tbl + set -e + ./stat nroff.time diff --git a/kernel/filesystems/nfs/connectathon/hostnamefix.patch b/kernel/filesystems/nfs/connectathon/hostnamefix.patch new file mode 100644 index 0000000..344d356 --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/hostnamefix.patch @@ -0,0 +1,37 @@ +--- cthon04/server.orig 2011-11-25 04:39:45.000000000 -0500 ++++ cthon04/server 2011-11-25 04:43:57.000000000 -0500 +@@ -121,8 +121,32 @@ + + # mount doesn't always return error code if it fails, so lets + # ask here just in case +-HOSTNAME=`hostname` +-HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'` ++#HOSTNAME=`hostname` ++#HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'` ++ ++my_hostname=`hostname --fqdn` ++fqdn_dots=`echo $my_hostname | grep -o "\." | wc -l` ++ ++if [ "$fqdn_dots" -eq 0 ]; then ++ echo dots: $fqdn_dots ++ # borrowed this from virtinstall ++ def_line=$(ip route list | grep ^default) ++ defnum=$(perl -e 'for ($i=0; $i<$#ARGV; $i++ ) { if ($ARGV[$i] eq "dev" ) { $_ = $ARGV[ $i + 1 ]; if ( /^(\w*)(\d+)/ ) { print "$_ $2"; } } }' ${def_line} ) ++ actnum=$(echo ${defnum} | awk '{print $2}') ++ netdev=$(echo ${defnum} | awk '{print $1}') ++ ++ random=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8` ++ mac=`ip link show ${netdev} | grep 'link\/ether' | head -1 | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'` ++ if [ -n "mac" ]; then ++ my_hostname=`echo "mac-$mac-$random" | sed 's/:/-/g'` ++ else ++ my_hostname="random-$random" ++ fi ++fi ++ ++HOSTNAME="$my_hostname" ++ ++ + NFSTESTDIR=$MNTPOINT/$HOSTNAME.test + export NFSTESTDIR + echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC" diff --git a/kernel/filesystems/nfs/connectathon/nfstests.tar.gz b/kernel/filesystems/nfs/connectathon/nfstests.tar.gz Binary files differnew file mode 100644 index 0000000..ab2d1aa --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/nfstests.tar.gz diff --git a/kernel/filesystems/nfs/connectathon/patch b/kernel/filesystems/nfs/connectathon/patch new file mode 100644 index 0000000..34061fe --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/patch @@ -0,0 +1,163 @@ +Common subdirectories: cthon04/basic and cthon04.fixed/basic +Common subdirectories: cthon04/general and cthon04.fixed/general +Common subdirectories: cthon04/lock and cthon04.fixed/lock +diff -u cthon04/server cthon04.fixed/server +--- cthon04/server 2003-12-31 12:33:32.000000000 -0500 ++++ cthon04.fixed/server 2007-03-06 16:14:16.000000000 -0500 +@@ -23,11 +23,11 @@ + + # defaults + . $InitFile +-export PATH CFLAGS LIBS MOUNT UMOUNT MNTOPTIONS ++export PATH CFLAGS LIBS MOUNT UMOUNT MNTOPTIONS FSOPT + + passes="1" + +-set - `getopt abcfglhm:N:no:p:st $*` ++set - `getopt abcfF:glhm:N:no:p:st $*` + + if [ $? != 0 ] + then +@@ -44,6 +44,8 @@ + -m) USRMNTPOINT=$2; shift; shift ;; + -o) MNTOPTIONS=$2; export MNTOPTIONS; + shift; shift ;; ++ -F) FSOPT=$2; export FSOPT; ++ shift; shift ;; + -p) SERVPATH=$2; shift; shift ;; + -N) passes=$2; shift; shift ;; + --) shift; break ;; +@@ -124,15 +126,15 @@ + NFSTESTDIR=$MNTPOINT/$HOSTNAME.test + export NFSTESTDIR + echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC" +-read ans +-case $ans in +- Y*|y*) +- ;; +- *) +- echo "Terminating ($MNTPOINT left mounted)." +- exit 1 +- ;; +-esac ++#read ans ++#case $ans in ++ #Y*|y*) ++ #;; ++ #*) ++ #echo "Terminating ($MNTPOINT left mounted)." ++ #exit 1 ++ #;; ++#esac + + echo "" + +Common subdirectories: cthon04/special and cthon04.fixed/special +diff -u cthon04/tests.init cthon04.fixed/tests.init +--- cthon04/tests.init 2003-12-31 12:33:31.000000000 -0500 ++++ cthon04.fixed/tests.init 2007-03-06 16:15:39.000000000 -0500 +@@ -13,8 +13,8 @@ + # Use this mount command if using: + # SVR4 + # Solaris 2.x +-MOUNTCMD='./domount -F nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT' +-CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT' ++#MOUNTCMD='./domount -F nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT' ++#CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT' + + # Use this mount command if using: + # BSD +@@ -26,8 +26,8 @@ + # Mac OS X + # At least some BSD systems don't recognize "hard" (since that's the + # default), so you might also want to use this definition of MNTOPTIONS. +-#MNTOPTIONS="rw,intr" +-#MOUNTCMD='./domount -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT' ++FSOPT=nfs ++MOUNTCMD='./domount -t $FSOPT -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT' + + # Use this mount command if using: + # DG/UX +@@ -40,8 +40,8 @@ + # SVR4 + # Solaris 2.x + # HPUX +-DASHN= +-BLC=\\c ++#DASHN= ++#BLC=\\c + + # Use the next two lines if using: + # BSD +@@ -49,12 +49,12 @@ + # Linux + # Tru64 UNIX + # Mac OS X +-#DASHN=-n +-#BLC= ++DASHN=-n ++BLC= + + # Use this path for: + # Solaris 2.x +-PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:. ++#PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:. + + # Use this path for: + # Solaris 2.x with GCC +@@ -73,7 +73,7 @@ + # Tru64 UNIX + # SVR4 + # Linux +-#PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:. ++PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:. + + # Use this path for: + # DG/UX +@@ -130,12 +130,12 @@ + + # Use with Solaris 2.x systems. Need the 5.0 C compiler (or later) + # for 64-bit mode. +-CC=/opt/SUNWspro/bin/cc ++#CC=/opt/SUNWspro/bin/cc + # Use this with GCC + #CC=/opt/gnu/bin/gcc + # Use this through Solaris 2.6. For Solaris 2.7 and later, use + # this for 32-bit mode applications. +-CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG` ++#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG` + # Use this with gcc (32-bit binaries): + #CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -mcpu=ultrasparc` + # For Solaris 2.7 and later, use this for 64-bit mode applications +@@ -143,11 +143,11 @@ + #CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -xO0 -xarch=v9 -dalign -Xt -L/usr/lib/sparcv9` + # Use this to make 64-bit binaries with gcc (3.1 or later; untested): + #CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -m64` +-LIBS=`echo -lsocket -lnsl` ++#LIBS=`echo -lsocket -lnsl` + # Use this through Solaris 2.5.1. + #LOCKTESTS=`echo tlock` + # Use with 2.6 and later systems, 32-bit mode. +-LOCKTESTS=`echo tlocklfs tlock64` ++#LOCKTESTS=`echo tlocklfs tlock64` + # Use with 2.7 and later, 64-bit mode. + #LOCKTESTS=`echo tlocklfs` + +@@ -204,11 +204,11 @@ + #UMOUNT=/bin/umount + + # Use with Linux 2.4 / GNU libc 2.2 +-#CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings` +-#LIBS=`echo -lnsl` +-#MOUNT=/bin/mount +-#UMOUNT=/bin/umount +-#LOCKTESTS=`echo tlocklfs tlock64` ++CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG` ++LIBS=`echo -lnsl` ++MOUNT=/bin/mount ++UMOUNT=/bin/umount ++LOCKTESTS=`echo tlocklfs tlock64` + + # Use with Linux if your distro doesn't provide a "cc". + #CC=gcc +Common subdirectories: cthon04/tools and cthon04.fixed/tools diff --git a/kernel/filesystems/nfs/connectathon/runtest.sh b/kernel/filesystems/nfs/connectathon/runtest.sh new file mode 100755 index 0000000..37b0013 --- /dev/null +++ b/kernel/filesystems/nfs/connectathon/runtest.sh @@ -0,0 +1,278 @@ +#!/bin/sh + +# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Author: Bill Peck <bpeck@redhat.com> + +# Environment Variables +# $JOBID +# $DISTRO +# $ARCH +# $TEST +# $FAMILY +# $VARIANT +# $ARGS + +# source the test script helpers +. /usr/bin/rhts-environment.sh + +function checkRebootCount() +{ + if [ "$REBOOTCOUNT" -gt "0" ] ; then + echo "***** System rebooted *****" | tee -a $OUTPUTFILE + report_result system_rebooted WARN + exit 0 + fi +} + +function checkServers() +{ + foundserver=0 + for S in $servers; do + server=$(echo $S| cut -f1 -d:) + ping -c 1 $server >/dev/null 2>&1 + if [ $? != 0 ]; then + echo "Warn ***** Server $server not available or unavailable in the $thisdom *****" | tee -a $OUTPUTFILE + else + echo "Pass ***** Server $server available *****" | tee -a $OUTPUTFILE + foundserver=$(expr "$foundserver" + 1) + fi + done + + if [ "$foundserver" -gt "0" ]; then + echo "***** Some servers are available... continue testing *****" | tee -a $OUTPUTFILE + else + s390chk=$(/bin/hostname | awk -F. '{print $2}') + if [ $s390chk = "z900" ]; then + report_result $TEST PASS + else + report_result $TEST WARN + fi + exit 0 + fi +} + +function _cthon04() { + # redirect stdout & stderr to $OUTPUTFILE + exec 5>&1 6>&2 + exec >> $OUTPUTFILE 2>&1 + if [ -n "PROFILE" ]; then + PS4='+ $(date "+%H:%M:%S.%N")\011 ' + set -x + fi + # _cthon04 $fstype $test_name $report_path $server $nfspath $options + fstype=$1 + test_name=$2 + report_path=$3 + server=$4 + nfspath=$5 + options=$6 + test=$(echo $test_name| cut -f1 -d:) + name=$(echo $test_name| cut -f2 -d:) + + tethereal_out="/mnt/testarea/${server}_${report_path}_${name}" + + NET_DUMPER="tcpdump" + if [ -f /usr/sbin/tshark ]; then + NET_DUMPER="/usr/sbin/tshark" + fi + if [ -f /usr/sbin/tethereal ]; then + NET_DUMPER="/usr/sbin/tethereal" + fi + if [ -n "$DISABLE_NETDUMPER" ]; then + NET_DUMPER="/bin/false" + fi + echo "NET_DUMPER is $NET_DUMPER" + + $NET_DUMPER -q -i any -w $tethereal_out.cap host $server 2>&1 & + tpid=$! + sleep 5 + + echo "===== Starting '$report_path' test '$name' =====" + echo "----- Server load `/usr/bin/rup $server` -----" + echo "----- start: `/bin/date` -----" + # log the command we used. + echo ./server $test -N $testRuns -F $fstype ${options} -p $nfspath $server + ./server $test -N $testRuns -F $fstype ${options} -p $nfspath $server 2>&1 + result=$? + + echo "----- end: `/bin/date` -----" + echo "----- Server load `/usr/bin/rup $server` -----" + echo "----- return code: $result -----" + + kill $tpid 2>&1 & + + umount /mnt/$server + mount + if mount|grep -q /mnt/$server 2>&1; then + echo "----- umount failed, pls check umount function -----" + result=1 + fi + + # restore stdout & stderr + if [ -n "PROFILE" ]; then + set +x + fi + exec 1>&5 2>&6 + + if [ $result = 0 ]; then + if [ -z "$SKIP_SUBRESULT" ]; then + iswarn=`/bin/grep WARNING! $OUTPUTFILE | wc -l` + if [ $iswarn -gt $result ]; then + report_result $TEST/$server/$report_path/$name PASS $iswarn + else + report_result $TEST/$server/$report_path/$name PASS $result + fi + fi + if [ -z "$SAVECAPTURE" ]; then + rm -f $tethereal_out.cap > /dev/null 2>&1 + else + bzip2 $tethereal_out.cap + fi + else + bzip2 $tethereal_out.cap + rhts_submit_log -l $tethereal_out.cap.bz2 + report_result $TEST/$server/$report_path/$name FAIL $result + if [ -z "$SAVECAPTURE_FAILED" ]; then + rm -f $tethereal_out.cap.bz2 > /dev/null 2>&1 + fi + fi + + + # do a lazy unmount so the next test will run + umount -l /mnt/$server >/dev/null 2>&1 + + # backup and clear log + old_log="`mktemp /tmp/tmp.XXXXXX`" + cp $OUTPUTFILE $old_log + : > $OUTPUTFILE + echo "log moved to: '$old_log'" + + return $result +} + +# ----------------------- +if [ "$CTHONTESTRUNS" ]; then + # We can specify the number of times to run the Cthon test. + echo " ============ Override # of test runs ============" + testRuns="$CTHONTESTRUNS" +else + # Default # of test runs is 1. + echo " ========== Use default single test run ============" + testRuns="1" +fi + +if [ "$CTHONSERVERS" ]; then + # We can specify lists of serves tests againts. + # For example, we can provide a customized list of + # servers CTHONSERVER="host1-nfs host2-nfs host3-nfs" + echo " ============ Override server list ============" + servers="$CTHONSERVERS" +else + # Default lists of servers. + echo " ========== Use default server list ============" + servers="rhel5-nfs:/export/home rhel4-nfs:/export/home rhel3-nfs:/export/home sol10-nfs:/export/home sol9-nfs:/export/home netapp-nfs:/vol/vol0/home/cthon rhel6-nfs:/export/home" +fi + +if [ "$CTHONTESTS" ]; then + echo " ============ Override cthon test list ============" + tests="$CTHONTESTS" +else + echo " ========== Use default cthon test list ============" + tests="-b:base -g:general -s:special -l:lock" +fi + +if [ "$CTHONTCPTYPE" ]; then + echo " ============ Override TCP type list ============" + types="$CTHONTCPTYPE" +else + echo " ========== Use default TCP type list ============" + types="udp tcp" +fi + +thisdom=`dnsdomainname` +kernversion=$(rpm -q --queryformat '%{version}\n' -qf /boot/config-$(uname -r)) + +checkRebootCount + +checkServers + +pushd cthon04 +for server_path in $servers; do + : > result.txt + SCORE=0 + + # start time + STIME=`date +%s` + + server=$(echo $server_path| cut -f1 -d:) + nfspath=$(echo $server_path| cut -f2 -d:) + + # Check to see if the CNAME is setup in this lab. + ping -c 1 $server >/dev/null 2>&1 + if [ $? -ne 0 ]; then continue; fi + + # NFSv2 & NFSv3 tests + nfsvers="nfsvers=2 nfsvers=3" + for nfsver in $nfsvers; do + for type in $types; do + for test_name in $tests; do + # _cthon04 $fstype $test_name $report_path $server $nfspath $options + _cthon04 nfs $test_name "${nfsver}_${type}" $server $nfspath -o$nfsver,$type + rc=$? + [ $rc -ne 0 ] && SCORE=$(expr $SCORE + 1) + echo -e "$nfsver\t$type\t$test_name\t$rc" >> result.txt + done + done + done + + # NFSv4 tests + if [ $kernversion != "2.4.21" ]; then + testnfsvers=$(rpcinfo -t $server nfs | wc -l) + if [ $testnfsvers -eq 3 ]; then + for test_name in $tests; do + # _cthon04 $fstype $test_name $report_path $server $nfspath $options + _cthon04 nfs4 $test_name "nfsvers=4" $server $nfspath -oproto=tcp + rc=$? + [ $rc -ne 0 ] && SCORE=$(expr $SCORE + 1) + echo -e "nfsvers=4\ttcp\t$test_name\t$rc" >> result.txt + done + fi + fi + + # end & test time + ETIME=`date +%s` + TTIME=`expr $ETIME - $STIME` + + # format result.txt for tabbed alignment + sed -i 's/lock/lock\t/g;s/base/base\t/g' result.txt + echo "***** Summary for server '$server': '$SCORE' tests failed *****" | tee -a $OUTPUTFILE + echo -e "NFS version\tType\tTest\tReturn code" | tee -a $OUTPUTFILE + cat result.txt | tee -a $OUTPUTFILE + echo "Total time: $TTIME" | tee -a $OUTPUTFILE + + if [ $SCORE -eq 0 ]; then + if [ $TTIME -lt 1000 ]; then + report_result $TEST/$server PASS $TTIME + else + echo "Time exceeded 1000 seconds" | tee -a $OUTPUTFILE + report_result $TEST/$server WARN $TTIME + fi + else + report_result $TEST/$server FAIL $TTIME + fi +done +popd + + |