onos/tools/test/bin/onos-check-components
Ray Milkey 202334780f Increase timeout for check components
Change-Id: I3a60e5dfe1d3fa4c59a2ef2f182eaa995a527ee3
2016-02-19 18:51:24 +00:00

25 lines
629 B
Bash
Executable File

#!/bin/bash
# -----------------------------------------------------------------------------
# Checks whether all ONOS components are either ACTIVE or DISABLED.
# -----------------------------------------------------------------------------
aux=/tmp/stc-$$.log
trap "rm -f $aux 2>/dev/null" EXIT
for attempt in {1..30}; do
onos ${1:-$OCI} scr:list > $aux
if grep -q UNSATISFIED $aux; then
sleep 1
else
if [ -n "$2" ]; then
echo "Searching for ACTIVE $2"
egrep "ACTIVE.*$2" $aux && exit 0 || sleep 1
else
cat $aux && exit 0
fi
fi
done
exit 1