Refactor activate/deactivate of forwarding app
Change-Id: Iae71b3334fba08dceac7adb47a457ae0af0dcabc
diff --git a/tools/test/bin/onos-check-ipv4-flows b/tools/test/bin/onos-check-ipv4-flows
new file mode 100755
index 0000000..44d321f
--- /dev/null
+++ b/tools/test/bin/onos-check-ipv4-flows
@@ -0,0 +1,29 @@
+#!/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 1
+ fi
+done
+cat $aux
+exit 1