blob: e61993771c6748ff66becb70ee7c0ee00af405ea [file] [log] [blame]
Thomas Vachuska8189a742015-05-29 10:02:52 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks whether all ONOS components are either ACTIVE or DISABLED.
4# -----------------------------------------------------------------------------
5
6aux=/tmp/stc-$$.log
7trap "rm -f $aux 2>/dev/null" EXIT
8
Ray Milkey20233472016-02-18 15:52:26 -08009for attempt in {1..30}; do
Thomas Vachuska9c630b22016-02-10 17:53:52 -080010 onos ${1:-$OCI} scr:list > $aux
Thomas Vachuska4bfccd542015-05-30 00:35:25 -070011
Thomas Vachuska9c630b22016-02-10 17:53:52 -080012 if grep -q UNSATISFIED $aux; then
13 sleep 1
14 else
15 if [ -n "$2" ]; then
16 echo "Searching for ACTIVE $2"
17 egrep "ACTIVE.*$2" $aux && exit 0 || sleep 1
18 else
19 cat $aux && exit 0
20 fi
21 fi
22done
23
Ray Milkey20233472016-02-18 15:52:26 -080024exit 1