Fixes to allow running p4 trellis scenario
Change-Id: I4882668168521b9119692ecd696189b2b8d5f9de
(cherry picked from commit a61ba5792d9e7a25d3446f37179fbf13ac152098)
diff --git a/tools/test/bin/onos-find-device b/tools/test/bin/onos-find-device
new file mode 100755
index 0000000..fbf1692
--- /dev/null
+++ b/tools/test/bin/onos-find-device
@@ -0,0 +1,26 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Finds a device in the system.
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+aux=/tmp/stc/stc-$$.log
+trap "rm -f $aux 2>/dev/null" EXIT
+
+echo onos-find-device: $*
+
+target=${1:-$OCI}
+id=$2
+
+onos $target "onos:devices" | tee $aux
+cat $aux | fgrep "id=$id"
+
+if [ $? -ne 0 ]
+then
+ exit 1;
+fi
+
+exit 0
+
diff --git a/tools/test/bin/onos-push-bmv2 b/tools/test/bin/onos-push-bmv2
index 271c31d..d72f41e 100755
--- a/tools/test/bin/onos-push-bmv2
+++ b/tools/test/bin/onos-push-bmv2
@@ -10,9 +10,6 @@
user=$ONOS_WEB_USER
pass=$ONOS_WEB_PASS
-ssh $ONOS_USER@$node sudo rm -f ~/bmv2-mininet
-scp -qr $ONOS_ROOT/tools/dev/mininet/bmv2.py $ONOS_USER@[$node]:~/bmv2-mininet
-ssh $ONOS_USER@$node "
- echo 'export ONOS_WEB_USER=`$user`' >> ~/.bashrc
- echo 'export ONOS_WEB_PASS=`$pass`' >> ~/.bashrc
- "
\ No newline at end of file
+ssh $ONOS_USER@$node "sudo rm -rf ~/bmv2-mininet"
+ssh $ONOS_USER@$node "mkdir ~/bmv2-mininet"
+scp -qr $ONOS_ROOT/tools/dev/mininet/bmv2.py $ONOS_USER@[$node]:~/bmv2-mininet/