blob: 37bb60e74548bdaf0638e09987d11352d78bdfa5 [file] [log] [blame]
Jon Hall5812b582020-09-14 12:22:01 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks whether all and only the configured ONOS core storeage instances are active.
4# -----------------------------------------------------------------------------
5
6aux=/tmp/stc/stc-$$.log
7trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
8
9for attempt in {1..5}; do
10 onos ${1:-$OCI} "onos:storage-nodes" > $aux
11 cat $aux
12
13 # Normalize the nodes
14 cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1
15
16 # Normalize the expected nodes
17 nodes=${2:-$ONOS_CORES}
18 (for node in $nodes; do echo $node; done) | sort > $aux.2
19
20 # Check for differences
21 diff $aux.1 $aux.2 && exit 0
22 sleep 1
23done
24exit 1