mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 18:02:05 +02:00
30 lines
620 B
Bash
Executable File
30 lines
620 B
Bash
Executable File
#!/bin/bash
|
|
# -----------------------------------------------------------------------------
|
|
# Checks ONOS flows
|
|
# -----------------------------------------------------------------------------
|
|
|
|
aux=/tmp/stc-$$.log
|
|
trap "rm -f $aux 2>/dev/null" EXIT
|
|
|
|
want_present=0
|
|
|
|
if [ "$3" == "present" ]; then
|
|
want_present=1
|
|
fi
|
|
|
|
for i in {1..5}; do
|
|
onos ${1:-$OCI} "onos:flows added $2" > $aux
|
|
grep "ETH_TYPE:ipv4" $aux
|
|
found=$?
|
|
|
|
if [ $want_present == 1 -a $found -eq 0 ] ||
|
|
[ $want_present == 0 -a $found -ne 0 ]; then
|
|
cat $aux
|
|
exit 0
|
|
else
|
|
sleep 2
|
|
fi
|
|
done
|
|
cat $aux
|
|
exit 1
|