onos/tools/test/bin/onos-check-nodes
Thomas Vachuska 4b84baff75 Fixed a few onos-check-* tools.
Change-Id: I2bda9677aec461c091c6e24c5ba0fd6f6dacfff9
2015-07-27 10:49:06 -07:00

21 lines
610 B
Bash
Executable File

#!/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" | grep -v /bin/client > $aux
cat $aux
# Normalize the nodes
cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1
# Normalize the expected nodes
nodes=${2:-$ONOS_INSTANCES}
(for node in $nodes; do echo $node; done) | sort > $aux.2
# Check for differences
diff $aux.1 $aux.2