blob: 983d1e6ac76032c60a9c6782eb3c69fff49e4d23 [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
9onos ${1:-$OCI} "onos:nodes" > $aux
10cat $aux
11
12# Normalize the nodes
13cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1
14
15# Normalize the expected apps
16ONOS_NODES=$(env | egrep "OC[0-9]*=" | cut -d= -f2 | sort)
17nodes=${2:-$ONOS_NODES}
18(for node in $nodes; do echo $node; done) | sort > $aux.2
19
20# Check for differences
21diff $aux.1 $aux.2