Enhancing STC

Change-Id: Ibb8a001f5c6550860c4ade97378af7e97876a0ab
diff --git a/tools/test/bin/onos-check-nodes b/tools/test/bin/onos-check-nodes
new file mode 100755
index 0000000..983d1e6
--- /dev/null
+++ b/tools/test/bin/onos-check-nodes
@@ -0,0 +1,21 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Checks whether all and only the ONOS instances configured active.
+# -----------------------------------------------------------------------------
+
+aux=/tmp/stc-$$.log
+trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
+
+onos ${1:-$OCI} "onos:nodes" > $aux
+cat $aux
+
+# Normalize the nodes
+cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1
+
+# Normalize the expected apps
+ONOS_NODES=$(env | egrep "OC[0-9]*=" | cut -d= -f2 | sort)
+nodes=${2:-$ONOS_NODES}
+(for node in $nodes; do echo $node; done) | sort > $aux.2
+
+# Check for differences
+diff $aux.1 $aux.2