Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Checks ONOS summary data |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | aux=/tmp/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 | |
Thomas Vachuska | 822bc14 | 2016-11-22 15:47:23 -0800 | [diff] [blame^] | 9 | for i in {1..15}; 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 |