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 | |
Jon Hall | a67dc45 | 2017-02-15 16:01:17 -0800 | [diff] [blame] | 6 | aux=/tmp/stc/stc-$$.log |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 7 | trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT |
| 8 | |
Thomas Vachuska | 5af2e4f | 2016-12-16 12:07:33 -0800 | [diff] [blame] | 9 | onos ${1:-$OCI} "onos:nodes" > $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 |