blob: 948e5d5e1c2c1aec3e42182e9364e174c831c86e [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
Thomas Vachuska822bc142016-11-22 15:47:23 -08009for i in {1..15}; 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