blob: 6e7bfcf980489ff2216116e8a1542dbb77b220f2 [file] [log] [blame]
Thomas Vachuska4cfcc562015-06-03 09:51:02 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks ONOS summary data
4# -----------------------------------------------------------------------------
5
Jon Hallfb6009d2017-02-15 16:01:17 -08006aux=/tmp/stc/stc-$$.log
Thomas Vachuska4b84baf2015-07-27 10:49:06 -07007trap "rm -f $aux 2>/dev/null" EXIT
Thomas Vachuska4cfcc562015-06-03 09:51:02 -07008
Ray Milkey922db302018-04-02 08:54:51 -07009for i in {1..30}; do
Thomas Vachuska32faf2b2016-07-05 16:19:01 -070010 onos ${1:-$OCI} "onos:summary" > $aux
11 cat $aux
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070012
Thomas Vachuska32faf2b2016-07-05 16:19:01 -070013 let status=0
14 grep -q "nodes=${2:-.*}" $aux || let status=status+1
15 grep -q "devices=${3:-.*}" $aux || let status=status+1
16 grep -q "links=${4:-.*}" $aux || let status=status+1
17 grep -q "hosts=${5:-.*}" $aux || let status=status+1
18 grep -q "flows=${6:-.*}" $aux || let status=status+1
19 grep -q "intents=${7:-.*}" $aux || let status=status+1
20
21 if [ $status -eq 0 ]; then
22 exit 0;
23 fi
24 sleep 1
25done
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070026
27exit $status