blob: 37bb60e74548bdaf0638e09987d11352d78bdfa5 [file] [log] [blame]
#!/bin/bash
# -----------------------------------------------------------------------------
# Checks whether all and only the configured ONOS core storeage instances are active.
# -----------------------------------------------------------------------------
aux=/tmp/stc/stc-$$.log
trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
for attempt in {1..5}; do
onos ${1:-$OCI} "onos:storage-nodes" > $aux
cat $aux
# Normalize the nodes
cut -d= -f3 $aux | cut -d: -f1 | sort > $aux.1
# Normalize the expected nodes
nodes=${2:-$ONOS_CORES}
(for node in $nodes; do echo $node; done) | sort > $aux.2
# Check for differences
diff $aux.1 $aux.2 && exit 0
sleep 1
done
exit 1