[VOL-4404] Checking that flows are removed from ONOS after device deletion
Change-Id: Iccd5829ad1f7bbcf7c1844210a48d44345ed46b7
diff --git a/libraries/onos.robot b/libraries/onos.robot
index c568baf..a4219f4 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -808,12 +808,12 @@
END
Return From Keyword ${result}
-Count ADDED flows
- [Documentation] Count the flows in ADDED state in ONOS
- [Arguments] ${ip} ${port} ${targetFlows} ${deviceId}
+Count flows
+ [Documentation] Count flows in a particular ${state} in ONOS
+ [Arguments] ${ip} ${port} ${targetFlows} ${deviceId} ${state}
${flows}= Execute ONOS CLI Command use single connection ${ip} ${port}
- ... flows -s any ${deviceId} | grep ADDED | wc -l
- Log Found ${flows} of ${targetFlows} expected flows on device ${deviceId}
+ ... flows -s ${state} ${deviceId} | grep -v deviceId | wc -l
+ Log Found ${state} ${flows} of ${targetFlows} expected flows on device ${deviceId}
Should Be Equal As Integers ${targetFlows} ${flows}
Wait for all flows to in ADDED state
@@ -822,8 +822,15 @@
... ${provisioned} ${withEapol} ${withDhcp} ${withIgmp} ${withLldp}
${targetFlows}= Calculate flows by workflow ${workflow} ${uni_count} ${olt_count} ${provisioned}
... ${withEapol} ${withDhcp} ${withIgmp} ${withLldp}
- Wait Until Keyword Succeeds 10m 5s Count ADDED flows
- ... ${ip} ${port} ${targetFlows} ${deviceId}
+ Wait Until Keyword Succeeds 10m 5s Count flows
+ ... ${ip} ${port} ${targetFlows} ${deviceId} added
+
+Wait for all flows to be removed
+ [Documentation] Wait for all flows to be removed from a particular device
+ [Arguments] ${ip} ${port} ${deviceId}
+ Wait Until Keyword Succeeds 10m 5s Count flows
+ ... ${ip} ${port} 0 ${deviceId} any
+
Get Limiting Bandwidth Details
[Arguments] ${bandwidth_profile_name}
diff --git a/tests/scale/Voltha_Scale_Tests.robot b/tests/scale/Voltha_Scale_Tests.robot
index 7dcc4e8..33405e1 100755
--- a/tests/scale/Voltha_Scale_Tests.robot
+++ b/tests/scale/Voltha_Scale_Tests.robot
@@ -259,6 +259,11 @@
Remove Values From List ${olt_device_ids} ${olt_device_id}
END
+ ${onos_devices}= Compute Device IDs
+ FOR ${deviceId} IN @{onos_devices}
+ Wait for all flows to be removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${deviceId}
+ END
+
Set Suite Variable ${olt_device_ids}
*** Keywords ***