aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/tools/test/bin/onos-check-nodes
blob: 69187b6a49bb37eac1bc1e4c05dd2f8fb136d0be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# -----------------------------------------------------------------------------
# Checks whether all and only the ONOS instances configured active.
# -----------------------------------------------------------------------------

aux=/tmp/stc-$$.log
trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT

onos ${1:-$OCI} "onos:nodes" | grep -v /bin/client > $aux
cat $aux

# Normalize the nodes
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

# Check for differences
diff $aux.1 $aux.2