blob: 7733c27190e05c86b5e693736b576af61e9fc919 [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
Jon Halla67dc452017-02-15 16:01:17 -08006aux=/tmp/stc/stc-$$.log
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -07007trap "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