Brian O'Connor

Improvements to stc command

Add color for interactive sessions if stcColor is not set.
export ONOS_USE_SSH=true for stc tests and then reset it original value

Change-Id: I90d8c95efa91fbdeb97c3f33d601fef4d4bcb0f2
......@@ -15,9 +15,19 @@ scenario=${1:-smoke}
[ ! -f $scenario ] && scenario=$scenario.xml
[ ! -f $scenario ] && echo "Scenario $scenario file not found" && exit 1
# Remove the test name from the list of parameters, if one is specified
[ $# -ge 1 ] && shift
[ -t 1 ] && stcColor=true || unset stcColor
# If stcColor is not set, we will enable color if this is an interactive session
[ -t 1 ] && interactive=true || interactive=false
# stc requires that ONOS_USE_SSH=true, but we will store the old value and reset it after
sshSet=$([ -z ${ONOS_USE_SSH+x} ]) && oldSSH=$ONOS_USE_SSH
export ONOS_USE_SSH=true
# Run stc
[ -z "$stcDebug" ] && DEBUG_OPTS=""
java $DEBUG_OPTS -jar $JAR $scenario "$@"
stcColor=${stcColor:-$interactive} java $DEBUG_OPTS -jar $JAR $scenario "$@"
# Reset the old value of ONOS_USE_SSH
[ $sshSet ] && export ONOS_USE_SSH=oldSSH || unset ONOS_USE_SSH
......