blob: f1a540761917681853c7f89c6be66d7658fc7967 [file] [log] [blame]
Thomas Vachuskaf9c84362015-04-15 11:20:45 -07001#!/bin/bash
2#-------------------------------------------------------------------------------
3# System Test Coordinator
4#-------------------------------------------------------------------------------
5
Brian O'Connor880dc20d2015-12-16 22:53:14 -08006VER=1.5.0-SNAPSHOT
Thomas Vachuska4bfccd542015-05-30 00:35:25 -07007JAR=~/.m2/repository/org/onosproject/onlab-stc/$VER/onlab-stc-$VER.jar
8SCENARIOS=$ONOS_ROOT/tools/test/scenarios
Thomas Vachuskaf9c84362015-04-15 11:20:45 -07009
Thomas Vachuska177ece62015-06-26 00:18:21 -070010DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y"
11
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070012scenario=${1:-smoke}
Thomas Vachuskaf9c84362015-04-15 11:20:45 -070013
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070014[ ! -f $scenario ] && scenario=$SCENARIOS/$scenario
15[ ! -f $scenario ] && scenario=$scenario.xml
16[ ! -f $scenario ] && echo "Scenario $scenario file not found" && exit 1
17
Brian O'Connor3683f4d2015-09-16 17:44:30 -070018# Remove the test name from the list of parameters, if one is specified
Thomas Vachuska50ec1af2015-06-02 00:42:52 -070019[ $# -ge 1 ] && shift
20
Brian O'Connor3683f4d2015-09-16 17:44:30 -070021# If stcColor is not set, we will enable color if this is an interactive session
22[ -t 1 ] && interactive=true || interactive=false
Thomas Vachuska7c5b6532015-11-02 14:50:33 -080023[ -t 1 ] && notInteractive=false || notInteractive=true
Thomas Vachuska50ec1af2015-06-02 00:42:52 -070024
Brian O'Connor3683f4d2015-09-16 17:44:30 -070025# stc requires that ONOS_USE_SSH=true, but we will store the old value and reset it after
26sshSet=$([ -z ${ONOS_USE_SSH+x} ]) && oldSSH=$ONOS_USE_SSH
27export ONOS_USE_SSH=true
28
29# Run stc
Thomas Vachuska1b403a52015-08-26 11:30:48 -070030[ -z "$stcDebug" ] && DEBUG_OPTS=""
Thomas Vachuska7c5b6532015-11-02 14:50:33 -080031stcColor=${stcColor:-$interactive} stcDumpLogs=${stcDumpLogs:-$notInteractive} \
32 java $DEBUG_OPTS -jar $JAR $scenario "$@"
Brian O'Connor3683f4d2015-09-16 17:44:30 -070033
34# Reset the old value of ONOS_USE_SSH
35[ $sshSet ] && export ONOS_USE_SSH=oldSSH || unset ONOS_USE_SSH