diff options
-rw-r--r-- | compliance_test.py | 46 | ||||
-rw-r--r-- | ptest-runner.sh | 36 |
2 files changed, 82 insertions, 0 deletions
diff --git a/compliance_test.py b/compliance_test.py new file mode 100644 index 00000000000..6bef5c682a8 --- /dev/null +++ b/compliance_test.py @@ -0,0 +1,46 @@ +#!/usr/bin/python + +import os +import sys +import time +import re +import subprocess + + +def run_ltp(milestone="M3", date="20150303"): + print "Starting LTP tests..." + default="syscalls\nfs\nfsx\ndio\nio\nmm\nipc\nsched\nmath\nnptl\npty\nadmin_tools\ntimers\ncommands" + print "Writing configuration..." + os.system("echo \""+default+"\" > /opt/ltp/scenario_groups/default") + os.system("sed -e '/hackbench/ s/^#*/#/' -i /opt/ltp/runtest/sched") + os.system("sed -e '/oom0/ s/^#*/#/' -i /opt/ltp/runtest/mm") + print "Running test script..." + os.system("cd /opt/ltp; ./runltp -p -l result-"+milestone+"-"+date+".log -C result-"+milestone+"-"+date+".fail -d /opt/ltp/tmp &> result-"+milestone+"-"+date+".fulllog") + +def run_posix(milestone="M3", date="20150303"): + print "Starting POSIX tests..." + posix_sh="#!/bin/sh\n./bin/run-posix-option-group-test.sh AIO\n./bin/run-posix-option-group-test.sh MEM\n./bin/run-posix-option-group-test.sh MSG\n\ +./bin/run-posix-option-group-test.sh SEM\n./bin/run-posix-option-group-test.sh SIG\n./bin/run-posix-option-group-test.sh THR\n./bin/run-posix-option-group-test.sh TMR\n\ +./bin/run-posix-option-group-test.sh TPS" + print "Running make..." + os.system("cd /opt/ltp/testcases/open_posix_testsuite/; make generate-makefiles; make conformance-all; make conformance-test; make tools-all; make conformance-all;") + os.system("echo \""+posix_sh+"\" > /opt/ltp/testcases/open_posix_testsuite/posix.sh") + print "Running POSIX script..." + os.system("cd /opt/ltp/testcases/open_posix_testsuite; sh posix.sh > posix.log") + +def run_lsb(milestone="M3", date="20150303"): + print "Starting LSB tests..." + print "Setting up config files..." + os.system("sed -i 's/which curl/which curl2/g' /usr/bin/LSB_Test.sh") + os.system("sed -i 's/--quiet/--quiet --httpproxy proxy-jf.intel.com --httpport 911/g' /usr/bin/LSB_Test.sh") + os.system("sed -i 's/lsb-qm-2.2.8./lsb-qm-2.2-12./' /opt/lsb-test/packages_list") + print "Starting LSB script..." + os.system("export http_proxy=http://proxy-jf.intel.com:911;export https_proxy=https://proxy-jf.intel.com:911; sh LSB_Test.sh") + print "Configuration done. LSB script must be started from machine." + +if __name__ == "__main__": + milestone = sys.argv[1] + date = sys.argv[2] + run_ltp(milestone,date) + run_posix(milestone,date) + run_lsb(milestone,date) diff --git a/ptest-runner.sh b/ptest-runner.sh new file mode 100644 index 00000000000..aa38313df1f --- /dev/null +++ b/ptest-runner.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +ARGS="$@" + +ANYFAILED=no +echo "START: $0" + +run_ptest(){ + + for libdir in $1 + do + [ ! -d "$libdir" ] && continue + for x in `ls -d $libdir*/ptest 2>/dev/null` + do + [ ! -f $x/run-ptest ] && continue + [ -h `dirname $x` ] && continue + date "+%Y-%m-%dT%H:%M" + echo "BEGIN: $x" + cd "$x" + timeout 20m ./run-ptest || ANYFAILED=yes + echo "END: $x" + date "+%Y-%m-%dT%H:%M" + done + done + echo "STOP: $0" + if [ "$ANYFAILED" = "yes" ]; then + exit 1 + fi +} + +if [ "$#" -lt 1 ]; then + run_ptest '/usr/lib/*' +else + run_ptest /usr/lib/${ARGS} +fi +exit 0 |