blob: 61887281e2a73f2b854474daf5af8b4b6b278eb2 [file] [log] [blame]
Ray Milkey955c4b82016-07-11 09:48:53 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks ONOS flows
4# -----------------------------------------------------------------------------
5
Jon Hallfb6009d2017-02-15 16:01:17 -08006aux=/tmp/stc/stc-$$.log
Ray Milkey955c4b82016-07-11 09:48:53 -07007trap "rm -f $aux 2>/dev/null" EXIT
8
9want_present=0
10
11if [ "$3" == "present" ]; then
12 want_present=1
13fi
14
15for i in {1..5}; do
16 onos ${1:-$OCI} "onos:flows added $2" > $aux
17 grep "ETH_TYPE:ipv4" $aux
18 found=$?
19
20 if [ $want_present == 1 -a $found -eq 0 ] ||
21 [ $want_present == 0 -a $found -ne 0 ]; then
22 cat $aux
23 exit 0
24 else
Ray Milkeyfa454bd2016-08-31 12:06:45 -070025 sleep 2
Ray Milkey955c4b82016-07-11 09:48:53 -070026 fi
27done
28cat $aux
29exit 1