[VOL-4556] Added TT uni-tag subscriber provision/un-provision verification
Change-Id: I8e6fd5b0e1641cf1851a77a1d45bc7cb88f13429
diff --git a/libraries/onos.robot b/libraries/onos.robot
index c996977..f1884ef 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -993,3 +993,17 @@
... curl --fail -sSL ${url}/onos/v1/applications/${app_name}
Should Be Equal As Integers ${rc} 0 Can't read app ${app_name} details from ONOS
[Return] ${output}
+
+Verify UniTag Subscriber
+ [Documentation] Verifies the unitag subscriber is provisioned/un-provisioned
+ [Arguments] ${ip} ${port} ${dev_id} ${onu_port} ${stag} ${ctag} ${tpid} ${sub_added}=True
+ ${cmd}= Catenate SEPARATOR=
+ ... volt-programmed-subscribers ${dev_id} ${onu_port} | grep "ponCTag=${ctag}, ponSTag=${stag}" | grep technologyProfileId
+ ... =${tpid} --color=none
+ ${subscriber}= Execute ONOS CLI Command use single connection ${ip} ${port} ${cmd}
+ Log ${subscriber}
+ ${sub_count}= Get Line Count ${subscriber}
+ Run Keyword If ${sub_added}
+ ... Should Be Equal As Integers ${sub_count} 1 UniTag Subscriber Not Added
+ ... ELSE
+ ... Should Be Equal As Integers ${sub_count} 0 UniTag Subscriber Not Removed
diff --git a/tests/tt-workflow/Voltha_TT_PODTests.robot b/tests/tt-workflow/Voltha_TT_PODTests.robot
index 58398e7..cb2e089 100755
--- a/tests/tt-workflow/Voltha_TT_PODTests.robot
+++ b/tests/tt-workflow/Voltha_TT_PODTests.robot
@@ -194,6 +194,9 @@
... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
... ELSE Sleep 10s Wait for flows to be deleted
+ Run Keyword If ${unitag_sub} and '${service_type}' != 'mcast'
+ ... Wait Until Keyword Succeeds ${timeout} 2s Verify UniTag Subscriber ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
+ ... ${of_id} ${onu_port} ${src['s_tag']} ${src['c_tag']} ${src['tp_id']} False
# Verify VOLTHA flows for ONU under test is Zero
# TODO: Fix ${onu_flows} calculations based on UNIs provisioned
# Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
@@ -206,6 +209,9 @@
... Set Variable volt-add-subscriber-access ${of_id} ${onu_port}
Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP}
... ${ONOS_SSH_PORT} ${add_sub_cmd}
+ Run Keyword If ${unitag_sub} and '${service_type}' != 'mcast'
+ ... Wait Until Keyword Succeeds ${timeout} 2s Verify UniTag Subscriber ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
+ ... ${of_id} ${onu_port} ${src['s_tag']} ${src['c_tag']} ${src['tp_id']}
Wait Until Keyword Succeeds ${timeout} 5s
... Validate Device ENABLED ACTIVE
... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed