[VOL-2550] DT: Functional TC: Disable-Delete OLT
Change-Id: I31e2711ecc8e30eee971ab2c2245592a6ea8498f
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 908bfbc..59a6e55 100644
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -256,6 +256,28 @@
${logical_id}= Get Logical Device ID From SN ${olt_serial_number}
Set Suite Variable ${logical_id}
+Validate ONUs After OLT Disable
+ [Documentation] Validates the ONUs state in Voltha, ONUs port state in ONOS
+ ... and that pings do not succeed After corresponding OLT is Disabled
+ FOR ${I} IN RANGE 0 ${num_onus}
+ ${src}= Set Variable ${hosts.src[${I}]}
+ ${dst}= Set Variable ${hosts.dst[${I}]}
+ ${onu_device_id}= Get Device ID From SN ${src['onu']}
+ ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
+ ... ${of_id}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate Device ENABLED DISCOVERED
+ ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
+ Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
+ ... Wait Until Keyword Succeeds 60s 2s
+ ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
+ ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
+ Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
+ Run Keyword and Ignore Error Collect Logs
+ END
+
Delete All Devices and Verify
[Documentation] Remove any devices from VOLTHA and ONOS
# Clear devices from VOLTHA