Save stc temp logs in the stc folder

There was an issue when OCN was set to localhost. As part of Net-Smoke,
the command 'mn -c' is run which removes '/tmp/*.log'. This potentially
caused some tests to fail.

Change-Id: If68c184902b994e1ee38ea775c378ce29cdb891f
diff --git a/tools/test/bin/onos-check-apps b/tools/test/bin/onos-check-apps
index f4b21b7..710c002 100755
--- a/tools/test/bin/onos-check-apps
+++ b/tools/test/bin/onos-check-apps
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
 
 for attempt in {1..30}; do
diff --git a/tools/test/bin/onos-check-component b/tools/test/bin/onos-check-component
index 27ce619..0eadf3c 100755
--- a/tools/test/bin/onos-check-component
+++ b/tools/test/bin/onos-check-component
@@ -3,7 +3,7 @@
 # Checks whether the given ONOS component has a given state.
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 node=$1
diff --git a/tools/test/bin/onos-check-components b/tools/test/bin/onos-check-components
index e619937..9275b50 100755
--- a/tools/test/bin/onos-check-components
+++ b/tools/test/bin/onos-check-components
@@ -3,7 +3,7 @@
 # Checks whether all ONOS components are either ACTIVE or DISABLED.
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 for attempt in {1..30}; do
diff --git a/tools/test/bin/onos-check-flows b/tools/test/bin/onos-check-flows
index ce80444..e3406ec 100755
--- a/tools/test/bin/onos-check-flows
+++ b/tools/test/bin/onos-check-flows
@@ -3,7 +3,7 @@
 # Checks ONOS summary data
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 for i in {1..6}; do
diff --git a/tools/test/bin/onos-check-intent b/tools/test/bin/onos-check-intent
index 38b8aea..615bf52 100755
--- a/tools/test/bin/onos-check-intent
+++ b/tools/test/bin/onos-check-intent
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 target=${1:-$OCI}
 
diff --git a/tools/test/bin/onos-check-ipv4-flows b/tools/test/bin/onos-check-ipv4-flows
index 7a851ca..6188728 100755
--- a/tools/test/bin/onos-check-ipv4-flows
+++ b/tools/test/bin/onos-check-ipv4-flows
@@ -3,7 +3,7 @@
 # Checks ONOS flows
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 want_present=0
diff --git a/tools/test/bin/onos-check-node-status b/tools/test/bin/onos-check-node-status
index 39628b8..0a76f08 100755
--- a/tools/test/bin/onos-check-node-status
+++ b/tools/test/bin/onos-check-node-status
@@ -3,7 +3,7 @@
 # Checks whether the specified ONOS cluster node has the desired state.
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 for attempt in {1..10}; do
diff --git a/tools/test/bin/onos-check-nodes b/tools/test/bin/onos-check-nodes
index 5433f38..7733c27 100755
--- a/tools/test/bin/onos-check-nodes
+++ b/tools/test/bin/onos-check-nodes
@@ -3,7 +3,7 @@
 # Checks whether all and only the ONOS instances configured active.
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
 
 onos ${1:-$OCI} "onos:nodes" > $aux
diff --git a/tools/test/bin/onos-check-summary b/tools/test/bin/onos-check-summary
index 69bc0ac..948e5d5 100755
--- a/tools/test/bin/onos-check-summary
+++ b/tools/test/bin/onos-check-summary
@@ -3,7 +3,7 @@
 # Checks ONOS summary data
 # -----------------------------------------------------------------------------
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 for i in {1..15}; do
diff --git a/tools/test/bin/onos-check-views b/tools/test/bin/onos-check-views
index 421de90..aec0dbe 100755
--- a/tools/test/bin/onos-check-views
+++ b/tools/test/bin/onos-check-views
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 onos ${1:-$OCI} "onos:ui-views" > $aux
diff --git a/tools/test/bin/onos-check-vnet b/tools/test/bin/onos-check-vnet
index a2ad1c9..e3a948b 100755
--- a/tools/test/bin/onos-check-vnet
+++ b/tools/test/bin/onos-check-vnet
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 target=${1:-$OCI}
 command_name=`basename $0`
diff --git a/tools/test/bin/onos-cluster-execute-expect b/tools/test/bin/onos-cluster-execute-expect
index 067320e..0754045 100755
--- a/tools/test/bin/onos-cluster-execute-expect
+++ b/tools/test/bin/onos-cluster-execute-expect
@@ -12,14 +12,16 @@
 . $ONOS_ROOT/tools/build/envDefaults
 
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 cmd=""
 for a in ${*:1}; do shift; if [ "$a" = "--expect" ]; then break; fi; cmd="$cmd $a"; done
 expect="${@: -1}"
 echo $cmd
-echo $expect
+echo "expect ${expect}"
 node_count=`onos $OC1 nodes | wc -l`
+# FIMXE: This only works if nodes are sequential
+# For dynamic clustering we could grab the IPs from 'nodes'
 for i in `seq 1 $node_count`; do
     node_var="OC$i"
     onos ${!node_var} $cmd > $aux
diff --git a/tools/test/bin/onos-create-intent b/tools/test/bin/onos-create-intent
index 56626d5..2f08d5d 100755
--- a/tools/test/bin/onos-create-intent
+++ b/tools/test/bin/onos-create-intent
@@ -8,7 +8,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 target=$1
 name=$2
diff --git a/tools/test/bin/onos-execute-expect b/tools/test/bin/onos-execute-expect
index 6ad9569..4b9270e 100755
--- a/tools/test/bin/onos-execute-expect
+++ b/tools/test/bin/onos-execute-expect
@@ -13,7 +13,7 @@
 . $ONOS_ROOT/tools/build/envDefaults
 
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 ip=$1
 cmd=""
diff --git a/tools/test/bin/onos-find-app b/tools/test/bin/onos-find-app
index 4f3acce..1afd27e 100755
--- a/tools/test/bin/onos-find-app
+++ b/tools/test/bin/onos-find-app
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 echo onos-find-app: $*
diff --git a/tools/test/bin/onos-find-driver b/tools/test/bin/onos-find-driver
index e796040..1f533ef 100755
--- a/tools/test/bin/onos-find-driver
+++ b/tools/test/bin/onos-find-driver
@@ -6,7 +6,7 @@
 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
 . $ONOS_ROOT/tools/build/envDefaults
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 target=${1:-$OCI}
 
diff --git a/tools/test/bin/stc b/tools/test/bin/stc
index 9334987..8b26ac8 100755
--- a/tools/test/bin/stc
+++ b/tools/test/bin/stc
@@ -12,7 +12,7 @@
 # Download the STC binary if needed
 if [ ! -f $JAR ]; then
     printf "Downloading STC binary..."
-    aux=/tmp/stc-$$.log
+    aux=/tmp/stc/stc-$$.log
     mvn dependency:get -Dartifact=org.onosproject:onos-stc:$VER -Dtransitive=false -B >$aux || fgrep '[ERROR]' $aux
     rm -f $aux
     [ -f $JAR ] && printf "Done.\n"
diff --git a/tools/test/scenarios/bin/curl-with-retry b/tools/test/scenarios/bin/curl-with-retry
index c9546ae..c77b284 100755
--- a/tools/test/scenarios/bin/curl-with-retry
+++ b/tools/test/scenarios/bin/curl-with-retry
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-aux=/tmp/stc-$$.log
+aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
 url=$1