Adding ability to dump logs for failed steps.

Change-Id: Ib3cb6552018d45c0bb4066e15a6e9bc8f69e97e0
diff --git a/tools/test/bin/stc b/tools/test/bin/stc
index 8737cf3..60a1720 100755
--- a/tools/test/bin/stc
+++ b/tools/test/bin/stc
@@ -20,6 +20,7 @@
 
 # If stcColor is not set, we will enable color if this is an interactive session
 [ -t 1 ] && interactive=true || interactive=false
+[ -t 1 ] && notInteractive=false || notInteractive=true
 
 # 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
@@ -27,7 +28,8 @@
 
 # Run stc
 [ -z "$stcDebug" ] && DEBUG_OPTS=""
-stcColor=${stcColor:-$interactive} java $DEBUG_OPTS -jar $JAR $scenario "$@"
+stcColor=${stcColor:-$interactive} stcDumpLogs=${stcDumpLogs:-$notInteractive} \
+    java $DEBUG_OPTS -jar $JAR $scenario "$@"
 
 # Reset the old value of ONOS_USE_SSH
 [ $sshSet ] && export ONOS_USE_SSH=oldSSH || unset ONOS_USE_SSH