Build stratum as part of p4 scenario

Change-Id: Ia2dcb8a4577f402b9cf7aa9336b30349ee96de32
diff --git a/tools/test/bin/stratum-stc-build-side b/tools/test/bin/stratum-stc-build-side
new file mode 100755
index 0000000..16560c0
--- /dev/null
+++ b/tools/test/bin/stratum-stc-build-side
@@ -0,0 +1,9 @@
+cd /tmp
+rm -rf stratum
+mkdir stratum
+cd stratum
+git init
+git clone git@github.com:opennetworkinglab/stratum.git
+tar cvf stratum-sources.tar stratum
+scp stratum-sources.tar sdn@$OCN:/tmp
+scp $ONOS_ROOT/tools/dev/p4vm/install-p4-tools.sh sdn@$OCN:/tmp
diff --git a/tools/test/bin/stratum-stc-cell-side b/tools/test/bin/stratum-stc-cell-side
new file mode 100755
index 0000000..5ab945b
--- /dev/null
+++ b/tools/test/bin/stratum-stc-cell-side
@@ -0,0 +1,30 @@
+set -eu -o pipefail
+
+# install prerequisites for stratum/bmv2 build
+USE_STRATUM=true DEBUG_FLAGS=false FAST_BUILD=true CLEAN_UP=true bash /tmp/install-p4-tools.sh
+
+# install bazel
+BAZEL_VERSION="0.20.0"
+curl -L -o bazel.sh -s https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
+chmod +x bazel.sh 
+./bazel.sh --user
+export PATH=/home/sdn/bin:$PATH
+bazel version
+
+# unroll the stratum tar ball from the build machine
+cd ~/stratum
+rm -rf *
+tar xf /tmp/stratum-sources.tar
+cd stratum
+export BMV2_INSTALL=/usr/local
+
+# build stratum
+bazel build //stratum/hal/bin/bmv2:stratum_bmv2 --incompatible_remove_native_http_archive=false
+
+# deploy stratum binaries to where mininet will look for them
+mkdir -p /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2
+cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2 /home/sdn/stratum/bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2
+
+mkdir -p /home/sdn/stratum/stratum/hal/bin/bmv2
+cp bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2.runfiles/com_github_stratum_stratum/stratum/hal/bin/bmv2/dummy.json /home/sdn/stratum/stratum/hal/bin/bmv2
+