[PVFS2-CVS] commit by pcarns in pvfs2/test/automated: CONFIG.template PAVCONFIG.template SUBMIT.pbs.template pvfs2tests.py run-cron-adenine.sh run-test-adenine.sh simple.sh

CVS commit program cvs at parl.clemson.edu
Tue Mar 23 11:15:10 EST 2004


Update of /projects/cvsroot/pvfs2/test/automated
In directory parlweb:/tmp/cvs-serv4872/test/automated

Added Files:
	CONFIG.template PAVCONFIG.template SUBMIT.pbs.template 
	pvfs2tests.py run-cron-adenine.sh run-test-adenine.sh 
	simple.sh 
Log Message:
added a rough draft of of the simplest parts of an automated testing
environment; needs some cleanup and more features, but should be enough to
start running shortly


--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ CONFIG.template	2004-03-23 11:15:10.000000000 -0500
@@ -0,0 +1,11 @@
+[Config]
+MPICHBINDIR=/home/USER/testing/DATE/work/mpich2/bin/
+PVFS2BINDIR=/home/USER/testing/DATE/work/INSTALL-pvfs2/bin/
+PVFS2TABFILE=/tmp/pvfs2-pav/pvfs2tab
+PAVDIR=/home/USER/testing/DATE/work/pvfs2/test/common/pav/
+MOUNTPOINT=/tmp/pvfs2-pav-mount
+EMAIL=pcarns at parl.clemson.edu
+
+[Tests]
+TEST2=./simple.sh
+

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ PAVCONFIG.template	2004-03-23 11:15:10.000000000 -0500
@@ -0,0 +1,18 @@
+NODEFILE="/home/USER/testing/DATE/work/nodes.conf"
+IONCOUNT=4
+METACOUNT=1
+UNIQUEMETA=0
+PROTOCOL=tcp
+PVFSPORT=3349
+WORKINGDIR="/tmp/pvfs2-pav"
+STORAGE="/tmp/pvfs2-pav/storage"
+SERVERLOG="/tmp/pvfs2-pav/log"
+MOUNTPOINT="/tmp/pvfs2-pav-mount"
+BINDIR="/home/USER/testing/DATE/work/INSTALL-pvfs2/bin"
+RCMDPROG=rsh
+RCPPROG=rcp
+SERVER="/home/USER/testing/DATE/work/INSTALL-pvfs2/sbin/pvfs2-server"
+PINGPROG="/home/USER/testing/DATE/work/INSTALL-pvfs2/bin/pvfs2-ping"
+GENCONFIG="/home/USER/testing/DATE/work/INSTALL-pvfs2/bin/pvfs2-genconfig"
+COPYBINS=1
+PVFS2TAB_FILE="/tmp/pvfs2-pav/pvfs2tab"

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ SUBMIT.pbs.template	2004-03-23 11:15:10.000000000 -0500
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+#PBS -N PVFS2TEST
+#PBS -l walltime=1:00:00
+
+# Change into the working directory
+cd $PBS_O_WORKDIR
+# Set the path to match the path of the submitter
+PATH=$PBS_O_PATH
+
+############################
+#Change these variables if you want
+#to name your config files something
+#else.
+CONFIGFILE="CONFIG"
+PAVCONFIG="PAVCONFIG"
+NODEFILE="nodes.conf"
+
+cat $PBS_NODEFILE>/home/USER/testing/DATE/work/$NODEFILE
+cd $PBS_O_WORKDIR
+
+mpdboot --rsh=rsh --file=$HOME/nightly/nodes.conf
+
+# TODO: send email if this doesn't work too!
+./pvfs2tests.py $CONFIGFILE $PAVCONFIG /home/USER/testing/DATE/work/$NODEFILE
+
+mpdallexit
+
+exit 0

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ pvfs2tests.py	2004-03-23 11:15:10.000000000 -0500
@@ -0,0 +1,116 @@
+#!/usr/bin/python
+
+#NOTE:Command line takes 3 options: config file, PAV config, PAV machine list
+
+import os,sys,ConfigParser,bsddb,smtplib,string
+
+#This function gets all options from the Config file that was passed
+#at the command line.
+def getconfig():
+
+	Config=bsddb.hashopen(None,'w')
+	Tests=bsddb.hashopen(None,'w')
+
+	config=ConfigParser.ConfigParser()
+	config.readfp(open(sys.argv[1]))
+
+	if not config.has_section('Config'):
+		print "Config file *must* have section [Config]"
+		sys.exit(1)
+	for options in config.options('Config'):
+		Config[options]=config.get('Config',options)
+	if not Config.has_key('pvfs2tabfile'):
+		print "Config section must have a \"PVFS2TABFILE\" option"
+		sys.exit(1)
+	if not Config.has_key('pvfs2bindir'):
+		print "Config section must have a \"PVFS2BINDIR\" option"
+		sys.exit(1)
+	if not Config.has_key('mpichbindir'):
+		print "Config section must have a \"MPICHBINDIR\" option"
+		sys.exit(1)
+	if not Config.has_key('pavdir'):
+		print "Config section must have a \"PAVDIR\" option"
+		sys.exit(1)
+	if not Config.has_key('mountpoint'):
+		print "Config section must have a \"MOUNTPOINT\" option"
+		sys.exit(1)
+	if not Config.has_key('email'):
+		print "Config section must have a \"EMAIL\" option"
+		sys.exit(1)
+
+	if not config.has_section('Tests'):
+		print "Config file *must* have section [Tests]"
+		sys.exit(1)
+
+	for options in config.options('Tests'):
+		Tests[options]=(config.get('Tests',options))
+
+	return Config,Tests
+
+
+def start_pav(pavconfigfile,pavmachinefile,Config):
+    	pav_dir=Config['pavdir']
+
+	#if os.path.exists(Config['mountpoint']):
+	#	os.system('rm -rf '+Config['mountpoint'])
+	#os.mkdir(Config['mountpoint'])
+    	success=os.system(pav_dir+'/pav_start -m '+pavmachinefile+' -c '+pavconfigfile+' > pav_setup.log 2>&1')
+
+    	if success<>0:
+		print 'Failed to start PAV, see pav_setup.log'
+		sys.exit(1)
+
+    	os.system(pav_dir+'/pav_info -c '+pavconfigfile+' > pav_info.log 2>&1')
+
+
+def stop_pav(pavconfigfile,Config):
+	pav_dir=Config['pavdir']
+	cmd=pav_dir+"/pav_stop -c "+oldwd+"/"+pavconfigfile
+	os.system(cmd)
+
+
+#This function is responsible for running all the tests that were in the config file
+def runtests(Config,Tests):
+	#construct mpiexec arguments from Config
+	#construct tests to run from Tests
+	#run the tests contained in Tests
+
+	for KEY in Config.keys():
+		os.environ[KEY]=Config[KEY]
+
+	os.system('rm -f total.output')
+	fail = 0
+	for TEST in Tests.keys():
+		cmd="echo "+Tests[TEST]+" >> total.output"
+		os.system(cmd)
+		cmd="echo ================ >> total.output"
+		os.system(cmd)
+		cmd=Tests[TEST]+" >> total.output 2>&1"
+		outfile="total.output"
+		print cmd
+		if os.system(cmd):
+			fail = 1
+
+	if fail:
+		cmd="mail -s \"PVFS2 test: FAIL\" "
+	else:
+		cmd="mail -s \"PVFS2 test: PASS\" "
+	cmd = cmd + Config['email'] + " < total.output"
+	print cmd
+	if os.system(cmd):
+		print "Error sending email; aborting..."
+		sys.exit(1)
+
+
+if len(sys.argv) <> 4:
+	print repr(len(sys.argv))+" arguments passed"
+	print "Usage: pvfs2tests.py <Test config file> <PAV config> <PAV machine list>"
+	sys.exit(1)
+
+
+Config,Tests=getconfig()
+
+oldwd=os.getcwd()
+start_pav(sys.argv[2],sys.argv[3],Config)
+runtests(Config,Tests)
+stop_pav(sys.argv[2],Config)

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ run-cron-adenine.sh	2004-03-23 11:15:10.000000000 -0500
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+cvsroot=:pserver:anonymous at cvs.parl.clemson.edu:/anoncvs
+
+source /usr/share/usepackage/use.bsh
+use standard-user
+use mpich2
+
+DATE=`date "+%b%d-%Y"`
+
+mkdir -p $HOME/testing/$DATE
+cd $HOME/testing/$DATE
+
+expect -c "spawn -noecho cvs -Q -d $cvsroot login; send \r;"
+cvs -Q -d $cvsroot co pvfs2
+if [ $? -ne 0 ] ; then
+    echo "Pulling PVFS2 from $cvsroot
+    failed."
+    exit 1
+fi
+
+cd pvfs2/test/automated/
+
+# TODO: send email if this doesn't work too!
+./run-test-adenine.sh 
+
+exit 0
+
+

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ run-test-adenine.sh	2004-03-23 11:15:10.000000000 -0500
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+DATE=`date "+%b%d-%Y"`
+old_wd=`pwd`
+
+mkdir -p /home/$USER/testing/$DATE/work
+
+sed -e s/DATE/$DATE/g PAVCONFIG.template | sed -e s/USER/$USER/g > PAVCONFIG
+sed -e s/DATE/$DATE/g CONFIG.template | sed -e s/USER/$USER/g > CONFIG
+sed -e s/DATE/$DATE/g SUBMIT.pbs.template | sed -e s/USER/$USER/g > SUBMIT.pbs
+
+cd ../../maint/build/
+
+./pvfs2-build.sh /home/$USER/testing/$DATE/work
+./mpich2-build.sh /home/$USER/testing/$DATE/work
+
+cd $old_wd
+qsub -l nodes=4:ppn=1 SUBMIT.pbs
+
+exit 0
+
+

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ simple.sh	2004-03-23 11:15:11.000000000 -0500
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+export PVFS2TAB_FILE=$pvfs2tabfile
+
+echo $pvfs2bindir/pvfs2-statfs -m /tmp/pvfs2-pav-mount
+$pvfs2bindir/pvfs2-statfs -m /tmp/pvfs2-pav-mount
+if [ $? != 0 ] ; then
+    echo "statfs failed. Aborting."
+    exit 1
+fi
+
+echo $pvfs2bindir/pvfs2-import $pvfs2bindir/pvfs2-import /tmp/pvfs2-pav-mount/simple-test
+$pvfs2bindir/pvfs2-import $pvfs2bindir/pvfs2-import /tmp/pvfs2-pav-mount/simple-test
+if [ $? != 0 ] ; then
+    echo "import failed. Aborting."
+    exit 1
+fi
+
+echo $pvfs2bindir/pvfs2-export /tmp/pvfs2-pav-mount/simple-test /home/pcarns/nightly/simple-test
+$pvfs2bindir/pvfs2-export /tmp/pvfs2-pav-mount/simple-test /home/pcarns/nightly/simple-test
+if [ $? != 0 ] ; then
+    echo "export failed. Aborting."
+    exit 1
+fi
+
+echo diff $pvfs2bindir/pvfs2-import /home/pcarns/nightly/simple-test
+diff $pvfs2bindir/pvfs2-import /home/pcarns/nightly/simple-test
+if [ $? != 0 ] ; then
+    echo "diff failed. Aborting."
+    exit 1
+fi
+
+exit 0
+
+



More information about the PVFS2-CVS mailing list