blob: 5433f3871b0efc9fe8359ca0d1c78de80d8c21c4 [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 Vachuska5af2e4f2016-12-16 12:07:33 -08009onos ${1:-$OCI} "onos:nodes" > $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