blob: 69187b6a49bb37eac1bc1e4c05dd2f8fb136d0be [file] [log] [blame]
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks whether all and only the ONOS instances configured active.
4# -----------------------------------------------------------------------------
5
6aux=/tmp/stc-$$.log
7trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
8
Thomas Vachuska4b84baf2015-07-27 10:49:06 -07009onos ${1:-$OCI} "onos:nodes" | grep -v /bin/client > $aux
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070010cat $aux
11
12# Normalize the nodes
13cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1
14
Thomas Vachuska4b84baf2015-07-27 10:49:06 -070015# Normalize the expected nodes
16nodes=${2:-$ONOS_INSTANCES}
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070017(for node in $nodes; do echo $node; done) | sort > $aux.2
18
19# Check for differences
20diff $aux.1 $aux.2