blob: 8b26ac874ae11de310af9504dfa11044b3e8beba [file] [log] [blame]
Thomas Vachuskaf9c84362015-04-15 11:20:45 -07001#!/bin/bash
2#-------------------------------------------------------------------------------
3# System Test Coordinator
4#-------------------------------------------------------------------------------
5
Yuta HIGUCHI6fc9fbd2016-06-16 21:41:13 -07006. $ONOS_ROOT/tools/build/envDefaults
7
Thomas Vachuska67f13052016-08-19 12:10:42 -07008VER=${STC_VERSION:-2.2}
Thomas Vachuska426d3562016-06-02 19:36:51 -07009JAR=~/.m2/repository/org/onosproject/onos-stc/$VER/onos-stc-$VER.jar
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070010SCENARIOS=$ONOS_ROOT/tools/test/scenarios
Thomas Vachuskaf9c84362015-04-15 11:20:45 -070011
Thomas Vachuska426d3562016-06-02 19:36:51 -070012# Download the STC binary if needed
13if [ ! -f $JAR ]; then
14 printf "Downloading STC binary..."
Jon Hallfb6009d2017-02-15 16:01:17 -080015 aux=/tmp/stc/stc-$$.log
Thomas Vachuska426d3562016-06-02 19:36:51 -070016 mvn dependency:get -Dartifact=org.onosproject:onos-stc:$VER -Dtransitive=false -B >$aux || fgrep '[ERROR]' $aux
17 rm -f $aux
18 [ -f $JAR ] && printf "Done.\n"
19fi
20
Thomas Vachuska177ece62015-06-26 00:18:21 -070021DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y"
22
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070023scenario=${1:-smoke}
Thomas Vachuskaf9c84362015-04-15 11:20:45 -070024
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070025[ ! -f $scenario ] && scenario=$SCENARIOS/$scenario
26[ ! -f $scenario ] && scenario=$scenario.xml
27[ ! -f $scenario ] && echo "Scenario $scenario file not found" && exit 1
28
Brian O'Connor3683f4d2015-09-16 17:44:30 -070029# Remove the test name from the list of parameters, if one is specified
Thomas Vachuska50ec1af2015-06-02 00:42:52 -070030[ $# -ge 1 ] && shift
31
Brian O'Connor3683f4d2015-09-16 17:44:30 -070032# If stcColor is not set, we will enable color if this is an interactive session
33[ -t 1 ] && interactive=true || interactive=false
Thomas Vachuska7c5b6532015-11-02 14:50:33 -080034[ -t 1 ] && notInteractive=false || notInteractive=true
Thomas Vachuska50ec1af2015-06-02 00:42:52 -070035
Brian O'Connor3683f4d2015-09-16 17:44:30 -070036# Run stc
Thomas Vachuska1b403a52015-08-26 11:30:48 -070037[ -z "$stcDebug" ] && DEBUG_OPTS=""
Thomas Vachuskaa3029cf2016-08-23 16:47:46 -070038stcTitle=${stcTitle:-} stcColor=${stcColor:-$interactive} stcDumpLogs=${stcDumpLogs:-$notInteractive} \
Thomas Vachuska7c5b6532015-11-02 14:50:33 -080039 java $DEBUG_OPTS -jar $JAR $scenario "$@"