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 | |
Thomas Vachuska | 4b84baf | 2015-07-27 10:49:06 -0700 | [diff] [blame^] | 9 | onos ${1:-$OCI} "onos:nodes" | grep -v /bin/client > $aux |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 10 | cat $aux |
| 11 | |
| 12 | # Normalize the nodes |
| 13 | cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1 |
| 14 | |
Thomas Vachuska | 4b84baf | 2015-07-27 10:49:06 -0700 | [diff] [blame^] | 15 | # Normalize the expected nodes |
| 16 | nodes=${2:-$ONOS_INSTANCES} |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 17 | (for node in $nodes; do echo $node; done) | sort > $aux.2 |
| 18 | |
| 19 | # Check for differences |
| 20 | diff $aux.1 $aux.2 |