Updated flow count check in case of device disable for DT and TT workflow;
Updated documentation with TIM workflow details.

Change-Id: I5cd4d2eb35e4a10b4c75dbfdd05678eb8a2e18d1
diff --git a/README.md b/README.md
index 3c82a26..83e4362 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,7 @@
   └── functional/           // feature/functionality tests, recovery tests and more, that are specific to ATT workflow
   └── dt-workflow/          // feature/functionality tests, recovery tests and more, that are specific to DT workflow
   └── tt-workflow/          // feature/functionality tests, recovery tests and more, that are specific to TT workflow
+  └── tim-workflow/         // feature/functionality tests, recovery tests and more, that are specific to TIM workflow
   └── scale/                // tests that collect measurements on Voltha performance
   └── software-upgrades/    // tests for ONOS Applications, Voltha Components and ONU Software Upgrades
   └── dmi-interface/        // tests for device management interface
@@ -99,6 +100,19 @@
 If you're running on a remote system, you can start a web server with `python3
 -m http.server`.
 
+### TIM Workflow
+To run the sanity tests for the TIM Workflow, use `sanity-kind-tim` as the make target.
+```bash
+git clone https://github.com/opencord/voltha-system-tests
+make -C voltha-system-tests sanity-kind-tim
+```
+
+The tests generate three report files in
+`voltha-system-tests/tests/tim-workflow/` (`output.xml`, `report.html`, `log.html`).
+View the `report.html` page in a browser to analyze the results.
+If you're running on a remote system, you can start a web server with `python3
+-m http.server`.
+
 
 ## Test variables
 
diff --git a/tests/dt-workflow/Voltha_DT_PODTests.robot b/tests/dt-workflow/Voltha_DT_PODTests.robot
index 4636a08..eb8b146 100755
--- a/tests/dt-workflow/Voltha_DT_PODTests.robot
+++ b/tests/dt-workflow/Voltha_DT_PODTests.robot
@@ -275,24 +275,21 @@
         Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate ONUs After OLT Disable
         ...    ${num_onus}    ${olt_serial_number}
         # Verify ONOS Flows
-        # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream)
-        ${onos_flows_count}=    Evaluate    4 * ${num_onus}
+        # Number of Access Flows on ONOS equals zero
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
         ...    Verify Subscriber Access Flows Added Count DT    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
-        ...    ${of_id}    ${onos_flows_count}
+        ...    ${of_id}    0
         # Verify VOLTHA Flows
-        # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
-        ${olt_flows}=    Evaluate    2 * ${num_onus} + 1
-        # Number of per ONU Flows equals 2 (one each for downstream and upstream)
-        ${onu_flows}=    Set Variable    2
+        # Number of per OLT Flows equals 1 for LLDP
+        # Number of per ONU Flows equals 0
         Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Flows
-        ...    ${olt_flows}    ${olt_device_id}
+        ...    1    ${olt_device_id}
         ${List_ONU_Serial}    Create List
         Set Suite Variable    ${List_ONU_Serial}
         Build ONU SN List    ${List_ONU_Serial}    ${olt_serial_number}    ${num_onus}
         Log    ${List_ONU_Serial}
         Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate ONU Flows
-        ...    ${List_ONU_Serial}    ${onu_flows}
+        ...    ${List_ONU_Serial}    0
         # Delete OLT and Validate Empty Device List
         Delete Device    ${olt_device_id}
         # Check that the OLT and the ONUs are actually removed from the system
diff --git a/tests/tt-workflow/Voltha_TT_PODTests.robot b/tests/tt-workflow/Voltha_TT_PODTests.robot
index b720586..b5419b9 100755
--- a/tests/tt-workflow/Voltha_TT_PODTests.robot
+++ b/tests/tt-workflow/Voltha_TT_PODTests.robot
@@ -146,28 +146,12 @@
         Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate ONUs After OLT Disable
         ...    ${num_onus}    ${olt_serial_number}
         # Verify ONOS Flows
-        # Number of Access Flows on ONOS equals 16 * the Number of Active ONUs + 3 for default LLDP, IGMP and DHCP
-        ${onos_flows_count}=    Run Keyword If    ${has_dataplane}    Evaluate    16 * ${num_of_provisioned_onus} + 3
-        ...    ELSE    Evaluate    15 * ${num_of_provisioned_onus} + 3
+        # When we disable the device should only have 3 default flows LLDP, IGMP and DHCP
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
-        ...    Verify Added Flow Count for OLT TT    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}
-        ...    ${onos_flows_count}
+        ...    Verify Added Flow Count for OLT TT    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}    3
         # Verify VOLTHA Flows
-        # Number of per OLT Flows equals 10 * Number of Active ONUs  + 3 for default LLDP, IGMP and DHCP
-        ${olt_flows}=    Run Keyword If    ${has_dataplane}    Evaluate    10 * ${num_of_provisioned_onus} + 3
-        ...    ELSE    Evaluate    9 * ${num_of_provisioned_onus} + 3
-        # Number of per ONU Flows equals 6 for 3play service data plane + 4 for Trap to Host Flows
-        ${onu_flows}=    Run Keyword If    ${has_dataplane}    Set Variable    10
-        ...    ELSE    Set Variable    9
-        Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Flows    ${olt_flows}
+        Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate OLT Flows    3
         ...    ${olt_device_id}
-        ${List_ONU_Serial}    Create List
-        Set Suite Variable    ${List_ONU_Serial}
-        Build ONU SN List    ${List_ONU_Serial}    ${olt_serial_number}    ${num_onus}
-        Log    ${List_ONU_Serial}
-        # TODO: Fix ${onu_flows} calculations based on UNIs provisioned
-        # Run Keyword    Wait Until Keyword Succeeds    ${timeout}    5s    Validate ONU Flows
-        # ...    ${List_ONU_Serial}    ${onu_flows}
         # Delete OLT and Validate Empty Device List
         Delete Device    ${olt_device_id}
         # Check that the OLT and the ONUs are actually removed from the system