blob: 44d321fc300e9b97ab15f61606cfa2832286c682 [file] [log] [blame]
Ray Milkey955c4b82016-07-11 09:48:53 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks ONOS flows
4# -----------------------------------------------------------------------------
5
6aux=/tmp/stc-$$.log
7trap "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
25 sleep 1
26 fi
27done
28cat $aux
29exit 1