[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
diff --git a/libraries/voltctl.robot b/libraries/voltctl.robot
index 2d5fbf7..f35d171 100644
--- a/libraries/voltctl.robot
+++ b/libraries/voltctl.robot
@@ -51,11 +51,18 @@
Disable Device
[Arguments] ${device_id}
- [Documentation] Enables a device in VOLTHA
+ [Documentation] Disables a device in VOLTHA
${rc} ${output}= Run and Return Rc and Output
... ${VOLTCTL_CONFIG}; voltctl device disable ${device_id}
Should Be Equal As Integers ${rc} 0
+Delete Device
+ [Arguments] ${device_id}
+ [Documentation] Deletes a device in VOLTHA
+ ${rc} ${output}= Run and Return Rc and Output
+ ... ${VOLTCTL_CONFIG}; voltctl device delete ${device_id}
+ Should Be Equal As Integers ${rc} 0
+
Disable Devices In Voltha
[Documentation] Disables all the known devices in voltha
[Arguments] ${filter}