Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Checks whether all and only the ONOS instances configured active. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | aux=/tmp/stc-$$.log |
| 7 | trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT |
| 8 | |
| 9 | onos ${1:-$OCI} "onos:nodes" > $aux |
| 10 | cat $aux |
| 11 | |
| 12 | # Normalize the nodes |
| 13 | cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1 |
| 14 | |
| 15 | # Normalize the expected apps |
| 16 | ONOS_NODES=$(env | egrep "OC[0-9]*=" | cut -d= -f2 | sort) |
| 17 | nodes=${2:-$ONOS_NODES} |
| 18 | (for node in $nodes; do echo $node; done) | sort > $aux.2 |
| 19 | |
| 20 | # Check for differences |
| 21 | diff $aux.1 $aux.2 |