blob: 35ee73153340a58cc760f6e94f666e7831af3559 [file] [log] [blame]
Ray Milkey1f0fb3b2019-02-26 08:45:48 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks if the given number of expected components are present.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9aux=/tmp/stc/stc-$$.log
10trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
11
12expected=$2
13
14for attempt in {1..30}; do
15 onos ${1} "onos:scr-list" | wc -l | xargs > $aux
16 cat $aux
17
18 current=`cat $aux`
19
20 # Check for differences
21 if [ "$expected" == "$current" ]; then
22 exit 0
23 fi
24 sleep 1
25done
26
27exit 1;