Updates to ONOS HA Tests
Change-Id: I9f67063f7d31e41316b04b255c9cdd85b307bf33
diff --git a/libraries/k8s.robot b/libraries/k8s.robot
index 4fe057d..20a03c1 100644
--- a/libraries/k8s.robot
+++ b/libraries/k8s.robot
@@ -385,3 +385,10 @@
... kubectl -n ${namespace} get pods -l ${key}=${value} -o json | jq -r ".items[].status.phase" | wc -l
Should Be Equal as Integers ${count} ${number}
+
+Get Number of Running Pods Number By Label
+ [Arguments] ${namespace} ${key} ${value}
+ [Documentation] Returns the number of pods for a given label
+ ${rc} ${count} Run and Return Rc and Output
+ ... kubectl -n ${namespace} get pods -l ${key}=${value} -o name | wc -l
+ [Return] ${count}
diff --git a/tests/functional/Voltha_ONOSHATests.robot b/tests/functional/Voltha_ONOSHATests.robot
index 4ad78ee..a248a38 100644
--- a/tests/functional/Voltha_ONOSHATests.robot
+++ b/tests/functional/Voltha_ONOSHATests.robot
@@ -48,6 +48,7 @@
${of_id} 0
${logical_id} 0
${has_dataplane} True
+${numOfOnos} 1
${teardown_device} True
${scripts} ../../scripts
${workflow} ATT
@@ -64,6 +65,9 @@
[Setup] Start Logging onosMasterRestart
[Teardown] Run Keywords Collect Logs
... AND Stop Logging onosMasterRestart
+ ${numOfOnos}= Wait Until Keyword Succeeds 20s 5s Get Number of Running Pods Number By Label
+ ... default app onos-onos-classic
+ Pass Execution If ${numOfOnos} == 1 Skipping test: just one instance of ONOS
Delete All Devices and Verify
Setup
Run Keyword If ${has_dataplane} Clean Up Linux