[VOL-3973] Disable/Enable ONU and verify the subscribers accordingly
Change-Id: I0d61cab686e174ed01af42df7b22036ddd90ef1d
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 80765bf..64425d7 100755
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -427,7 +427,7 @@
... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
... volt-add-subscriber-access ${of_id} ${onu_port}
# Verify ONU state in voltha
- ${onu_reasons}= Create List omci-flows-pushed
+ ${onu_reasons}= Create List omci-flows-pushed onu-reenabled
# In case of previous dis- and enable of ONU and no further subscriber add actions state will be onu-reenabled
Run Keyword If ${supress_add_subscriber} Append To List ${onu_reasons} onu-reenabled
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
@@ -506,7 +506,7 @@
... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
... volt-add-subscriber-access ${of_id} ${onu_port}
# Verify ONU state in voltha
- ${onu_reasons}= Create List omci-flows-pushed
+ ${onu_reasons}= Create List omci-flows-pushed onu-reenabled
# In case of previous dis- and enable of ONU and no further subscriber add actions state will be onu-reenabled
Run Keyword If ${supress_add_subscriber} Append To List ${onu_reasons} onu-reenabled
Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
diff --git a/tests/tt-workflow/Voltha_TT_PODTests.robot b/tests/tt-workflow/Voltha_TT_PODTests.robot
index e9299ff..048b72b 100755
--- a/tests/tt-workflow/Voltha_TT_PODTests.robot
+++ b/tests/tt-workflow/Voltha_TT_PODTests.robot
@@ -207,6 +207,46 @@
... ${dst} ${suppressaddsubscriber}
END
+Test Disable and Enable ONU for TT
+ [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
+ ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanitytt test was executed)
+ ... Perform disable on the ONUs and validate that the pings do not succeed
+ ... Perform enable on the ONUs and validate that the pings are successful
+ [Tags] functionalTT DisableEnableONUTT
+ [Setup] Start Logging DisableEnableONUTT
+ [Teardown] Run Keywords Collect Logs
+ ... AND Stop Logging DisableEnableONUTT
+ FOR ${I} IN RANGE 0 ${num_all_onus}
+ ${src}= Set Variable ${hosts.src[${I}]}
+ ${dst}= Set Variable ${hosts.dst[${I}]}
+ ${service_type}= Get Variable Value ${src['service_type']} "null"
+ ${of_id}= Get ofID From OLT List ${src['olt']}
+ ${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}
+ Disable Device ${onu_device_id}
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
+ ... Validate Device DISABLED UNKNOWN
+ ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
+ 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']}
+ Sleep 5s
+ Enable Device ${onu_device_id}
+ Run Keyword If ${has_dataplane} and '${service_type}' == 'mcast' Clean Up Linux
+ Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
+ ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']}
+ Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure
+ ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT one ONU ${src}
+ ... ${dst} ${suppressaddsubscriber}
+ ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure
+ ... Wait Until Keyword Succeeds ${timeout} 2s Sanity Test TT MCAST one ONU ${src}
+ ... ${dst} ${suppressaddsubscriber}
+ END
+
*** Keywords ***
Setup Suite
[Documentation] Set up the test suite