GEODE-2332: Deleted deprecated tests scripts.
Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/03781bd1 Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/03781bd1 Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/03781bd1 Branch: refs/heads/next-gen-native-client-software-grant Commit: 03781bd1c0013950dfc7cda5d90098b31f07312f Parents: 86df4a7 Author: Jacob Barrett <jbarr...@pivotal.io> Authored: Sat Jan 21 12:38:18 2017 -0800 Committer: Jacob Barrett <jbarr...@pivotal.io> Committed: Sat Jan 21 12:38:18 2017 -0800 ---------------------------------------------------------------------- src/tests/cpp/scripts/cdb.pl | 94 -- src/tests/cpp/scripts/cron.sample | 2 - src/tests/cpp/scripts/cronbeaverton.sh | 61 - src/tests/cpp/scripts/cronbeaverton.txt | 9 - src/tests/cpp/scripts/cronpune.txt | 9 - src/tests/cpp/scripts/gdb.pl | 88 -- src/tests/cpp/scripts/genCSFwkReport.sh | 111 -- src/tests/cpp/scripts/genCSV.sh | 62 - src/tests/cpp/scripts/genericFunctions.sh | 203 ---- src/tests/cpp/scripts/killJavaServer.sh | 53 - src/tests/cpp/scripts/killJavaServers.sh | 63 - src/tests/cpp/scripts/nightly-batch.sh | 145 --- src/tests/cpp/scripts/piper.sh | 44 - src/tests/cpp/scripts/runBatch.sh | 311 ----- src/tests/cpp/scripts/runBuild.sh | 113 -- src/tests/cpp/scripts/runCPPCSDriver.sh | 103 -- src/tests/cpp/scripts/runCSDriver.sh | 145 --- src/tests/cpp/scripts/runCSFunctions.sh | 216 ---- src/tests/cpp/scripts/runCSTests.sh | 397 ------- src/tests/cpp/scripts/runDriver.sh | 181 --- src/tests/cpp/scripts/runDriverFunctions.sh | 1344 ---------------------- src/tests/cpp/scripts/runPerfTest.sh | 58 - src/tests/cpp/scripts/runScalePerf.sh | 60 - src/tests/cpp/scripts/setCLITrust.bat | 1 - src/tests/cpp/scripts/setupJavaClients.sh | 150 --- src/tests/cpp/scripts/setupJavaServers.sh | 245 ---- src/tests/cpp/scripts/startCSFwk.sh | 128 --- src/tests/cpp/scripts/startClient.sh | 65 -- src/tests/cpp/scripts/startJavaClients.sh | 76 -- src/tests/cpp/scripts/startJavaServers.sh | 218 ---- src/tests/cpp/scripts/stopAll.sh | 82 -- src/tests/cpp/scripts/stopCS.sh | 80 -- src/tests/cpp/scripts/stopCSFwk.sh | 34 - src/tests/cpp/scripts/stopClient.sh | 45 - src/tests/cpp/scripts/stopJavaServers.sh | 72 -- src/tests/cpp/scripts/stopProcess.sh | 47 - src/tests/cpp/scripts/using_runCPPCSDriver | 40 - src/tests/cpp/scripts/using_runCSDriver | 161 --- src/tests/cpp/scripts/using_runDriver | 166 --- src/tests/cpp/scripts/using_scalePerfDriver | 6 - src/tests/cpp/scripts/waitForBBKey.sh | 26 - src/tests/cpp/scripts/waitForTask.sh | 72 -- 42 files changed, 5586 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/cdb.pl ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/cdb.pl b/src/tests/cpp/scripts/cdb.pl deleted file mode 100644 index 3651b06..0000000 --- a/src/tests/cpp/scripts/cdb.pl +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use vars qw ($CDBPATH $OUTPUT_DIR $THREAD_UNDERSCORE $THREAD_DEMARCATOR $PID $CDB @ARGV %ENV); -use POSIX; - -$PID = $ARGV[0]; -if ( ! defined $PID ) { - print "Invalid argument: The script takes pid as argument\n"; - exit 1; -} - -chomp $PID; - -if ($PID !~ /^\d+$/) { - print "Invalid argument: The script takes pid as argument\n"; - exit 1; -} - -$OUTPUT_DIR = "."; - -$THREAD_UNDERSCORE = "\\n**************\\n"; -$THREAD_DEMARCATOR = "\\n\\n=======================================================================\\n\\n"; - -my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname(); - -if (exists $ENV{CDB}) { - if ($sysname =~ /^CYGWIN.*$/) { - $CDBPATH = `cygpath "$ENV{CDB}"`; - chomp $CDBPATH; - } else { - $CDBPATH = $ENV{CDB}; - } -} else { - $CDBPATH = `cygpath "$ENV{GFCPP}/../framework/bin"`; - chomp $CDBPATH; -} -$ENV{PATH} .= ':' . $CDBPATH; - -$CDB = "cdb.exe"; - -my $COMMAND_FILE = $OUTPUT_DIR . "/" . "cdbcomm." . $PID; - -open(COMM, ">$COMMAND_FILE") || do { - print "could not open the command file $COMMAND_FILE"; - exit 1; -}; -print COMM "~\n"; -print COMM "q\n"; - -close COMM; - -my $CDBCOMMAND = "$CDB -p $PID -pd -cf $COMMAND_FILE"; - -my @thread_info = `$CDBCOMMAND`; - -open(COMM, ">$COMMAND_FILE") || do { - print "could not open the command file $COMMAND_FILE"; - exit 1; -}; - -foreach my $thr_line(@thread_info) { - if ($thr_line =~ /\s+(\d+)\s+Id:\s*([^\s]+).+/i) { - my $thrd = $1; - my $thrd_id = $2; - my @id_split = split('\.', $thrd_id); - my $pid = hex($id_split[0]); - $thrd_id = hex($id_split[1]); - print COMM ".printf \"$THREAD_UNDERSCORE\\n\"\n"; - print COMM ".printf \"THREAD $thrd [PID $pid, ID $thrd_id]\\n\"\n"; - print COMM ".printf \"$THREAD_UNDERSCORE\\n\"\n"; - print COMM "~${thrd}e kp\n"; - print COMM ".printf \"$THREAD_DEMARCATOR\\n\"\n"; - } -} -print COMM "q\n"; - -close COMM; - -my @output = `$CDBCOMMAND`; - -my $start = 0; - -foreach my $out_line(@output) { - if ($out_line =~ /^[0-9]+:[0-9]+\>/) { - $start = 1; - } - elsif ($start == 1 && $out_line !~ /^quit:/) { - chomp $out_line; - print $out_line . "\r\n"; - } -} - -unlink $COMMAND_FILE; http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/cron.sample ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/cron.sample b/src/tests/cpp/scripts/cron.sample deleted file mode 100755 index ad2d438..0000000 --- a/src/tests/cpp/scripts/cron.sample +++ /dev/null @@ -1,2 +0,0 @@ -# Do a fresh build and take the standard options from cronbeaverton.txt -0 20 * * * /export/tiny1/users/tkeith/regression/tests/scripts/runBatch.sh -o /export/tiny1/users/tkeith/regression/tests/scripts/cronbeaverton.txt hoth tiny sam gloin http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/cronbeaverton.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/cronbeaverton.sh b/src/tests/cpp/scripts/cronbeaverton.sh deleted file mode 100755 index eed665e..0000000 --- a/src/tests/cpp/scripts/cronbeaverton.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/bash - -# Arguments: -# -b ( optional ) do git pull and clean build before running test -# name_of_test_list ( optional ) name of file in $BUILDDIR/tests/xml/Regression containing names of tests to run -# defaults to name specified below, see TESTLIST -# list of hosts to use for test ( optional ) defaults to list below, see TESTHOSTS - -RESULTDRIVE=tiny2 -BUILDDRIVE=tiny1 -BUILDHOST=tiny - -TESTLIST=shortNightly.list -TESTHOSTS="hoth tiny sam gloin" - -RESULTSDIR=/export/${RESULTDRIVE}/users/tkeith/regression -BUILDDIR=/export/${BUILDDRIVE}/users/tkeith/regression - -doBuild=no - -if [ $# -gt 0 ] -then - doBuild=$1 -fi - -if [ $doBuild == "-b" ] -then - shift - echo "Updating checkout and beginning clean build at " `date` - ssh -x -q $BUILDHOST "cd $BUILDDIR && git pull && ./build.sh clean build-product tests ; if [ $? -eq 0 ]; then echo 'Build successful.'; else echo 'Build failed.'; fi" > build${BUILDHOST}.log 2>&1 - ssh -x -q $BUILDHOST "cd $BUILDDIR && cat build-artifacts/lastUpdate.txt" - echo "Build complete at " `date` - echo "" -fi - -if [ $# -gt 0 ] -then - list=$1 - if [ -f $BUILDDIR/build-artifacts/linux/framework/xml/$list ] - then - TESTLIST=$list - shift - fi -fi - -if [ $# -gt 0 ] -then - TESTHOSTS="$*" -fi - -logPrefix=`date +'%y-%m-%d_%H-%M-%S_'` -OUTDIR=$RESULTSDIR/${logPrefix}regression-results -mkdir -p $OUTDIR - -$BUILDDIR/tests/scripts/nightly-batch.sh \ - $BUILDDIR/build-artifacts/linux/framework \ - $OUTDIR \ - $BUILDDIR/build-artifacts/linux/framework/xml/$TESTLIST \ - $TESTHOSTS \ - | tee $OUTDIR/cronreg.log 2>&1 - http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/cronbeaverton.txt ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/cronbeaverton.txt b/src/tests/cpp/scripts/cronbeaverton.txt deleted file mode 100644 index ed04d45..0000000 --- a/src/tests/cpp/scripts/cronbeaverton.txt +++ /dev/null @@ -1,9 +0,0 @@ -# lines starting with a # are comments --p /export/tiny1/users/tkeith/regression --d /export/tiny2/users/tkeith/regression/build-artifacts/linux --l shortNightly.list --m tim.ke...@gemstone.com --m sudhir.me...@gemstone.com --m matthew.spl...@gemstone.com --m qing...@gemstone.com --m j...@gemstone.com http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/cronpune.txt ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/cronpune.txt b/src/tests/cpp/scripts/cronpune.txt deleted file mode 100644 index a0b7105..0000000 --- a/src/tests/cpp/scripts/cronpune.txt +++ /dev/null @@ -1,9 +0,0 @@ -# lines starting with a # are comments --p /export/crab2/users/matthews/svn/gfcpp/regression/build-artifacts/linux --d /export/crab2/users/matthews/svn/gfcpp/regression/results --l batchOne.list --m tim.ke...@gemstone.com --m sudhir.me...@gemstone.com --m matthew.spl...@gemstone.com --m qing...@gemstone.com --m j...@gemstone.com http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/gdb.pl ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/gdb.pl b/src/tests/cpp/scripts/gdb.pl deleted file mode 100755 index 65b92fe..0000000 --- a/src/tests/cpp/scripts/gdb.pl +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/perl -w - -use File::Basename; - -use lib dirname(__FILE__); - -use strict; - -use vars qw ($OUTPUT_DIR $OUTPUT_FILE $NL $THREAD_UNDERSCORE $THREAD_DEMARCATOR $PID $GDB @ARGV - $USESTDOUT ); - -$PID = $ARGV[0]; -if ( ! defined $PID ) { - print "Invalid argument: The script takes pid as argument\n"; - exit 1; -} - -chomp $PID; - -if ($PID !~ /^\d+$/) { - print "Invalid argument: The script takes pid as argument\n"; - exit 1; -} - -# Default behaviour .... output in a file -$USESTDOUT = 0; - -if ( scalar(@ARGV) > 1 ) { - $USESTDOUT = 1; -} - - -$OUTPUT_DIR = "."; -$OUTPUT_FILE = $OUTPUT_DIR . "/" . "gdbout." . $PID; - -$THREAD_UNDERSCORE = "**************"; -$THREAD_DEMARCATOR = "======================================================================="; -$NL = "\n"; - -require GDB; - -$GDB = "gdb -p"; - -our $gdb = new Devel::GDB (-execfile => "$GDB $PID") ; - -my $INFO_THREADS = $gdb->get("info threads"); - -my @threads = split '\n', $INFO_THREADS; - -my $numOfThreads = scalar @threads; - -if ( $numOfThreads > 0 ) { - - my $outstring = ""; - - $outstring .= $NL . $THREAD_DEMARCATOR . $NL; - foreach my $thr_line(@threads) { - $outstring .= $thr_line . $NL; - } - $outstring .= $THREAD_DEMARCATOR . $NL; - foreach my $thr_line(@threads) { - # 1 Thread -1218576256 (LWP 12154 - if ($thr_line =~ /\s+(\d+)\s+Thread\s+(\d+).+/) { - my $thrd = $1; - my $thrd_id = $2; - $gdb->get("thread $thrd"); - my $thrd_bt = $gdb->get("bt") ; - $outstring .= "THREAD " . $thrd . " " . $thrd_id . $NL . $THREAD_UNDERSCORE . $NL . $thrd_bt . $THREAD_DEMARCATOR . $NL; - } - } - - if ($USESTDOUT == 0) - { - open(OUT, ">$OUTPUT_FILE") || do { - print "could not open the output file $OUTPUT_FILE"; - $gdb -> get ( 'detach' ) ; - exit 1; - }; - - print OUT $outstring; - close OUT; - } else - { - print STDOUT $outstring; - } -} - -$gdb -> get ( 'detach' ) ; http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/genCSFwkReport.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/genCSFwkReport.sh b/src/tests/cpp/scripts/genCSFwkReport.sh deleted file mode 100755 index a2e9637..0000000 --- a/src/tests/cpp/scripts/genCSFwkReport.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh - -[ "$#" = "0" ] && { echo "Please give the log directory path as an argument"; exit 1; } - -DIRNAME="`dirname "$0"`" -LOGDIR="$1" -shift -if [ ! -d "${LOGDIR}" ]; then - echo "Error:: LogDir ${LOGDIR} does not exit." - exit 1 -fi - -LOGPOSTFIX="$1" -shift -POOLOPTION= -if [ $1 != "0" ]; then - POOLOPTION="$1" -fi -shift -is64bit=__IS_64_BIT__ -if [ $is64bit -eq 1 ]; then - ARCH="64" -else - ARCH="32" -fi - -runLatestProp() { - ## executing LatestProp.java for fatching latest java properties - #LCP_PATH="$fwkbuild/framework/lib/javaobject.jar:$GFE_DIR/lib/gemfire.jar" - gcmdir=`echo $GF_JAVA | sed 's/where.*/where/'` # gcmdir = /export/gcm/where or /gcm/where - LCP_PATH="${GFBASE}/framework/lib/javaobject.jar" - if type -p cygpath >/dev/null 2>/dev/null; then - LCP_PATH="`cygpath -p -m "$LCP_PATH"`" - LCP_PATH="${GFBASE}/framework/lib/javaobject.jar;$GFE_DIR/lib/gemfire.jar;${GFBASE}/framework/lib/testdb.jar;$gcmdir/java/mysql/mysql-connector-java-5.1.8-bin.jar" - else - LCP_PATH="$LCP_PATH:$GFE_DIR/lib/gemfire.jar:${GFBASE}/framework/lib/testdb.jar:$gcmdir/java/mysql/mysql-connector-java-5.1.8-bin.jar" - fi - #echo $GF_JAVA -cp "$LCP_PATH" javaobject.LatestProp >> $TESTDIR/latest.prop - ${GF_JAVA} -cp "${LCP_PATH}" javaobject.LatestProp >> $TESTDIR/latest.prop -} - -LOGPREFIX=`date +'%y-%m-%d_%H-%M-%S'` -RUN_REPORT="${LOGDIR}/error.report" -FullCsvReport="${LOGDIR}/regression-$LOGPOSTFIX.csv" -rm -f "${RUN_REPORT}" -TESTDIRS="$@" -for tDir in ${TESTDIRS}; do - TESTDIR="${LOGDIR}/${tDir}" - if [ -d "${TESTDIR}" ]; then - REPORT="${TESTDIR}/error.report" - CSVREPORT="${TESTDIR}/regression.csv" - TESTNAME="`basename "${TESTDIR}"`" - if [ -f "${GF_JAVA}" ]; then - runLatestProp - else - echo "GF_JAVA.WIN variable is not set" - fi - CP_PATH="$GFE_DIR/lib/gemfire.jar;$GFE_DIR/../tests/classes" - TEMPDIRPATH="${TESTDIR}" - if type -p cygpath >/dev/null 2>/dev/null; then - CP_PATH="`cygpath -m "$CP_PATH"`" - TEMPDIRPATH="`cygpath -m "$TEMPDIRPATH"`" - fi - echo "===================================================" > "${REPORT}" - echo "Test results are in ${TESTDIR}" >> "${REPORT}" - echo "Ran test: ${TESTNAME}" >> "${REPORT}" - echo "Error Summary" >> "${REPORT}" - echo "===================================================" >> "${REPORT}" - grep "^\\[TEST:${TESTNAME}:.*TEST SUMMARY" "${TESTDIR}/Driver.log" | sed 's/\r$//' >> "${REPORT}" || echo "No SUMMARY lines found." >> "${REPORT}" - echo "===================================================" >> "${REPORT}" - echo "Suspect strings in Driver.log" >> "${REPORT}" - grep "^\\[TEST:${TESTNAME}:[eE]rror" "${TESTDIR}/Driver.log" | sed 's/\r$//' >> "${REPORT}" - echo "===================================================" >> "${REPORT}" - perl ${DIRNAME}/grepLogs.pl "${TESTDIR}" | sed 's/\r$//' >> "${REPORT}" 2>&1 - echo "===================================================" >> "${REPORT}" - echo "End of ${TESTNAME} test run." >> "${REPORT}" - echo "===================================================" >> "${REPORT}" - echo >> "${REPORT}" - echo >> "${REPORT}" - echo "The copy variable= $COPYON" >> "${REPORT}" - if [ "$PERFTEST" == "true" ] - then - echo ${GF_JAVA} -cp "$CP_PATH" -DJTESTS=$GFE_DIR/../tests/classes -Dgemfire.home=$GFE_DIR perffmwk.PerfReporter "${TEMPDIRPATH}" - ${GF_JAVA} -cp "$CP_PATH" -DJTESTS=$GFE_DIR/../tests/classes -Dgemfire.home=$GFE_DIR perffmwk.PerfReporter "${TEMPDIRPATH}" - ## COPYON variable to be set only when running perf tests using build targets. - if [ "$COPYON" == "true" ] - then - if [ ! -f ${TEMPDIRPATH}/../../summary.prop ] - then - cp -f ${TEMPDIRPATH}/latest.prop ${TEMPDIRPATH}/../../summary.prop - fi - cp -r ${TEMPDIRPATH} ${TEMPDIRPATH}/../../. - fi - fi - ${AWK:-awk} -F "=" '/^Name/ {print ""; next} {printf "%s,", $2} ' "${TESTDIR}/latest.prop" > "${CSVREPORT}" - TESTDATENTIME=`date +'%m/%d/%Y %T %Z'` - ls ${TESTDIR}/failure.txt > /dev/null 2>&1 - if [ $? -ne 0 ] - then - echo "$POOLOPTION,${TESTDIR},pass,CYG,$ARCH,$TESTDATENTIME" >> "${CSVREPORT}" - else - echo "$POOLOPTION,${TESTDIR},fail,CYG,$ARCH,$TESTDATENTIME" >> "${CSVREPORT}" - fi - cat "${REPORT}" >> "${RUN_REPORT}" - cat "${CSVREPORT}" >> "${FullCsvReport}" - if [ "$DBOPTION" == "true" ]; then - echo ${GF_JAVA} -cp "$LCP_PATH" testdb.insertRegressionData ${FullCsvReport} - ${GF_JAVA} -cp "$LCP_PATH" testdb.insertRegressionData ${FullCsvReport} - fi - fi -done http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/genCSV.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/genCSV.sh b/src/tests/cpp/scripts/genCSV.sh deleted file mode 100644 index 46362e9..0000000 --- a/src/tests/cpp/scripts/genCSV.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - - -showUsage() -{ - progName="`basename "$0"`" - echo "Usage: $progName [-l] OUTPUT FILE..." - echo " The first argument gives the output CSV file." - echo " One of more files to be scanned must be provided on the command-line." - echo " The optional -l option specifies that CSV for latency data should be" - echo " instead of the default perf data." -} - -getPerfData() -{ - echo 'Region Tag,Task,NumClients,NumKeys,Value Size,NumThreads,ops/sec,Total ops,Time(in micros),Completion time' - awk -F ',' '{ - if ($0 ~ /^\[PerfData\],/) { - for (indx = 2; indx < NF; indx++) { - if (indx == 4 && ($indx > 1000000 || $indx <= 0)) { - printf "*unknown*," - } else { - printf "%s,", $indx - } - } - print $NF - } - }' "$@" -} - -getLatencyData() -{ - echo 'Region Tag,MinLatency,MaxLatency,AvgLatency,No of samples' - sed -n 's/^.*LatencyCSV,MinMaxAvgSamples,//p' "$@" -} - - -getLData="" -numArgs=0 -while getopts ":l:" op; do - case "${op}" in - ("l") getLData="true" ;; - (*) echo "Unknown argument -${OPTARG}." && showUsage && exit 1 ;; - esac - ((numArgs++)) -done - -while [ ${numArgs} -gt 0 ]; do - shift - ((numArgs--)) -done - -[ $# -lt 2 ] && showUsage && exit 1 - -outFile="$1" -shift - -if [ -z "${getLData}" ]; then - getPerfData "$@" > "${outFile}" -else - getLatencyData "$@" > "${outFile}" -fi http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/genericFunctions.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/genericFunctions.sh b/src/tests/cpp/scripts/genericFunctions.sh deleted file mode 100644 index e7f4c6b..0000000 --- a/src/tests/cpp/scripts/genericFunctions.sh +++ /dev/null @@ -1,203 +0,0 @@ - - -## Create the file to use for logging. -## Args: one, the name of the log file to create. -INITLOG() { - export LOGFILE=$1 - echo > $LOGFILE - if [ "${LOG_MESSAGES:-none}" != "none" ] - then - echo -en $LOG_MESSAGES | tee -a $LOGFILE - LOG_MESSAGES= - fi -} - -## Log a warning message -## Args: the message to log. -WARN() { - local ts=`date +'%y-%m-%d_%H-%M-%S'` - if [ ${LOGFILE:-none} == "none" ] - then - LOG_MESSAGES="${LOG_MESSAGES}${ts} WARN: $*\n" - fi - echo -e "${ts} WARN: $*" | tee -a $LOGFILE -} - -## Log a warning message -## Args: file to log to, the message to log. -WARNTO() { - local fil=$1 - shift - local ts=`date +'%y-%m-%d_%H-%M-%S'` - echo -e "${ts} WARN: $*" >> $fil -} - -## Log an error message -## Args: the message to log. -ERROR() { - local ts=`date +'%y-%m-%d_%H-%M-%S'` - if [ ${LOGFILE:-none} == "none" ] - then - LOG_MESSAGES="${LOG_MESSAGES}${ts} ERROR: $*\n" - fi - echo -e "${ts} ERROR: $*" | tee -a $LOGFILE -} - -## Log a debug message -## Args: the message to log. -DEBUG() { - if [ ${DEBUG:-0} -eq 1 ] - then - local ts=`date +'%y-%m-%d_%H-%M-%S'` - if [ ${LOGFILE:-none} == "none" ] - then - LOG_MESSAGES="${LOG_MESSAGES}${ts} DEBUG: $*\n" - fi - echo -e "${ts} DEBUG: $*" | tee -a $LOGFILE - fi -} - -## Log a message -## Args: the message to log. -LOG() { - local ts=`date +'%y-%m-%d_%H-%M-%S'` - if [ ${LOGFILE:-none} == "none" ] - then - LOG_MESSAGES="${LOG_MESSAGES}${ts} INFO: $*\n" - fi - echo -e "${ts} INFO: $*" | tee -a $LOGFILE -} - -## Log a message -## Args: file to log to, the message to log. -LOGTO() { - local fil=$1 - shift - local ts=`date +'%y-%m-%d_%H-%M-%S'` - echo -e "${ts} INFO: $*" >> $fil -} - -## Log the content of a file -## Args: the file to log -LOGCONTENT() { - local fil=$1 - if [ ${fil:-none} == "none" ] - then - WARN "No file specified in call to LOGCONTENT." - fi - if [ ! -f $fil ] - then - WARN "File specified in call to LOGCONTENT cannot be found." - fi - LOG "Content of $fil:" - while read lin - do - LOG " $lin" - done < $fil -} - -## Log standard input -## Args: the command whose output should be logged, if none given, stdin is read -LOGSTDIN() { - local cmd="$*" - if [ "${cmd:-none}" == "none" ] - then - while read lin - do - LOG $lin - done - else - $cmd | while read lin - do - LOG $lin - done - fi -} - -TRACE_ON() { - if [ ${TRACE:-0} -eq 1 ] - then - set -x - fi -} - -TRACE_OFF() { - set +x -} - -## Change directory without the path being displayed -## Args: the directory to cd to. -chdir() { - cd $1 > /dev/null -} - -## Generate a random number between min and max, inclusive -## Args: three: min max varname -## the random value will be available as $varname. -random() { - if [ ${randval:--1} -eq -1 ] # First time we have called this function - then # So we seed the sequence - # the pipe to bc is required because date will sometimes return a number - # with a leading 0, but is not a valid octal number - ((RANDOM=( ( `date +'%S' | bc` + 1 ) * $$ ) + `date +'%j' | bc` )) - fi - min=$1 - max=$2 - val=$3 - ## $RANDOM will be between 0 and 32767 inclusive - ##randval=`echo "( ( $RANDOM * ( $max - $min ) ) / 32767 ) + $min" | bc` - ((randval=( ( $RANDOM * ( $max - $min + 1 ) ) / ( 32767 + 1 ) ) + $min )) - export $val=$randval -} - -## Terminate the script that calls this function -## Args: none. -terminate() { - LOG "Exiting ..." - kill $$ >/dev/null 2>&1 - kill -9 $$ >/dev/null 2>&1 -} - -## Report a problem, execute a cleanup function, and terminate the calling script. -badcmd() { - trap '' 1 SIGINT 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ERR EXIT - ERROR "Failure at line $LINENO of $0" - ERROR "Cleaning up ..." - fnam=`declare -F cleanup` - if [ ${fnam:-none} != "none" ] - then - cleanup - fi - ERROR "Test run terminating" - ERROR `date` - trap - 1 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ERR EXIT - trap terminate SIGINT ERR EXIT - terminate -} - -## Set RETVAL to be the number of arguments passed -## Args: any number of anything -argCount() { - export RETVAL=$# -} - -## Set RETVAL to 1 if the first args is also in the remaining args, 0 otherwise -contains() { - RETVAL=0 - if [ $# -lt 2 ] - then - return - fi - local target=$1 - shift - for id in $* - do - if [ $id == $target ] - then - RETVAL=1 - return - fi - done -} - - http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/killJavaServer.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/killJavaServer.sh b/src/tests/cpp/scripts/killJavaServer.sh deleted file mode 100644 index c4cac95..0000000 --- a/src/tests/cpp/scripts/killJavaServer.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -checkRunning() { - if [ "${myOS}" = "CYG" ]; then - $killCmd -0 $1 2>&1 | grep -q 'kill:' - else - $killCmd -0 $1 2>/dev/null - fi - echo $? -} - -killIt() { - sig=$1 - kpid=$2 - - waitCnt=1 - stillRunning="`checkRunning $kpid`" - while [ $stillRunning -eq 0 ] - do - if [ $waitCnt -gt 4 ] - then - $killCmd -9 $kpid >/dev/null 2>&1 - break - else - $killCmd $sig $kpid >/dev/null 2>&1 - fi - ((waitCnt++)) - sleep 5 - stillRunning="`checkRunning $kpid`" - done -} - -# Signal to use: -signal=$1 -signal=${signal:-15} - -# Server start directory -tdir="$2" - -AWK=`which nawk 2>/dev/null` -myOS=`uname | tr "cyglinsu" "CYGLINSU" | cut -b1-3` - -killCmd="kill" -if [ "${myOS}" = "CYG" ] -then - killCmd="/bin/kill -f" -fi - -if [ -d "${tdir}" ]; then - killpid="`grep "Process ID:" "${tdir}/cacheserver.log" | ${AWK:-awk} '{print $3}'`" - killIt -${signal} ${killpid} - rm -f "${tdir}/.cacheserver.ser" -fi http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/killJavaServers.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/killJavaServers.sh b/src/tests/cpp/scripts/killJavaServers.sh deleted file mode 100644 index ed3212a..0000000 --- a/src/tests/cpp/scripts/killJavaServers.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -## This script allows an optional -t {tag_label} argument, to allow separation between different sets of servers. -## It also allows an optional count of servers to be specified, -c count with the default being 1. -## These arguments, if used, must be before any other arguments. -tag="" -numServers=1 -while getopts ":t:c:" op -do - case $op in - ( "t" ) ((scnt++)) ; tag="$OPTARG" ;; - ( "c" ) ((scnt++)) ; numServers="$OPTARG" ;; - ( * ) echo "Unknown argument provided: -$OPTARG, ignoring." ; echo "" ;; - esac - ((scnt++)) -done - -while [ ${scnt:-0} -gt 0 ] -do - shift - ((scnt--)) -done - -## This script expects two arguments, the "number" of the server to kill -## And the signal to kill it with -## If no argument is given all servers will be killed with a 15. - -## This script expects the environment to have the following variables set: -## GFE_COUNT -- the number of servers to use, default is one. -## GFE_DIR -- location of the GFE Java build - -# Server to stop: -server=$1 -shift - -# Signal to use: -signal=$1 -signal=${signal:-15} - -# GFE Build location -gfeProd=${GFE_DIR:-""} - -# Base for dir names -gfdb=GFECS${tag:+_}$tag - -##set -x - -if [ ${server:-0} -gt 0 ] -then - tdir=${gfdb}_$server - killJavaServer ${signal} ${tdir} - exit 0 -fi - -# Number of servers to stop: -cnt=$numServers - -while [ ${cnt:-0} -gt 0 ] -do - tdir=${gfdb}_$cnt - killJavaServer ${signal} ${tdir} - ((cnt--)) -done http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/nightly-batch.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/nightly-batch.sh b/src/tests/cpp/scripts/nightly-batch.sh deleted file mode 100755 index a61415d..0000000 --- a/src/tests/cpp/scripts/nightly-batch.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/bash -echo "This script has not been updated!" -exit - -function buildResult { -if [ $# -eq 0 ] -then - BUILDRESULT="" - return -fi - -if [ -z "$BUILDRESULT" ] -then - sep="" -else - sep="," -fi - -case $1 in - 0) - ;; - 1) BUILDRESULT="${BUILDRESULT}$sep $1 ${2}" - ;; - *) BUILDRESULT="${BUILDRESULT}$sep $1 ${2}s" - ;; -esac -} - -function timeBreakDown { - ((tot=$2-$1)) - ((day=$tot/86400)) - ((dayR=$tot%86400)) - ((hr=$dayR/3600)) - ((hrR=$dayR%3600)) - ((min=$hrR/60)) - ((sec=$hrR%60)) - - buildResult - buildResult $day day - buildResult $hr hour - buildResult $min minute - buildResult $sec second - TIMEBREAKDOWN=$BUILDRESULT -} - -# Set CHECKOUT to the checkout toplevel directory -JNK=`/usr/bin/dirname $0` -OLDPWD=$PWD -# go back three dirs. -cd `/usr/bin/dirname $JNK`/.. -export CHECKOUT=$PWD -cd $OLDPWD - -## cmd <framework-dir> <result-dir> <batch-list> <host> ... - -FRAMEWORK=${1:-baddir} -shift - -if [ ! -e "$FRAMEWORK/scripts/runDriver" ]; then - echo "First argument must be path to built framework directory" - exit 1 -fi - -RESULTDIR=${1:-baddir} -shift - -BATCHLIST=${1:-baddir} -shift - -if [ ! -f "$BATCHLIST" ]; then - echo "Third argument must be path to a batch list, containing the xml names to run." - exit 1 -fi - -if [ ! -e "$RESULTDIR" ]; then - echo "Creating result directory: $RESULTDIR" - mkdir -p $RESULTDIR -fi - -XMLFILES=`cat $BATCHLIST` - -cd $RESULTDIR - -REPORT="$PWD/error.report" - -rm -f $REPORT - -echo "Test results are in " `pwd` -echo "" -echo "C++ Regression Error Report" >$REPORT -echo "---------------------------" >>$REPORT - -dayOfWeek=`date +'%u'` -((calcDay=($dayOfWeek/2)*2)) -if [ $dayOfWeek -eq $calcDay ] -then - echo "" - echo "Will use static libraries for test run." - echo "" - staticArg="-s" -else - staticArg="" -fi - -xcnt=0 -for xml in $XMLFILES; do - # set marker file to find directory that is newer than it. - # run the xml - echo "" >>$REPORT - echo "" >>$REPORT - echo "" >>$REPORT - echo "#########################################################" >>$REPORT - echo "## $xml" >>$REPORT - echo "#########################################################" >>$REPORT - echo "Starting test: $xml" - start=`date +'%s'` - ((xcnt=$xcnt+1)) - export LOGPREFIX=`basename $xml .xml`_ - rundir=${LOGPREFIX}run_0 - $FRAMEWORK/scripts/runDriver $xml 1 $staticArg $* > /dev/null - if [ -d $rundir ] - then - cd $rundir - ./stopAll - grep SUMMARY Driver.log >>$REPORT - perl $CHECKOUT/release/build/grepLogs.pl $PWD >>$REPORT 2>&1 - cd - - else - echo "Failed to find $rundir." >>$REPORT - fi - end=`date +'%s'` - timeBreakDown $start $end - echo " Test $xml used: $TIMEBREAKDOWN" - echo "" -done - -echo "" >>$REPORT -echo "" >>$REPORT -echo "" >>$REPORT -echo "#########################################################" >>$REPORT -echo "## Completed. Processed $xcnt xml files." >>$REPORT -echo "#########################################################" >>$REPORT - -MAILTO="tim.ke...@gemstone.com sudhir.me...@gemstone.com matthew.spl...@gemstone.com qing...@gemstone.com j...@gemstone.com" -mail -s "Nightly regression test run." $MAILTO < $REPORT http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/piper.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/piper.sh b/src/tests/cpp/scripts/piper.sh deleted file mode 100644 index 723f0c3..0000000 --- a/src/tests/cpp/scripts/piper.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - - -AWK=`which nawk 2>/dev/null` -lname=`hostname` -hst=`nslookup $lname 2>/dev/null | ${AWK:-awk} '/^Name:/{print $2}'` - -source $BASEDIR/envs/${hst}_env -source $BASEDIR/gfcpp.env - -goHost() { - ## set -x - local host=$1 - shift - local cmd="$*" - ## echo "In piper:goHost cmd is:: $cmd ::" - if [ "${cmd:-none}" == "none" ] - then - echo "Empty command passed to goHost" - return - fi - local ev="`cat $BASEDIR/envs/extra_env $BASEDIR/envs/${host}_env`" - ## echo "piper:goHost: ssh -A -x -q -f $host \"$ev $cmd \" " - ssh -o "NumberOfPasswordPrompts 0" -A -x -f $host "$ev $cmd &" - ## echo "piper:goHost complete" - ## set +x -} - -while [ "${cmd:-NULL}" != "exit" ] -do - if [ "${cmd:-NULL}" != "NULL" ] - then - $cmd & - fi - date | tr -d '\n' ; echo " Waiting..." - read cmd - res=$? - if [ $res -ne 0 ] - then - cmd=exit - fi - date | tr -d '\n' ; echo " Read ::$cmd::" -done -echo "Pipe process exiting." http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runBatch.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runBatch.sh b/src/tests/cpp/scripts/runBatch.sh deleted file mode 100755 index c4afad2..0000000 --- a/src/tests/cpp/scripts/runBatch.sh +++ /dev/null @@ -1,311 +0,0 @@ -#!/bin/bash -echo "This script has not been updated!" -exit - - -function processArgs { - if [ $# -eq 0 ]; then - usage - fi - - while getopts ":zp:d:h:m:l:x:o:" op - do - - unset SINGLETEST - unset TESTLIST - unset TESTHOSTSFILE - unset mailtmp - - case $op in - ( "o" ) if ( echo $OPTARG | grep '^-' > /dev/null ); then - echo "ERROR: -o option must have a file argument that does not s -tart with \"-\"" - errorDetected=1 - fi - ;; - ( "p" ) BUILDDIR=$OPTARG ;; - ( "d" ) TESTSRESULTSDIR=$OPTARG ;; - ( "h" ) TESTHOSTSFILE=$OPTARG ;; - ( "m" ) mailtmp=$OPTARG ;; - ( "l" ) if [ "x$resetXML" = "x1" ]; then - unset SINGLETESTS - TESTLISTS=$OPTARG - resetXML=0 - else - TESTLISTS="$TESTLISTS $OPTARG" - fi - ;; - ( "x" ) if [ "x$resetXML" = "x1" ]; then - SINGLETESTS=$OPTARG - unset TESTLISTS - resetXML=0 - else - SINGLETESTS="$SINGLETESTS $OPTARG" - fi - ;; - ( "z" ) resetXML=1 ;; - ( * ) echo "Unknown argument provided: -$OPTARG, ignoring." ; echo "" ;; - esac - - # Build up a list of mail recipients - if [ ! -z "$mailtmp" ]; then - MAILTO="$MAILTO $mailtmp" - fi - - # Build up a list of hosts - if [ ! -z "$TESTHOSTSFILE" ]; then - TESTHOSTS="$TESTHOSTS `cat $TESTHOSTSFILE | tr '\n' ' '`" - fi - done - - # This section of code passes all remaining arguments to the TESTHOSTS list - while [ $OPTIND -gt 1 ] - do - shift - ((OPTIND--)) - done - if [ $# -ne 0 ]; then - TESTHOSTS="$TESTHOSTS $*" - fi - - # Check for remaining required settings - if [ -z "$BUILDDIR" ]; then - echo "OPTIONS error: must specify a path to the build directory with -p" - errorDetected=1 - elif [ -z "$TESTSRESULTSDIR" ]; then - echo "OPTIONS error: must specify a path to the test results directory with -d" - errorDetected=1 - fi - - FRAMEWORK=$BUILDDIR/framework - TESTHOSTS=${TESTHOSTS:-"localhost"} - MAILTO=${MAILTO:-"NO_MAIL"} -} - -function usage { - cat<<__USAGE__ -typical usages: - tests/scripts/nightly-batch.sh -o tests/scripts/cronbeaverton.txt - OR - tests/scripts/nightly-batch.sh -p <source path> -d <results path> -l <test list> -m <email address> host1 ... hostn ------------------------------- - -h <file> - @@ name of file containing hosts to use in test, optional - @@ Any left over arguments on the command line are assumed to be hostnames - -m <mail recipient> - @@ name of mail recipient, can be used multiple times - -x <xml test file> - @@ specify a single xml test - -l <text file> - @@ file containing list of xml tests to run - -d <test results directory> - @@ location where testing results are stored, mult be absolute path - -p <build directory> - @@ This is a path to the top directory of your source checkout - -o <file to take commandline options from> - @@ lines where the very first character is '#' are treated as comments - @@ Any -x or -l settings on the command line will override these settings -__USAGE__ - exit 1 -} - -function showsettings { - NUMBER_OF_XML=`echo "$XMLFILES" | wc -w | tr -d ' '` - echo "$XMLFILES" -cat<<__SETTINGS__ - BUILDDIR => $BUILDDIR - TESTSRESULTSDIR => $TESTSRESULTSDIR - MAILTO => $MAILTO - TESTHOSTS => $TESTHOSTS - NUMBER_OF_XML => $NUMBER_OF_XML -__SETTINGS__ -} - -function buildResult { - if [ $# -eq 0 ]; then - BUILDRESULT="" - return - fi - - if [ -z "$BUILDRESULT" ]; then - sep="" - else - sep="," - fi - - case $1 in - 0) ;; - 1) BUILDRESULT="${BUILDRESULT}$sep $1 ${2}" ;; - *) BUILDRESULT="${BUILDRESULT}$sep $1 ${2}s" ;; - esac -} - -function timeBreakDown { - # Note: this wont work unless using GNU date because the %s format - # isn't supported on most implimentations of date - ((tot=$2-$1)) - ((day=$tot/86400)) - ((dayR=$tot%86400)) - ((hr=$dayR/3600)) - ((hrR=$dayR%3600)) - ((min=$hrR/60)) - ((sec=$hrR%60)) - - buildResult - buildResult $day day - buildResult $hr hour - buildResult $min minute - buildResult $sec second - TIMEBREAKDOWN=$BUILDRESULT -} - -function runTests { - - if [ ! -e "$FRAMEWORK/scripts/runDriver" ]; then - echo "Problem finding runDriver in \"$FRAMEWORK/scripts\"" - echo "Check your -p <build directory> setting" - exit 1 - fi - - - OUTDIR=$TESTSRESULTSDIR/`date +'%y-%m-%d_%H-%M-%S_'`regression-results - if [ ! -e "$OUTDIR" ]; then - echo "Creating result directory: $OUTDIR" - mkdir -p $OUTDIR - fi - - echo "cding into OUTDIR \"$OUTDIR\"" - cd $OUTDIR - - REPORT="$OUTDIR/error.report" - - echo "Test results are in $OUTDIR" - echo "" - echo "C++ Regression Error Report" >$REPORT - echo "---------------------------" >>$REPORT - - # This code changes the staticArg based on if today is an - # even or odd numbered day of the week - dayOfWeek=`date +'%u'` - ((calcDay=($dayOfWeek/2)*2)) - if [ $dayOfWeek -eq $calcDay ]; then - echo "" - echo "Will use static libraries for test run." - echo "" - staticArg="-s" - else - staticArg="" - fi - - rm -f $REPORT - - xcnt=0 - for xml in $XMLFILES; do - # set marker file to find directory that is newer than it. - # run the xml - cat<<__REPORT_TXT__ >> $REPORT - - - -######################################################### -### $xml -######################################################### -__REPORT_TXT__ - echo "Starting test: $xml" - start=`date +'%s'` - ((xcnt=$xcnt+1)) - export LOGPREFIX=`basename $xml .xml`_ - rundir=${LOGPREFIX}run_0 - echo "running $FRAMEWORK/scripts/runDriver $xml 1 $staticArg $TESTHOSTS" - $FRAMEWORK/scripts/runDriver $xml 1 $staticArg $TESTHOSTS > /dev/null - if [ -d $rundir ]; then - cd $rundir - ./stopAll - grep SUMMARY Driver.log >>$REPORT - perl $FRAMEWORK/scripts/grepLogs.pl $PWD >>$REPORT 2>&1 - cd - - else - echo "Failed to find $rundir." >>$REPORT - fi - end=`date +'%s'` - timeBreakDown $start $end - echo " Test $xml used: $TIMEBREAKDOWN" - echo "" - done - - cat<<__REPORT_END__ >> $REPORT - - - -######################################################### -## Completed. Processed $xcnt xml files. -######################################################### -__REPORT_END__ - if [ "x$MAILTO" != "xNO_MAIL" ]; then - # This is not perfect, but it works. NOTE: You canoot use the -n flag - # if you do it will ignore the cat stream and you get an empty email. - cat $REPORT | ssh zeus "/usr/ucb/mail -s 'Nightly regression test run.' $MAILTO" - else - echo "INFO: Skipping mail step because no email address was specified." - fi - -} - - -###--------------------- Main ----------------------------### - -# Clear settings that may have carried over from the environment -unset TESTHOSTS -unset MAILTO - -# Detect the presence of an options file and add its contents to the -# begining of the argument list. This way other command line -# arguments take precendence - -optionsFile=`echo "$*" | sed 's/.*-o \([^-][^ ]*\).*/\1/'` -if ( echo "$*" | grep -- "-o" > /dev/null ); then - if [ -f "$optionsFile" ]; then - additionalArgs=`grep -v '^#' $optionsFile | tr '\n' ' '` - fi -fi - -# The -z is a special switch to notify the parser that we have stopped -# parsing the options file contents. This is relevant in the case of the -# options that can be concatinated like -x and -l -processArgs $additionalArgs -z $* - -# Now we can build the XML list because FRAMEWORK is defined -if [ ! -z "$SINGLETESTS" ]; then - XMLFILES="$SINGLETESTS" -fi -if [ ! -z "$TESTLISTS" ]; then - for list in $TESTLISTS ; do - if [ -f "$list" ]; then - XMLFILES="$XMLFILES `cat $list | tr '\n' ' '`" - elif [ -f "$FRAMEWORK/xml/$list" ]; then - XMLFILES="$XMLFILES `cat $FRAMEWORK/xml/$list | tr '\n' ' '`" - else - echo "OPTIONS error: bad argument supplied to -l" - echo "Could not find the test list \"$list\" in either \".\" or \"$FRAMEWORK/xml/$list\"" - errorDetected=1 - fi - done -fi - -if [ -z "$XMLFILES" ]; then - echo "OPTIONS error: must have at least one test specified." - echo "Use either the -x <XML file> or -l <file based list of XML files>" - errorDetected=1 -fi - -if [ "x$errorDetected" = "x1" ]; then - echo "Exiting due to previous options error:" - usage -fi - -showsettings - -# In the previous version output was redirected like this, -# I'm not sure if that is desireable though -# runTests | tee $OUTDIR/cronreg.log 2>&1 -runTests http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runBuild.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runBuild.sh b/src/tests/cpp/scripts/runBuild.sh deleted file mode 100755 index 2227341..0000000 --- a/src/tests/cpp/scripts/runBuild.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -echo "This script has not been updated!" -exit - -function processArgs { - if [ $# -eq 0 ]; then - usage - fi - - while getopts ":B:p:m:o:" op - do - - unset mailtmp - - case $op in - ( "o" ) if ( echo $OPTARG | grep '^-' > /dev/null ); then - echo "ERROR: -o option must have a file argument that does not start with \"-\"" - errorDetected=1 - fi - ;; - ( "B" ) BUILDHOST=$OPTARG ;; - ( "p" ) BUILDDIR=$OPTARG ;; - ( "m" ) mailtmp=$OPTARG ;; - ( * ) echo "Unknown argument provided: -$OPTARG, ignoring." ; echo "" ;; - esac - - # Build up a list of mail recipients - if [ ! -z "$mailtmp" ]; then - MAILTO="$MAILTO $mailtmp" - fi - - done - - # Set defaults - BUILDHOST=${BUILDHOST:-"localhost"} - - # Check for remaining required settings - if [ -z "$BUILDDIR" ]; then - echo "OPTIONS error: must specify a path to the build directory with -p" - errorDetected=1 - fi - - MAILTO=${MAILTO:-"NO_MAIL"} -} - -function usage { - cat<<__USAGE__ -typical usages: - tests/scripts/nightly-batch.sh -B <machine> -p <source path> -m <email> ------------------------------- - -m <mail recipient> - @@ name of mail recipient, can be used multiple times - -p <build directory> - @@ This is a path to the top directory of your source checkout - -B <machine to build on> - @@ defaults to localhost - -o <file to take commandline options from> - @@ lines where the very first character is '#' are treated as comments -__USAGE__ - exit 1 -} - -function showsettings { - NUMBER_OF_XML=`echo "$XMLFILES" | wc -w | tr -d ' '` - echo "$XMLFILES" -cat<<__SETTINGS__ - BUILDHOST => $BUILDHOST - BUILDDIR => $BUILDDIR - MAILTO => $MAILTO -__SETTINGS__ -} - -function makeBuild { - echo "Updating checkout and beginning clean build at " `date` - ssh -x -q $BUILDHOST "cd $BUILDDIR && git pull && ./build.sh clean product tests ; if [ $? -eq 0 ]; then echo 'Build successful.'; else echo 'Build failed.'; fi" > build${BUILDHOST}.log 2>&1 - ssh -x -q $BUILDHOST "cd $BUILDDIR && cat build-artifacts/lastUpdate.txt" - echo "Build complete at " `date` - echo "" -} - - -###--------------------- Main ----------------------------### - -# Clear settings that may have carried over from the environment -unset BUILDHOST -unset MAILTO - -# Detect the presence of an options file and add its contents to the -# begining of the argument list. This way other command line -# arguments take precendence - -optionsFile=`echo "$*" | sed 's/.*-o \([^-][^ ]*\).*/\1/'` -if ( echo "$*" | grep -- "-o" > /dev/null ); then - if [ -f "$optionsFile" ]; then - additionArgs=`grep -v '^#' $optionsFile | tr '\n' ' '` - fi -fi - -processArgs $additionalArgs $@ -if [ "x$errorDetected" = "x1" ]; then - echo "Exiting due to previous options error:" - usage -fi - -makeBuild - -if [ "x$MAILTO" != "xNO_MAIL" ]; then - # This is not perfect, but it works. NOTE: You canoot use the -n flag - # if you do it will ignore the cat stream and you get an empty email. - cat build${BUILDHOST}.log | ssh -x -q zeus "/usr/ucb/mail -s 'Nightly regression test run.' $MAILTO" -else - echo "INFO: Skipping mail step because no email address was specified." -fi http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runCPPCSDriver.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runCPPCSDriver.sh b/src/tests/cpp/scripts/runCPPCSDriver.sh deleted file mode 100755 index d5fc9e0..0000000 --- a/src/tests/cpp/scripts/runCPPCSDriver.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash - - -getPath() -{ - if uname | grep '^CYGWIN' >/dev/null 2>/dev/null; then - cygpath "$1" - else - echo "$1" - fi -} - -showUsage() -{ - echo -e "Usage: ${scriptName} [OPTION] [<host1> ...]"; - echo -e " Options and hosts are specified the same as to the runDriver script."; -} - - -# Initialization - -scriptLocation="`getPath "$0"`" -scriptDir="`dirname "${scriptLocation}"`" -scriptName="`basename "${scriptLocation}"`" -csharpDir="${scriptDir}/../csharp/bin" - -CSBBDIR="${csharpDir}" -export CSBBDIR - -if [ -r "${csharpDir}/runCSFunctions.sh" ]; then - source "${csharpDir}/runCSFunctions.sh" -else - echo "Could not read the runCSFunctions.sh script." - exit 1 -fi - - -# Parse the command-line - -argNum=1 -while [ "${argNum}" -le $# ]; do - arg="`eval echo \\${${argNum}}`" - case "${arg}" in - --*) ;; - -*) ((argNum++)) ;; - *) break ;; - esac - ((argNum++)) -done - -# Get the hostnames - -numHosts=0 -numGroups=0 -export numHosts numGroups -parseHosts "${argNum}" "$@" - -# Use the local machine in the special "CSD" group -# when none is provided on command-line -csdHost= -csdIndex="`searchArray hostGroups CSD`" -if [ "${csdIndex}" -le 0 ]; then - thisHost="`getHostName`" - csdHost="CSD:${thisHost}" - thisHost="`nslookup ${thisHost} 2>/dev/null | awk '/^Name:/{print $2}'`" - ((numHosts++)) - hostNames[${numHosts}]="${thisHost}" - ((numGroups++)) - hostGroups[${numGroups}]="CSD" -fi - -bbPort="`getOpenPort`" - -# Start the FwkBBServer - -CSFWK_BBADDR="`getIPAddress`:${bbPort}" -export CSFWK_BBADDR -echo "CSFWK_BBADDR=\"${CSFWK_BBADDR}\"" > gfcppcsharp.env -echo "export CSFWK_BBADDR" >> gfcppcsharp.env - -"${csharpDir}/FwkBBServer" "${bbPort}" & - -# Set the trap to exit cleanly closing the C# BBserver and Driver -trap "stty echo; source gfcppcsharp.env; [ -n \"\${CSFWK_BBADDR}\" ] && echo Before exit: Terminating the BB server... && \"${csharpDir}/FwkBBClient\" quit; [ -n \"\${CSFWK_DRIVERADDR}\" ] && echo Before exit: Terminating the Driver... && \"${csharpDir}/FwkBBClient\" termDriver 2>/dev/null; exit 0" SIGINT SIGTERM - -# Sleep for some time to let the BB server start -sleep 5 - - -# Get the passwords from the user and write to BB - -writePasswordsToBB - -echo -echo "Starting runDriver." -echo - -"${scriptDir}/runDriver" "$@" ${csdHost} - -echo -echo Terminating the BB server... -echo -"${csharpDir}/FwkBBClient" quit http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runCSDriver.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runCSDriver.sh b/src/tests/cpp/scripts/runCSDriver.sh deleted file mode 100755 index b3229f3..0000000 --- a/src/tests/cpp/scripts/runCSDriver.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -#set -x -getPath() -{ - if uname | grep '^CYGWIN' >/dev/null 2>/dev/null; then - cygpath "$1" - else - echo "$1" - fi -} - -showUsage() -{ - echo -e "Usage: ${scriptName} [OPTION] [<host1> ...]"; - echo -e " <host1> ... are (optional) hostnames of the machines on which to distribute the clients"; - echo -e " Each host can optionally have the hostGroup name prefixed to it with ':'"; - echo -e " e.g. CS:host1; the hostGroup should not be '*' which implicitly stands for all hosts"; - echo -e "Options are:"; - echo -e " --xml=FILE \t\t An XML file having the test to be executed."; - echo -e "\t\t\t This option can be specified multiple times"; - echo -e " --list=FILE \t\t A file containing a list XML files having the tests to be executed"; - echo -e " --pool=POOLOPTION \t\t where POOLOPTIONs are poolwithendpoints/poolwithlocator"; - echo -e " --sleep=SECS \t\t The seconds for which to sleep before executing the regression test"; - echo -e " --at=TIME \t\t The time at which to execute the regression test"; - echo -e " --database \t\t This to be used for upload the data in database for regression history. Need to be mentioned at every regression run."; - echo -e " --auto-ssh \t\t Use ssh configured for passwordless login instead of plink as remote shell" - echo -e "\t\t\t Note that this shall only work if sshd is running as a domain user having" - echo -e "\t\t\t permissions to access network shares and other resources on given hosts." - echo -e " --skip-report \t Skip error.report generation" - echo -e "At least one XML file should be specified using one of --xml or --list options"; - echo -e "Both options can be provided in which case all the specified tests in both will be run."; -} - - -# Initialization - -scriptLocation="`getPath "$0"`" -scriptDir="`dirname "${scriptLocation}"`" -scriptName="`basename "${scriptLocation}"`" - -CSBBDIR="${scriptDir}" -export CSBBDIR - -if [ -r "${scriptDir}/runCSFunctions.sh" ]; then - source "${scriptDir}/runCSFunctions.sh" -else - echo "Could not read the runCSFunctions.sh script." - exit 1 -fi - - -# Parse the command-line - -# Get the options - -xmlList= -xmlListList= -poolopt= -export DBOPTION="false" -useAutoSsh=false -argNum=1 -sleepSecs=0 -ARGS= -while true; do - skipArg=false - getOption "`eval echo \\${${argNum}}`" - if [ -z "${OPTNAME}" ]; then - break - fi - case "${OPTNAME}" in - xml) xmlList="`addList "${xmlList}" "${OPTVAL}"`" ;; - list) xmlListList="`addList "${xmlListList}" "${OPTVAL}"`" ;; - pool) poolopt="`addList "${poolopt}" "${OPTVAL}"`" - ;; - database) DBOPTION="true";; - auto-ssh) useAutoSsh=true ;; - at | skip-report) ;; - sleep) sleepSecs="${OPTVAL}" && skipArg=true ;; - *) echo "Unknown option [${OPTNAME}]." && echo && showUsage && exit 1 ;; - esac - if [ "${skipArg}" != "true" ]; then - ARGS="${ARGS} `eval echo \\${${argNum}}`" - fi - ((argNum++)) -done - -# Verify validity of options - -if [ -z "${xmlList}" -a -z "${xmlListList}" ]; then - echo "No xml file provided." && echo && showUsage && exit 1 -fi - - -# Get the hostnames - -parseHosts "${argNum}" "$@" - - -bbPort="`getOpenPort`" -driverPort="`getOpenPort`" - -# Start the FwkBBServer -set -m - -CSFWK_BBADDR="`getIPAddress`:${bbPort}" -export CSFWK_BBADDR -CSFWK_DRIVERADDR="`getIPAddress`:${driverPort}" -export CSFWK_DRIVERADDR -"${scriptDir}/FwkBBServer" "${bbPort}" & - -# Set the trap to exit cleanly -trap "stty echo; if [ -n \"\${driverPID}\" ]; then echo Terminating the driver...; echo; \"${scriptDir}/FwkBBClient\" termDriver; wait \${driverPID}; fi; echo Terminating the BB server...; \"${scriptDir}/FwkBBClient\" quit; echo; exit 0" SIGINT SIGTERM - -# Sleep for some time to let the BB server start -sleep 5 - - -# Get the passwords from the user and write to BB - -loginOpts= -if [ "${useAutoSsh}" = "true" ]; then - checkLogin -else - writePasswordsToBB - loginOpts="--bbPasswd" -fi - -if [ "${sleepSecs}" -gt 0 ]; then - echo "Sleeping for ${sleepSecs} secs..." - sleep "${sleepSecs}" -fi - -echo -echo "Starting FwkDriver." -echo - -"${scriptDir}/FwkDriver" "--bbServer=${CSFWK_BBADDR}" ${loginOpts} "--driverPort=${driverPort}" ${ARGS} ${HOSTS} & - -driverPID=$! -export driverPID -wait ${driverPID} - -# Ending the BB server... -"${scriptDir}/FwkBBClient" quit http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runCSFunctions.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runCSFunctions.sh b/src/tests/cpp/scripts/runCSFunctions.sh deleted file mode 100755 index c4eac45..0000000 --- a/src/tests/cpp/scripts/runCSFunctions.sh +++ /dev/null @@ -1,216 +0,0 @@ -#!/bin/bash - -# This script uses some bash specific constructs like arrays. - - -getOpenPort() -{ - openPorts="`netstat -an | sed -n 's/^[^\.]*[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+.\([0-9]\+\)[ \t]\+.*\(LISTEN\|ESTABLISH\).*$/\1/p' | sort -n | uniq`" - declare -a ports - for port in ${openPorts}; do - ports[${port}]=1 - done - found=false - while [ "${found}" = "false" ]; do - newPort="`expr ${RANDOM} % 10000 + 20000`" - if [ "${ports[${newPort}]}" != "1" ]; then - found=true - fi - done - unset ports - echo ${newPort} -} - -getOption() -{ - OPTNAME= - OPTVAL= - case "$1" in - --*) - OPTNAME="`echo "$1" | sed 's/^--//;s/=.*$//'`" - OPTVAL="`echo "$1" | cut -d '=' -f 2-2`" - ;; - esac -} - -getIPAddress() -{ - ipAddrs="`ipconfig 2>/dev/null | sed 's/\\r//g' | awk '/IP Address/ { print $NF }'`" - for ipAddr in ${ipAddrs}; do - hostName="`nslookup ${ipAddr} 2>/dev/null | sed 's/\\r//g' | awk '/^Name:/{print $2}'`" - if [ -n "${hostName}" ]; then - echo ${ipAddr} - break - fi - done -} - -getHostName() -{ - ipAddr="`getIPAddress`" - if [ -n "${ipAddr}" ]; then - nslookup ${ipAddr} 2>/dev/null | sed 's/\\r//g' | awk '/^Name:/{print $2}' - fi -} - -getHost() -{ - HNAME= - HGROUP= - case "$1" in - *:*) - HNAME="`echo "$1" | cut -d ':' -f 2-2`" - HGROUP="`echo "$1" | cut -d ':' -f 1-1`" - ;; - *) - HNAME="$1" - ;; - esac -} - -readPassword() -{ - PASSWD= - echo -n "Please enter the password: " - stty -echo - read PASSWD - stty echo - echo -} - -getHostType() -{ - plink -pw "${PASSWD}" "${USER}@$1" "uname" -} - -addList() -{ - if [ -z "$1" ]; then - echo "$2" - else - echo "$1,$2" - fi -} - -searchArray() -{ - arraySize="`eval echo \\${#$1[@]}`" - arrayIndex=1 - while [ "${arrayIndex}" -le "${arraySize}" ]; do - if [ "`eval echo \\${$1[${arrayIndex}]}`" = "$2" ]; then - echo ${arrayIndex} - return - fi - ((arrayIndex++)) - done - echo 0 -} - -writeBBConfigKeyVal() -{ - if [ -n "$1" -a -n "$2" ]; then - "${CSBBDIR}/FwkBBClient" set CONFIG "$1" "$2" - fi -} - -declare -a hostNames -declare -a hostGroups - -parseHosts() -{ - argNum="$1" - ((argNum++)) - numHosts=0 - numGroups=0 - HOSTS= - while true; do - getHost "`eval echo \\${${argNum}}`" - if [ -z "${HNAME}" ]; then - break - fi - if [ "${HGROUP}" = "*" ]; then - echo "Cannot use '*' as the hostGroup." && echo && showUsage && exit 1 - fi - if echo ${HNAME} | fgrep . >/dev/null; then - hostName="${HNAME}" - else - hostName="`nslookup ${HNAME} 2>/dev/null | sed 's/\\r//g' | awk '/^Name:/{print $2}'`" - fi - hostIndex="`searchArray hostNames "${hostName}"`" - if [ -z "${HGROUP}" ]; then - HOSTS="${HOSTS} ${hostName}" - else - HOSTS="${HOSTS} ${HGROUP}:${hostName}" - fi - if [ "${hostIndex}" -le 0 ]; then - ((numHosts++)) - hostNames[${numHosts}]="${hostName}" - fi - groupIndex="`searchArray hostGroups "${HGROUP}"`" - if [ "${groupIndex}" -le 0 ]; then - ((numGroups++)) - hostGroups[${numGroups}]="${HGROUP}" - fi - ((argNum++)) - done -} - -writePasswordsToBB() -{ - hostIndex=1 - numHosts="${#hostNames[@]}" - readPassword - while [ "${hostIndex}" -le "${numHosts}" ]; do - hostName="${hostNames[${hostIndex}]}" - maxTries=3 - echo -n "Checking password on ${hostName}. " - hostType="`getHostType "${hostName}"`" - if [ -n "${hostType}" ]; then - echo - else - while [ "${maxTries}" -gt 0 ]; do - readPassword - hostType="`getHostType "${hostName}"`" - if [ -n "${hostType}" ]; then - break - fi - echo "Incorrect password for server ${hostName}." - ((maxTries--)) - done - fi - if [ -n "${hostType}" ]; then - writeBBConfigKeyVal "host.${hostName}" "${PASSWD}" - if [ "`echo ${hostType} | tr "cyglinsu" "CYGLINSU" | cut -b1-3`" = "CYG" ]; then - hostIsWindows="true" - else - hostIsWindows="false" - fi - writeBBConfigKeyVal "hostType.${hostName}" "${hostIsWindows}" - else - echo "Failed to login to server ${hostName}; removing from hosts list" - fi - ((hostIndex++)) - done -} - -checkLogin() -{ - hostIndex=1 - numHosts="${#hostNames[@]}" - while [ "${hostIndex}" -le "${numHosts}" ]; do - hostName="${hostNames[${hostIndex}]}" - echo -n "Checking login on ${hostName}. " - hostType="`ssh -o StrictHostKeyChecking=no "${USER}@${hostName}" "uname"`" - if [ -n "${hostType}" ]; then - if [ "`echo ${hostType} | tr "cyglinsu" "CYGLINSU" | cut -b1-3`" = "CYG" ]; then - hostIsWindows="true" - else - hostIsWindows="false" - fi - writeBBConfigKeyVal "hostType.${hostName}" "${hostIsWindows}" - else - echo "Failed to login to server ${hostName}" - fi - ((hostIndex++)) - done -} http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runCSTests.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runCSTests.sh b/src/tests/cpp/scripts/runCSTests.sh deleted file mode 100644 index 67a47b3..0000000 --- a/src/tests/cpp/scripts/runCSTests.sh +++ /dev/null @@ -1,397 +0,0 @@ -#!/bin/bash - -getPath() -{ - if uname | grep '^CYGWIN' >/dev/null 2>/dev/null; then - cygpath "$1" - else - echo "$1" - fi -} - -scriptLocation="`getPath "$0"`" - -scriptDir="`dirname "${scriptLocation}"`" -scriptName="`basename "${scriptLocation}"`" - -if [ -r "${scriptDir}/runCSFunctions.sh" ]; then - source "${scriptDir}/runCSFunctions.sh" -else - echo "Could not read the runCSFunctions.sh script." - exit 1 -fi - -if [ -n "${NUNIT}" ]; then - PATH="${PATH}:`getPath "${NUNIT}/bin"`" -fi - -NUNIT_CONSOLE="nunit-console.exe" - - NUNIT_FLAGS="/labels /framework=net-4.0" - -UNITTESTS_DLL="UnitTests.dll" -RESULT_XML="TestResult.xml" - - -getResultsDir() -{ - echo "${TESTRES}/csharp/$1" -} - -getNunitFlag() -{ - if [ "$1" = "unicast-deprecated" ]; then - echo /exclude=multicast-only - echo /exclude=generics - elif [ "$1" = "multicast" ]; then - echo /exclude=unicast_only - elif [ "$1" = "unicast" ]; then - echo /exclude=deprecated - else - echo - fi -} - -getFailures() -{ - sed -n 's/^[ \t]*<test-case[ \t]\+name[ \t]*=[ \t]*"\([^\.]*\.\)*\([^\.]*\.[^\."]*\)"[^>]*success[ \t]*=[ \t]*"False"[^>]*>.*$/\2/p' "$1" 2>/dev/null -} - -runTests() -{ - echo "The logging level is ${DUNIT_LOGLEVEL}." - echo "The server logging level is ${GFE_LOGLEVEL}." - echo "The server security logging level is ${GFE_SECLOGLEVEL}." - echo - ORIGPWD="`pwd`" - RESULT_TYPE="$1" - shift - RESULTS_DIR="`getResultsDir "${RESULT_TYPE}"`" - NUNIT_RUN_FLAG="`getNunitFlag "${RESULT_TYPE}"`" - echo "NUnit flag is ${NUNIT_RUN_FLAG}" - - cd "${TESTSRC}" - rm -rf "${RESULTS_DIR}" - mkdir -p "${RESULTS_DIR}" - cp -f *.dll *.pdb *.xml *.dtd *.exe *.pl *.properties* "${RESULTS_DIR}" 2>/dev/null - cp -f --preserve=all cache6_5.dtd "${RESULTS_DIR}/.." 2>/dev/null - cp -f --preserve=all cache6_6.dtd "${RESULTS_DIR}/.." 2>/dev/null - if [ "${runNet20}" = "true" ]; then - echo Copying for net20 run. - if [ -n "${OSBUILDDIR}" ]; then - OSBUILDDIR="`getPath "${OSBUILDDIR}"`" - fi - if [ -n "${OSBUILDEXTDIR}" ]; then - OSBUILDEXTDIR="`getPath "${OSBUILDEXTDIR}"`" - fi - cp -f --preserve=all ${OSBUILDEXTDIR}/product/bin/Net20/GemStone.GemFire.Cache.dll "${OSBUILDDIR}/tests/clicache/UnitTests/" 2>/dev/null - cp -f --preserve=all ${OSBUILDEXTDIR}/product/bin/Net20/GemStone.GemFire.Cache.xml "${OSBUILDDIR}/tests/clicache/UnitTests/" 2>/dev/null - fi - chmod a+rwx -R "${RESULTS_DIR}" - - cd "${RESULTS_DIR}" - if [ -n "${DUNIT_LOGDIR}" ]; then - mkdir -p "${DUNIT_LOGDIR}" - fi - - coveragePrefix1="" - coveragePrefix2="" - coveragePrefix3="" - coveragePrefix4="" - coverageFile="coverage-master" - if [ "${COVERAGE_ENABLED}" = "true" ]; then - coveragePrefix1="NCover.Console.exe //x ${coverageFile}-1.xml" - coveragePrefix2="NCover.Console.exe //x ${coverageFile}-2.xml" - coveragePrefix3="NCover.Console.exe //x ${coverageFile}-3.xml" - coveragePrefix4="NCover.Console.exe //x ${coverageFile}-4.xml" - fi - - - if [ "${RUNSINGLETEST}" = "true" ]; then - echo "Running single test" - ${coveragePrefix1} ${NUNIT_CONSOLE} ${NUNIT_FLAGS} ${NUNIT_RUN_FLAG} "/xml=TestResult.xml" "$@" "${UNITTESTS_DLL}" - if [ "${COVERAGE_ENABLED}" = "true" ]; then - echo NCover.Reporting.exe ${coverageFile}-1.xml merged-coverage.xml //s merged-coverage-tmp.xml - NCover.Reporting.exe ${coverageFile}-1.xml merged-coverage.xml //s merged-coverage-tmp.xml - mv -f merged-coverage-tmp.xml merged-coverage.xml - fi - else - echo "Tests mode is Sequential ${RUNSEQUENTIAL}" - if [ "${RUNSEQUENTIAL}" = "true" ]; then - ${coveragePrefix1} ${NUNIT_CONSOLE} ${NUNIT_FLAGS} ${NUNIT_RUN_FLAG} "/xml=TestResult.xml" "$@" "${UNITTESTS_DLL}" - if [ "${COVERAGE_ENABLED}" = "true" ]; then - echo NCover.Reporting.exe ${coverageFile}-1.xml merged-coverage.xml //s merged-coverage-tmp.xml - NCover.Reporting.exe ${coverageFile}-1.xml merged-coverage.xml //s merged-coverage-tmp.xml - mv -f merged-coverage-tmp.xml merged-coverage.xml - fi - else - - ${coveragePrefix1} ${NUNIT_CONSOLE} ${NUNIT_FLAGS} "/xml=TestResult1.xml" "/include=group1" "$@" "${UNITTESTS_DLL}" & - - sleep 1 - - ${coveragePrefix2} ${NUNIT_CONSOLE} ${NUNIT_FLAGS} "/xml=TestResult2.xml" "/include=group2" "$@" "${UNITTESTS_DLL}" & - - sleep 2 - - ${coveragePrefix3} ${NUNIT_CONSOLE} ${NUNIT_FLAGS} "/xml=TestResult3.xml" "/include=group3" "$@" "${UNITTESTS_DLL}" & - - sleep 3 - - ${coveragePrefix4} ${NUNIT_CONSOLE} ${NUNIT_FLAGS} "/xml=TestResult4.xml" "/include=group4" "$@" "${UNITTESTS_DLL}" & - - wait - - cat "TestResult1.xml" "TestResult2.xml" "TestResult3.xml" "TestResult4.xml" > "TestResult.xml" - - if [ "${COVERAGE_ENABLED}" = "true" ]; then - echo NCover.Reporting.exe ${coverageFile}-1.xml ${coverageFile}-2.xml ${coverageFile}-3.xml ${coverageFile}-4.xml merged-coverage.xml //s merged-coverage-tmp.xml - NCover.Reporting.exe ${coverageFile}-1.xml ${coverageFile}-2.xml ${coverageFile}-3.xml ${coverageFile}-4.xml merged-coverage.xml //s merged-coverage-tmp.xml - mv -f merged-coverage-tmp.xml merged-coverage.xml - fi - fi - fi - - RESULT=success - if [ -n "${DUNIT_LOGDIR}" ]; then - mkdir -p failures - testFailures="`getFailures "${RESULT_XML}"`" - if [ -n "${testFailures}" ]; then - RESULT=fail - for failure in ${testFailures}; do - echo Failure in ${failure}. - if [ -f "${DUNIT_LOGDIR}/${failure}.log" ]; then - cp -f "${DUNIT_LOGDIR}/${failure}.log" failures - rm -f "${DUNIT_LOGDIR}/${failure}.log" - fi - done - fi - fi - - cd "${ORIGPWD}" -} - -resultPrompt() -{ - RESULT_TYPE="$1" - RESULTS_DIR="`getResultsDir "${RESULT_TYPE}"`" - if [ "${RESULT}" = "success" ]; then - echo - echo - echo "SUCCESS: All ${RESULT_TYPE} tests passed." - else - echo - echo - echo -n "FAILURE: Some ${RESULT_TYPE} tests failed" - if [ -d "${RESULTS_DIR}/failures" ]; then - echo "; see ${RESULTS_DIR}/failures" - else - echo - fi - fi - if [ -f "${RESULTS_DIR}/TestResult.xml" ]; then - echo "Test report is in: ${RESULTS_DIR}/TestResult.xml" - fi - if [ -n "${DUNIT_LOGDIR}" -a -d "${RESULTS_DIR}/${DUNIT_LOGDIR}" ]; then - echo "Output is in: ${RESULTS_DIR}/${DUNIT_LOGDIR}" - fi -} - -getArgValue() -{ - echo "$1" | sed 's/^-[^=]*=//' -} - -cleanUp() -{ - cd "${INITPWD}" - rm -f "${scriptDir}/gfcpp.properties" - taskkill /FI "USERNAME eq ${USER}" /F /IM ${NUNIT_CONSOLE} >/dev/null 2>/dev/null - taskkill /FI "USERNAME eq ${USER}" /IM FwkClient.exe >/dev/null 2>/dev/null - sleep 1 - taskkill /FI "USERNAME eq ${USER}" /F /IM FwkClient.exe >/dev/null 2>/dev/null - if [ "$1" = "true" ]; then - sleep 1 - rm -rf "${TESTRES}/csharp" - fi -} - - -isFlag="true" -logging="true" -useDebug="false" -runMulticast="true" -runUnicast="true" -runDeprecated="true" -runGenerics="true" -DUNIT_LOGLEVEL="config" -GFE_LOGLEVEL="config" -GFE_SECLOGLEVEL="config" -COVERAGE_ENABLED="false" -runNet20="false" - -while [ "${isFlag}" = "true" ]; do - case $1 in - -logging=*) - logging="`getArgValue "$1"`"; - shift; - ;; - -logLevel=*) - DUNIT_LOGLEVEL="`getArgValue "$1"`"; - shift; - ;; - -gfeLogLevel=*) - GFE_LOGLEVEL="`getArgValue "$1"`"; - shift; - ;; - -gfeSecLogLevel=*) - GFE_SECLOGLEVEL="`getArgValue "$1"`"; - shift; - ;; - -coverage) - COVERAGE_ENABLED="true"; - shift; - ;; - -debug=*) - useDebug="`getArgValue "$1"`"; - shift; - ;; - -multicast=*) - runMulticast="`getArgValue "$1"`"; - shift; - ;; - -unicast=*) - runUnicast="`getArgValue "$1"`"; - shift; - ;; - -deprecated=*) - runDeprecated="`getArgValue "$1"`"; - shift; - ;; - -generics=*) - runGenerics="`getArgValue "$1"`"; - shift; - ;; - -clean) - echo Cleaning up ... - cleanUp true; - exit 0; - ;; - -net20=*) - runNet20="`getArgValue "$1"`"; - shift; - ;; - *) - isFlag="false"; - ;; - esac -done - -export DUNIT_LOGDIR="output" -if [ -n "${OSBUILDDIR}" ]; then - OSBUILDDIR="`getPath "${OSBUILDDIR}"`" - if [ "${useDebug}" = "true" ]; then - if [ "${runNet20}" = "true" ]; then - PATH="${OSBUILDEXTDIR}/hidden/lib/debug:${OSBUILDEXTDIR}/hidden/lib:${OSBUILDEXTDIR}/hidden/gpl:${OSBUILDEXTDIR}/product/bin:`getPath "${OPENSSL}/bin"`:${PATH}" - else - PATH="${OSBUILDDIR}/hidden/lib/debug:${OSBUILDDIR}/hidden/lib:${OSBUILDDIR}/hidden/gpl:${OSBUILDDIR}/product/bin:`getPath "${OPENSSL}/bin"`:${PATH}" - fi - else - if [ "${runNet20}" = "true" ]; then - PATH="${OSBUILDEXTDIR}/product/bin:${OSBUILDEXTDIR}/hidden/lib:${OSBUILDEXTDIR}/hidden/gpl:`getPath "${OPENSSL}/bin"`:${PATH}" - else - PATH="${OSBUILDDIR}/product/bin:${OSBUILDDIR}/hidden/lib:${OSBUILDDIR}/hidden/gpl:`getPath "${OPENSSL}/bin"`:${PATH}" - fi - fi - TESTRES="${OSBUILDDIR}/tests/results" -else - if [ "${useDebug}" = "true" ]; then - TESTRES="../../../../tests/results" - else - TESTRES="../../../tests/results" - fi -fi -if [ "${logging}" = "false" ]; then - unset DUNIT_LOGDIR -fi -if [ "${useDebug}" = "true" ]; then - TESTSRC="${TESTSRC:-../../../../../../../tests/clicache/UnitTests}" -else - TESTSRC="${TESTSRC:-../../../../../../tests/clicache/UnitTests}" -fi -export TESTSRC DUNIT_LOGLEVEL GFE_LOGLEVEL GFE_SECLOGLEVEL COVERAGE_ENABLED PATH - -mkdir -p "${TESTRES}" -mkdir -p "${TESTRES}/csharp" - -INITPWD="`pwd`" - -trap "cleanUp false" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - - -if [ "${runUnicast}" = "true" ]; then - - # Next the unicast tests - - if [ "${runDeprecated}" = "true" ] || [ "${runGenerics}" = "false" ]; then - RESULT_TYPE="unicast-deprecated" - fi - if [ "${runDeprecated}" = "false" ] || [ "${runGenerics}" = "true" ]; then - RESULT_TYPE="unicast" - fi - echo Running the ${RESULT_TYPE} tests. - echo - DATE_STR="`date`" - MCAST_PORT="`getOpenPort`" - STACKTRACE="# No stacktrace" - if [ "${useDebug}" = "true" ]; then - STACKTRACE="stacktrace-enabled=true" - fi - rm -f "${scriptDir}/gfcpp.properties" - cat > "${scriptDir}/gfcpp.properties" << EOF -# ${DATE_STR} -stacktrace-enabled=true -log-level=${DUNIT_LOGLEVEL} -EOF - - if [ -f "${scriptDir}/gfcpp.properties.mine" ]; then - cat "${scriptDir}/gfcpp.properties.mine" >> "${scriptDir}/gfcpp.properties" - fi - runTests "${RESULT_TYPE}" "$@" - resultPrompt "${RESULT_TYPE}" - if [ "${RESULT}" = "fail" ]; then - exit 1 - fi - -fi - - -if [ "${runMulticast}" = "true" ]; then - - # First run the multicast tests - - RESULT_TYPE="multicast" - echo Running the ${RESULT_TYPE} tests. - echo - DATE_STR="`date`" - MCAST_PORT="`getOpenPort`" - STACKTRACE="# No stacktrace" - if [ "${useDebug}" = "true" ]; then - STACKTRACE="stacktrace-enabled=true" - fi - rm -f "${scriptDir}/gfcpp.properties" - cat > "${scriptDir}/gfcpp.properties" << EOF -# ${DATE_STR} -${STACKTRACE} -log-level=${DUNIT_LOGLEVEL} -EOF - if [ -f "${scriptDir}/gfcpp.properties.mine" ]; then - cat "${scriptDir}/gfcpp.properties.mine" >> "${scriptDir}/gfcpp.properties" - fi - runTests "${RESULT_TYPE}" "$@" - resultPrompt "${RESULT_TYPE}" - if [ "${RESULT}" = "fail" ]; then - exit 1 - fi - -fi http://git-wip-us.apache.org/repos/asf/geode/blob/03781bd1/src/tests/cpp/scripts/runDriver.sh ---------------------------------------------------------------------- diff --git a/src/tests/cpp/scripts/runDriver.sh b/src/tests/cpp/scripts/runDriver.sh deleted file mode 100755 index a46aa02..0000000 --- a/src/tests/cpp/scripts/runDriver.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/bash -## Let's take care of some basic needs -#set -x -fullscript=$0 -fullcmdline="$0 $*" -cmdline=$* - -script=`basename $0` -scriptLocation=`dirname $0` - -source $scriptLocation/genericFunctions -source $scriptLocation/runDriverFunctions -export AWK=`which nawk 2>/dev/null` ## Which awk to use -export HOSTS= ## Hosts given on commandline -export UHOSTS= ## unique hosts ( $HOSTS piped thru sort -u ) -export PHOSTS= ## Hosts that will need provisioned/unprovisioned -# Get our host name, ip address, and os -export local=`hostname` -export GF_FQDN=`nslookup $local 2>/dev/null | ${AWK:-awk} '/^Name:/{print $2}'` -export GF_IPADDR=`nslookup $local 2>/dev/null | ${AWK:-awk} '{if ($1 ~ /Address:/) ip=$2}END{print ip}'` -export myOS=`uname | tr "cyglinsu" "CYGLINSU" | cut -b1-3` - - - -# Let's bail if we have a command return an error while we are getting set up -trap badcmd SIGINT ERR - -# Process the command line -if [ $# -lt 2 ] -then - usage "Too few arguments were specified." -fi - -TSTIME=$SECONDS - -clearVars -processArgs $* -setLocations - -LOG "$fullcmdline" - -handleRestart - -processGroups - -export SA_RUNNING=0 -if [ ${SSH_AGENT_PID:--1} -ne -1 ] -then - SA_RUNNING=`ps -fp $SSH_AGENT_PID 2>/dev/null | grep ssh-agent | wc -l` -fi -if [ $SA_RUNNING -eq 0 ] -then - ## start ssh-agent - eval `ssh-agent`## > /dev/null - ssh-add > /dev/null 2>&1 -fi - -TRACE_ON - -verifyTestFiles - -# source env settings set defined during build, if any -if [ -f $fwkdir/scripts/run.env ] -then - source $fwkdir/scripts/run.env -fi - -miscDriverSetup -export username=$USERNAME -export passwrd=$PASSWORD -export vmhosts=$VMHOSTS -export vmnames=$VMNAMES -export isvmotion=$VMOTION #default is false -export vminterval=$VMINTERVAL # mention the time interval in min to trigger the vmotion . eg: VMINTERVAL=5, which means vmotion will be trigeer every 5 minutes. -if [ "$isvmotion" == "true" ] -then - LOG " vmotion parameters are username = $username , vmhosts=$vmhosts , vmnames=$vmnames , vminterval=$vminterval" -fi -setJavaHome -runLatestProp - -setupHosts - -LOG "Will start clients using: " $UHOSTS -showSettings - -logTests - -#################################################################################################### - -TestStart=$SECONDS -if [ ${timeLimit:-0} -gt 0 ] -then - ((HardStop=$TestStart+$timeLimit+300)) -else - HardStop=0 -fi - -export summaryDirs="" - -testFileCnt=0 -for tfile in $testList -do - # Let's ignore simple errors while we are in the loop - trap '' ERR - ((testFileCnt++)) - if [ $testFileTotal -gt 1 ] - then - LOG "### Test file $tfile -- $testFileCnt of $testFileTotal" - else - LOG "### $tfile" - fi - if [ ! -f $fwkdir/xml/$tfile ] - then - WARN "Skipping $tfile, file not found." - continue - fi - - ## runIters loop - rcnt=0 - while [ $rcnt -lt $runIters ] - do - ((rcnt++)) - LOG "#########################################################" - LOG "### $tfile -- Run $rcnt of $runIters" - - Now=$SECONDS - STIME=$Now - TLIMIT=0 - if [ $HardStop -gt 0 ] - then - if [ $HardStop -lt $Now ] - then - LOG "Skipping, time allowed for test run is used up." - continue - fi - ((TLIMIT=$HardStop-$Now)) - fi - ## This will do many things, including creating the test directory, and cd'ing to it - setupTest - - provisionDir $PWD - - LOG "Using properties: " - LOGCONTENT gfcpp.properties - - # Chose a port for the driver to use in listening for clients - random 3031 31321 port - LOG "Using driver port $port" - - driverError=0 - LOG $vcmd Driver $TLIMIT $logDir $stestFile $port - # The || is needed to prevent ERR from being trapped if driver exits - # abnormally (see man trap) - $vcmd Driver $TLIMIT $logDir $stestFile $port 2>&1 | tee Driver.log || driverError=$? - LOG "driverError value is $driverError" - if [ $driverError -ne 0 ]; then - ERROR "Error: Driver has returned $driverError, continuing with remaining tests" - fi - stopProcess Driver $PWD - summaryDirs="$summaryDirs $PWD" - - stopAll all $PWD - - timeBreakDown $STIME - ftag=`echo $tfile | tr "\/\\\\\\\\" "____"` - touch test.$ftag - LOG "### $tfile -- End of run $rcnt of $runIters" - LOG "#########################################################" - - doSubSummary - doGenCsvReport - cd $BASEDIR - - done ## end of runIters loop -done ## end of testList loop - - -#################################################################################################### - -cleanup