[VOL-3974] Verify re-provisioning subscriber after removing provisoned subscribed for TT

Change-Id: Ic77ebcaae05e4e72dc1d2f9230e0eedb2a4f3a9c
diff --git a/tests/tt-workflow/Voltha_TT_PODTests.robot b/tests/tt-workflow/Voltha_TT_PODTests.robot
index d811b65..619b28f 100755
--- a/tests/tt-workflow/Voltha_TT_PODTests.robot
+++ b/tests/tt-workflow/Voltha_TT_PODTests.robot
@@ -55,6 +55,8 @@
 # Per-test logging on failure is turned off by default; set this variable to enable
 ${container_log_dir}    ${None}
 
+${suppressaddsubscriber}    True
+
 *** Test Cases ***
 Reboot TT ONUs Physically - Clean Up
     [Documentation]   This test reboots ONUs physically before execution all the tests
@@ -159,6 +161,45 @@
     Run Keyword If    ${has_dataplane}    Clean Up Linux
     Wait Until Keyword Succeeds    ${timeout}   2s    Perform Sanity Tests TT
 
+Verify re-provisioning subscriber after removing provisoned subscriber for TT
+    [Documentation]    Removing/Readding a particular subscriber should have no effect on any other subscriber.
+    [Tags]    functionalTT    Readd-subscriber-TT
+    [Setup]    Start Logging    Readd-subscriber-TT
+    [Teardown]    Run Keywords    Collect Logs
+    ...           AND             Stop Logging    Readd-subscriber-TT
+    Run Keyword If    ${has_dataplane}    Clean Up Linux
+    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}
+        # Remove Subscriber Access
+        Wait Until Keyword Succeeds    ${timeout}    2s    Execute ONOS CLI Command    ${ONOS_SSH_IP}
+        ...    ${ONOS_SSH_PORT}    volt-remove-subscriber-access ${of_id} ${onu_port}
+        Run Keyword If    ${has_dataplane} and '${service_type}' != 'mcast'
+        ...    Wait Until Keyword Succeeds    ${timeout}    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']}
+        # Verify VOLTHA flows for ONU under test is Zero
+        Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device Flows
+        ...    ${onu_device_id}    0
+        # Add Subscriber Access
+        Wait Until Keyword Succeeds    ${timeout}    2s    Execute ONOS CLI Command    ${ONOS_SSH_IP}
+        ...    ${ONOS_SSH_PORT}    volt-add-subscriber-access ${of_id} ${onu_port}
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    360s    5s
+        ...    Validate Device    ENABLED    ACTIVE
+        ...    REACHABLE    ${src['onu']}    onu=True    onu_reason=omci-flows-pushed
+        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