Checking that the LLDP flow is installed as part of the sanity test

Change-Id: Ie8200673a2cdc61064cf3ede89f378a10cf00460
diff --git a/libraries/onos.robot b/libraries/onos.robot
index a4219f4..c988543 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -198,6 +198,14 @@
     ${master_node}=    Get From Dictionary    ${jsondata}    nodeId
     [Return]    ${master_node}
 
+Verify LLDP Flow Added
+    [Arguments]    ${ip}    ${port}    ${olt_of_id}    ${expected_flows}
+    [Documentation]    Matches for total number of LLDP flows added for one OLT
+    ${lldp_flows_added}=    Execute ONOS CLI Command use single connection    ${ip}    ${port}
+    ...    flows -s ADDED ${olt_of_id} | grep -v deviceId | grep ETH_TYPE:lldp | grep -v ETH_TYPE:arp
+    ${lldp_flows_added_count}=      Get Line Count      ${lldp_flows_added}
+    Should Be Equal As Integers    ${lldp_flows_added_count}    ${expected_flows}
+
 Verify Subscriber Access Flows Added for ONU
     [Arguments]    ${ip}    ${port}    ${olt_of_id}    ${onu_port}    ${nni_port}    ${c_tag}    ${s_tag}
     [Documentation]    Verifies if the Subscriber Access Flows are added in ONOS for the ONU
diff --git a/libraries/utils.robot b/libraries/utils.robot
index 0595d3b..df169e3 100755
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -229,6 +229,9 @@
         Run Keyword Unless    ${supress_add_subscriber}
         ...    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
         ...    Verify Eapol Flows Added For ONU    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}    ${onu_port}
+        # Verify LLDP flow in ONOS
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...     Verify LLDP Flow Added      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}      1
         # Verify ONU state in voltha
         Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s    Validate Device
         ...    ENABLED    ACTIVE    REACHABLE
@@ -288,6 +291,9 @@
         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}
+        # Verify LLDP flow in ONOS
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...     Verify LLDP Flow Added      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}      1
         # 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
@@ -433,6 +439,9 @@
         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 LLDP flow in ONOS
+        Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    5s
+        ...     Verify LLDP Flow Added      ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}    ${of_id}      1
         # 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