VOL-572: Integration testing with Kubernetes

Updated test_dispatcher to run in the single-node Kubernetes environment, as well as
in docker-compose.

Test_dispatcher.py requires the 'scenario' object literal defined in test_voltha_xpon.py,
which it imports from that file. The import operation appears to cause code in test_voltha_xpon.py
to execute, code which requires containers to be already running. This defeats the automation
that was already built into test_dispatcher by forcing the user to manually deploy containers.
This update removes 'scenario' from test_voltha_xpon.py and puts it in a separate file, which
is then imported by each of these tests.

Change-Id: Ia049ae44686358606939daceab6543e9d455c261
diff --git a/tests/itests/env/voltha-ponsim-k8s-start.sh b/tests/itests/env/voltha-ponsim-k8s-start.sh
new file mode 100755
index 0000000..e2d82e2
--- /dev/null
+++ b/tests/itests/env/voltha-ponsim-k8s-start.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+kubectl apply -f k8s/genie-cni-1.8.yml
+
+kubectl apply -f k8s/namespace.yml
+kubectl apply -f k8s/single-node/consul.yml
+kubectl apply -f k8s/single-node/zookeeper.yml
+kubectl apply -f k8s/single-node/kafka.yml
+kubectl apply -f k8s/single-node/fluentd.yml
+
+kubectl apply -f k8s/single-node/vcore_for_consul.yml
+kubectl apply -f k8s/envoy_for_consul.yml
+kubectl apply -f k8s/single-node/vcli.yml
+kubectl apply -f k8s/single-node/ofagent.yml
+kubectl apply -f k8s/single-node/netconf.yml
+
+sudo cat <<EOF > tests/itests/env/tmp-pon0.conf
+{
+    "name": "pon0",
+    "type": "bridge",
+    "bridge": "pon0",
+    "isGateway": true,
+    "ipMask": true,
+    "ipam": {
+      "type": "host-local",
+      "subnet": "10.22.0.0/16",
+      "routes": [
+        { "dst": "0.0.0.0/0" }
+      ]
+   }
+}
+EOF
+
+sudo cp tests/itests/env/tmp-pon0.conf /etc/cni/net.d/20-pon0.conf
+rm tests/itests/env/tmp-pon0.conf
+
+kubectl apply -f k8s/freeradius-config.yml
+kubectl apply -f k8s/freeradius.yml
+kubectl apply -f k8s/olt.yml
+
+# An ONU container creates the pon0 bridge
+kubectl apply -f k8s/onu.yml
+sleep 30
+echo 8 > tests/itests/env/tmp_pon0_group_fwd_mask
+sudo cp tests/itests/env/tmp_pon0_group_fwd_mask /sys/class/net/pon0/bridge/group_fwd_mask
+rm tests/itests/env/tmp_pon0_group_fwd_mask
+
+kubectl apply -f k8s/rg.yml
+sleep 20
diff --git a/tests/itests/env/voltha-ponsim-k8s-stop.sh b/tests/itests/env/voltha-ponsim-k8s-stop.sh
new file mode 100755
index 0000000..b45eae6
--- /dev/null
+++ b/tests/itests/env/voltha-ponsim-k8s-stop.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+kubectl delete -f k8s/rg.yml
+kubectl delete -f k8s/onu.yml
+kubectl delete -f k8s/olt.yml
+kubectl delete -f k8s/freeradius.yml
+kubectl delete -f k8s/freeradius-config.yml
+
+kubectl delete -f k8s/single-node/netconf.yml
+kubectl delete -f k8s/single-node/ofagent.yml
+kubectl delete -f k8s/single-node/vcli.yml
+kubectl delete -f k8s/envoy_for_consul.yml
+kubectl delete -f k8s/single-node/vcore_for_consul.yml
+
+kubectl delete -f k8s/single-node/fluentd.yml
+kubectl delete -f k8s/single-node/kafka.yml
+kubectl delete -f k8s/single-node/zookeeper.yml
+kubectl delete -f k8s/single-node/consul.yml
+kubectl delete -f k8s/namespace.yml
+
+sleep 30
\ No newline at end of file