blob: 8a47e8dd4eac5228d34f5c2f582fce1c3f8e9817 [file] [log] [blame]
Thomas Vachuskaf9c84362015-04-15 11:20:45 -07001#!/bin/bash
2#-------------------------------------------------------------------------------
3# System Test Coordinator
4#-------------------------------------------------------------------------------
5
Thomas Vachuska426d3562016-06-02 19:36:51 -07006VER=${STC_VERSION:-2.0}
7JAR=~/.m2/repository/org/onosproject/onos-stc/$VER/onos-stc-$VER.jar
Thomas Vachuska4bfccd542015-05-30 00:35:25 -07008SCENARIOS=$ONOS_ROOT/tools/test/scenarios
Thomas Vachuskaf9c84362015-04-15 11:20:45 -07009
Thomas Vachuska426d3562016-06-02 19:36:51 -070010# Download the STC binary if needed
11if [ ! -f $JAR ]; then
12 printf "Downloading STC binary..."
13 aux=/tmp/stc-$$.log
14 mvn dependency:get -Dartifact=org.onosproject:onos-stc:$VER -Dtransitive=false -B >$aux || fgrep '[ERROR]' $aux
15 rm -f $aux
16 [ -f $JAR ] && printf "Done.\n"
17fi
18
Thomas Vachuska177ece62015-06-26 00:18:21 -070019DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y"
20
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070021scenario=${1:-smoke}
Thomas Vachuskaf9c84362015-04-15 11:20:45 -070022
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070023[ ! -f $scenario ] && scenario=$SCENARIOS/$scenario
24[ ! -f $scenario ] && scenario=$scenario.xml
25[ ! -f $scenario ] && echo "Scenario $scenario file not found" && exit 1
26
Brian O'Connor3683f4d2015-09-16 17:44:30 -070027# Remove the test name from the list of parameters, if one is specified
Thomas Vachuska50ec1af2015-06-02 00:42:52 -070028[ $# -ge 1 ] && shift
29
Brian O'Connor3683f4d2015-09-16 17:44:30 -070030# If stcColor is not set, we will enable color if this is an interactive session
31[ -t 1 ] && interactive=true || interactive=false
Thomas Vachuska7c5b6532015-11-02 14:50:33 -080032[ -t 1 ] && notInteractive=false || notInteractive=true
Thomas Vachuska50ec1af2015-06-02 00:42:52 -070033
Brian O'Connor3683f4d2015-09-16 17:44:30 -070034# Run stc
Thomas Vachuska1b403a52015-08-26 11:30:48 -070035[ -z "$stcDebug" ] && DEBUG_OPTS=""
Thomas Vachuska7c5b6532015-11-02 14:50:33 -080036stcColor=${stcColor:-$interactive} stcDumpLogs=${stcDumpLogs:-$notInteractive} \
37 java $DEBUG_OPTS -jar $JAR $scenario "$@"