Update 1.6 branch tests to match master tests

Contains changes from the following patchesets:

 https://gerrit.opencord.org/c/11768/
 https://gerrit.opencord.org/c/11769/
 https://gerrit.opencord.org/c/11773/
 https://gerrit.opencord.org/c/11776/
 https://gerrit.opencord.org/c/11784/
 https://gerrit.opencord.org/c/11809/

Change-Id: I1eccd0c3cac6f8338790630e6dcfc3b9ebd7483b
diff --git a/tests/atests/build/Makefile b/tests/atests/build/Makefile
index badc017..fa8b82d 100644
--- a/tests/atests/build/Makefile
+++ b/tests/atests/build/Makefile
@@ -91,29 +91,22 @@
 	cd $(HOME)/cord/helm-charts; helm upgrade --install onos onos -f configs/onos.yaml -f configs/seba-ponsim.yaml --set images.onos.repository=voltha-onos,images.onos.tag=latest,images.onos.pullPolicy=Never
 	touch $@
 
-$(M)/voltha: | $(M)/kafka-running $(M)/onos
+$(M)/voltha: | $(M)/kafka-running $(M)/etcd-operator-ready
 	cd $(HOME)/cord/helm-charts; helm dep up voltha
-	cd $(HOME)/cord/helm-charts; helm upgrade --install voltha voltha -f configs/seba-ponsim.yaml --set images.vcore.repository=voltha-voltha,images.vcore.tag=latest,images.vcore.pullPolicy=Never,images.envoy_for_etcd.repository=voltha-envoy,images.envoy_for_etcd.tag=latest,images.envoy_for_etcd.pullPolicy=Never,images.netconf.repository=voltha-netconf,images.netconf.tag=latest,images.netconf.pullPolicy=Never,images.ofagent.repository=voltha-ofagent,images.ofagent.tag=latest,images.ofagent.pullPolicy=Never,images.vcli.repository=voltha-cli,images.vcli.tag=latest,images.vcli.pullPolicy=Never,etcd-operator.customResources.createEtcdClusterCRD=false
+	cd $(HOME)/cord/helm-charts; helm upgrade --install voltha voltha -f configs/seba-ponsim.yaml --set images.vcore.repository=voltha/voltha-voltha,images.vcore.tag=latest,images.vcore.pullPolicy=Never,images.envoy_for_etcd.repository=voltha/voltha-envoy,images.envoy_for_etcd.tag=latest,images.envoy_for_etcd.pullPolicy=Never,images.netconf.repository=voltha/voltha-netconf,images.netconf.tag=latest,images.netconf.pullPolicy=Never,images.ofagent.repository=voltha/voltha-ofagent,images.ofagent.tag=latest,images.ofagent.pullPolicy=Never,images.vcli.repository=voltha/voltha-cli,images.vcli.tag=latest,images.vcli.pullPolicy=Never
 	touch $@
 
-$(M)/etcd-operator-ready: | $(M)/voltha
-	until kubectl api-versions | grep etcd.database.coreos.com/v1beta2; \
+$(M)/etcd-operator-ready: | $(HOME)/cord/helm-charts $(M)/helm-init
+	cd $(HOME)/cord/helm-charts; helm upgrade --install etcd-operator stable/etcd-operator -f configs/seba-ponsim.yaml
+	until kubectl get crd | grep etcdclusters; \
 	do \
-		echo "Waiting for etcd.database.coreos.com/v1beta2 to be available"; \
-		sleep 5; \
-	done
-	until kubectl api-resources | grep EtcdCluster; \
-	do \
-		echo "Waiting for EtcdCluster API resource to be available"; \
+		echo "Waiting for etcdclusters CRD to be available"; \
 		sleep 5; \
 	done
 	touch $@
 
-$(M)/etcd-cluster: | $(M)/etcd-operator-ready
-	cd $(HOME)/cord/helm-charts; helm upgrade --install voltha voltha -f configs/seba-ponsim.yaml --set images.vcore.repository=voltha-voltha,images.vcore.tag=latest,images.vcore.pullPolicy=Never,images.envoy_for_etcd.repository=voltha-envoy,images.envoy_for_etcd.tag=latest,images.envoy_for_etcd.pullPolicy=Never,images.netconf.repository=voltha-netconf,images.netconf.tag=latest,images.netconf.pullPolicy=Never,images.ofagent.repository=voltha-ofagent,images.ofagent.tag=latest,images.ofagent.pullPolicy=Never,images.vcli.repository=voltha-cli,images.vcli.tag=latest,images.vcli.pullPolicy=Never,etcd-operator.customResources.createEtcdClusterCRD=true
-	touch $@
-
-$(M)/voltha-running: | $(M)/etcd-cluster
+$(M)/voltha-running: | $(M)/voltha
+	timeout 180s bash -c "until kubectl get pod|grep etcd-cluster|grep 1/1; do echo 'Waiting for etcd-cluster to be ready'; sleep 10; done"
 	$(HOME)/cord/helm-charts/scripts/wait_for_pods.sh voltha
 	touch $@
 
diff --git a/tests/atests/robot/voltha_automated_test_suite.robot b/tests/atests/robot/voltha_automated_test_suite.robot
index ca0da45..0ac9ae4 100755
--- a/tests/atests/robot/voltha_automated_test_suite.robot
+++ b/tests/atests/robot/voltha_automated_test_suite.robot
@@ -14,16 +14,15 @@
 
 *** Settings ***
 Library           Process
+Library           OperatingSystem
 Library           ../common/auto_test.py
 Library           ../common/volthaMngr.py
 Library           ../common/preprovisioning.py
 Library           volthaMngr.VolthaMngr
-LIbrary           preprovisioning.Preprovisioning
-
+Library           preprovisioning.Preprovisioning
 Test Setup        Start Voltha      
 Test Teardown     Stop Voltha
 
-
 *** Variables ***
 ${LOG_DIR}        /tmp/voltha_test_results
 ${ROOT_DIR}       ${EMPTY}
@@ -44,9 +43,9 @@
     PSet Log Dirs    ${LOG_DIR}
     Configure   ${OLT_IP_ADDR}    ${OLT_PORT_ID}
     Preprovision Olt
-    Query Devices Before Enable
+    Wait Until Keyword Succeeds    60s    2s    Query Devices Before Enable
     Enable
-    Query Devices After Enable
+    Wait Until Keyword Succeeds    60s    2s    Query Devices After Enable
 
 
 *** Keywords ***
@@ -58,15 +57,14 @@
     VSet Log Dirs  ${ROOT_DIR}    ${VOLTHA_DIR}    ${LOG_DIR}
     Stop Voltha
     Start All Pods
+    Sleep    60
     Collect Pod Logs
+    ${pod_status}    Run    kubectl get pods --all-namespaces
+    Log To Console    \n ${pod_status}
     Alter Onos NetCfg
     
-    
 Stop Voltha
     [Documentation]     Stop Voltha infrastucture. This includes clearing all installation milestones 
-    ...                 files and stopping all Kubernetes pods 
+    ...                 files and stopping all Kubernetes pods
     Stop All Pods
-    Reset Kube Adm
-    
-    
-    
+    Reset Kube Adm