summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Burke <jburke@redhat.com>2006-08-12 03:03:05 +0000
committerJeff Burke <jburke@redhat.com>2006-08-12 03:03:05 +0000
commitb37c793aeb237e3efe551baa8bce54c798468b0c (patch)
treecb7e333f8393df7dc22f3c7e3f0e83fd69b733a6
add in reservesys test. required for reserve_workflow.pyrh-tests-distribution-reservesys-1_0-1
-rw-r--r--Tasks/distribution/reservesys/Makefile43
-rwxr-xr-xTasks/distribution/reservesys/runtest.sh59
2 files changed, 102 insertions, 0 deletions
diff --git a/Tasks/distribution/reservesys/Makefile b/Tasks/distribution/reservesys/Makefile
new file mode 100644
index 0000000..97442fb
--- /dev/null
+++ b/Tasks/distribution/reservesys/Makefile
@@ -0,0 +1,43 @@
+# Include global Makefile targets
+include /usr/share/rhts/lib/rhts-make.include
+
+# The toplevel namespace within which the test lives.
+TOPLEVEL_NAMESPACE=/distribution
+
+# The path of the test below the package:
+RELATIVE_PATH=reservesys
+
+export TESTVERSION=1.0
+
+export TEST=$(TOPLEVEL_NAMESPACE)/$(RELATIVE_PATH)
+
+METADATA=testinfo.desc
+
+# built executables should be added here
+BUILT_FILES=$(METADATA)
+
+FILES=$(BUILT_FILES) \
+ runtest.sh \
+ Makefile
+
+build: $(BUILT_FILES)
+ chmod a+x ./runtest.sh
+
+clean:
+ rm -rf ./mnt
+ rm -f *~ $(BUILT_FILES)
+ rm -f rhts-rh-tests-distribution-install*.noarch.rpm
+
+run: build
+ ./runtest.sh
+
+# Generate the testinfo.desc here:
+$(METADATA): Makefile
+ @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: Reserves system for specific time frame" >> $(METADATA)
+ @echo "TestTime: 1h" >> $(METADATA)
+ @echo "Priority: Manual" >> $(METADATA)
diff --git a/Tasks/distribution/reservesys/runtest.sh b/Tasks/distribution/reservesys/runtest.sh
new file mode 100755
index 0000000..64914b0
--- /dev/null
+++ b/Tasks/distribution/reservesys/runtest.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Source the common test script helpers
+. /usr/bin/rhts_environment.sh
+
+# Functions
+RprtRslt()
+{
+ ONE=$1
+ TWO=$2
+ THREE=$3
+
+ # File the results in the database
+ report_result $ONE $TWO $THREE
+}
+
+MOTD()
+{
+ FILE=/etc/motd
+
+ mv $FILE $FILE.orig
+
+ echo "** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **" > $FILE
+ echo " This System is reserved by $SUBMITTER. " >> $FILE
+ echo " " >> $FILE
+ echo " " >> $FILE
+ echo " RHTS Test information: " >> $FILE
+ echo " HOSTNAME=$HOSTNAME " >> $FILE
+ echo " JOBID=$JOBID " >> $FILE
+ echo " RECIPEID=$RECIPEID " >> $FILE
+ echo " LAB_SERVER=$LAB_SERVER " >> $FILE
+ echo " RESULT_SERVER=$RESULT_SERVER " >> $FILE
+ echo " DISTRO=$DISTRO " >> $FILE
+ echo "** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **" >> $FILE
+}
+
+if [ -z "$RESERVETIME" ]; then
+ SLEEPTIME=24h
+else
+ SLEEPTIME=$RESERVETIME
+fi
+
+if [ -z "$RESERVEBY" ]; then
+ SUBMITTER=Uknown
+else
+ SUBMITTER=$$RESERVEBY
+fi
+
+echo "***** Start of reservesys test *****" > $OUTPUTFILE
+
+MOTD
+
+sleep $SLEEPTIME
+
+echo "***** End of reservesys test *****" >> $OUTPUTFILE
+
+RprtRslt $TEST PASS $SCORE
+
+exit 0