| # ----------------------------------------------------------------------------- |
| # Checks whether all and only the ONOS instances configured active. |
| # ----------------------------------------------------------------------------- |
| trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT |
| for attempt in {1..5}; do |
| onos ${1:-$OCI} "onos:nodes" > $aux |
| 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 |
| diff $aux.1 $aux.2 && exit 0 |