Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Checks ONOS summary data |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
Jon Hall | fb6009d | 2017-02-15 16:01:17 -0800 | [diff] [blame] | 6 | aux=/tmp/stc/stc-$$.log |
Thomas Vachuska | 4b84baf | 2015-07-27 10:49:06 -0700 | [diff] [blame] | 7 | trap "rm -f $aux 2>/dev/null" EXIT |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 8 | |
Ray Milkey | 922db30 | 2018-04-02 08:54:51 -0700 | [diff] [blame^] | 9 | for i in {1..30}; do |
Thomas Vachuska | 32faf2b | 2016-07-05 16:19:01 -0700 | [diff] [blame] | 10 | onos ${1:-$OCI} "onos:summary" > $aux |
| 11 | cat $aux |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 12 | |
Thomas Vachuska | 32faf2b | 2016-07-05 16:19:01 -0700 | [diff] [blame] | 13 | 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 |
| 25 | done |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 26 | |
| 27 | exit $status |