Use consistent naming in vpn suite
[integration/test.git] / csit / libraries / VpnOperations.robot
index 83e930cb122d3e77da4589906ee8f89f231c5946..e4f0db20503a2420c72954a843b67f1cc2eff12a 100644 (file)
@@ -3,182 +3,93 @@ Documentation     Openstack library. This library is useful for tests to create
 Library           SSHLibrary
 Resource          Utils.robot
 Resource          TemplatedRequests.robot
+Resource          KarafKeywords.robot
 Resource          ../variables/Variables.robot
 Library           Collections
 Library           String
 Library           OperatingSystem
-Variables         ../variables/Variables.py
 
 *** Variables ***
-${VPN_INSTANCE_DELETE}    vpn1_instance_delete.json
-${GETL3VPN}       GETL3vpn.json
-${CREATE_RESP_CODE}    200
-${CREATE_ID_DEFAULT}    "4ae8cd92-48ca-49b5-94e1-b2921a2661c7"
-${CREATE_NAME_DEFAULT}    "vpn1"
-${CREATE_ROUTER_DISTINGUISHER_DEFAULT}    ["2200:1"]
-${CREATE_EXPORT_RT_DEFAULT}    ["3300:1","8800:1"]
-${CREATE_IMPORT_RT_DEFAULT}    ["3300:1","8800:1"]
-${CREATE_TENANT_ID_DEFAULT}    "6c53df3a-3456-11e5-a151-feff819cdc9f"
-${VPN_CONFIG_DIR}    ${CURDIR}/../variables/vpnservice
-${ITM_CREATE_JSON}    itm_tunnel_create.json
-${itm_prefix_def}    "1.1.1.1/24"
-${itm_vlan-id_def}    0
-${itm_dpn-id1_def}    1
-${itm_portname1_def}    "BR1-eth1"
-${itm_ip-address1_def}    "2.2.2.2"
-${itm_dpn-id2_def}    2
-${itm_portname2_def}    "BR2-eth1"
-${itm_ip-address2_def}    "3.3.3.3"
-${itm_gateway-ip_def}    "0.0.0.0"
-${itm_tunnel-type_def}    vxlan
-${itm_zone-name_def}    TZA
+&{ITM_CREATE_DEFAULT}    tunneltype=vxlan    vlanid=0    prefix=1.1.1.1/24    gateway=0.0.0.0    dpnid1=1    portname1=BR1-eth1    ipaddress1=2.2.2.2
+...               dpnid2=2    portname2= BR2-eth1    ipaddress2=3.3.3.3
+&{L3VPN_CREATE_DEFAULT}    vpnid=4ae8cd92-48ca-49b5-94e1-b2921a261111    name=vpn1    rd=["2200:1"]    exportrt=["2200:1","8800:1"]    importrt=["2200:1","8800:1"]    tenantid=6c53df3a-3456-11e5-a151-feff819cdc9f
 ${VAR_BASE}       ${CURDIR}/../variables/vpnservice/
+${ODL_FLOWTABLE_L3VPN}    21
+${STATE_UP}       UP
+${STATE_DOWN}     DOWN
+${STATE_UNKNOWN}    UNKNOWN
+${STATE_ENABLE}    ENABLED
+${STATE_DISABLE}    DISABLE
 
 *** Keywords ***
+Basic Vpnservice Suite Setup
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown
+    DevstackUtils.Devstack Suite Setup
+
+Basic Vpnservice Suite Teardown
+    # Delete three L3VPNs created using Multiple L3VPN Test
+    Run Keyword And Ignore Error    VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
+    Run Keyword And Ignore Error    VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[1]}
+    Run Keyword And Ignore Error    VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[2]}
+    ${VM_INSTANCES} =    Create List    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
+    : FOR    ${VmInstance}    IN    @{VM_INSTANCES}
+    \    Run Keyword And Ignore Error    Delete Vm Instance    ${VmInstance}
+    : FOR    ${Port}    IN    @{PORT_LIST}
+    \    Run Keyword And Ignore Error    Delete Port    ${Port}
+    : FOR    ${Subnet}    IN    @{SUBNETS}
+    \    Run Keyword And Ignore Error    Delete SubNet    ${Subnet}
+    : FOR    ${Network}    IN    @{NETWORKS}
+    \    Run Keyword And Ignore Error    Delete Network    ${Network}
+    Run Keyword And Ignore Error    Delete SecurityGroup    ${SECURITY_GROUP}
+    Close All Connections
+
 VPN Create L3VPN
-    [Arguments]    ${vpn_instance}    &{Kwargs}
+    [Arguments]    &{Kwargs}
     [Documentation]    Create an L3VPN using the Json using the list of optional arguments received.
-    @{KeysList}    Create List    CREATE_ID    CREATE_NAME    CREATE_ROUTER_DISTINGUISHER    CREATE_EXPORT_RT    CREATE_IMPORT_RT
-    ...    CREATE_TENANT_ID
-    ${body} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${vpn_instance}
-    Log    Body:${body}
-    Run Keyword If    ${Kwargs}    Log    ${Kwargs}
-    ${CREATE_ID} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[0]}    default=${CREATE_ID_DEFAULT}
-    ${body} =    Replace String    ${body}    ${CREATE_ID_DEFAULT}    ${CREATE_ID}
-    Log    ID:${CREATE_ID}
-    ${CREATE_NAME} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[1]}    default=${CREATE_NAME_DEFAULT}
-    ${body} =    Replace String    ${body}    ${CREATE_NAME_DEFAULT}    ${CREATE_NAME}
-    Log    NAME:${CREATE_NAME}
-    ${CREATE_ROUTER_DISTINGUISHER} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[2]}    default=${CREATE_ROUTER_DISTINGUISHER_DEFAULT}
-    ${body} =    Replace String    ${body}    ${CREATE_ROUTER_DISTINGUISHER_DEFAULT}    ${CREATE_ROUTER_DISTINGUISHER}
-    Log    ROUTER_DISTIGNSHER:${CREATE_ROUTER_DISTINGUISHER}
-    ${CREATE_EXPORT_RT} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[3]}    default=${CREATE_EXPORT_RT_DEFAULT}
-    ${body} =    Replace String    ${body}    ${CREATE_EXPORT_RT_DEFAULT}    ${CREATE_EXPORT_RT}
-    Log    EXPORT_RT:${CREATE_EXPORT_RT}
-    ${CREATE_IMPORT_RT} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[4]}    default=${CREATE_IMPORT_RT_DEFAULT}
-    ${body} =    Replace String    ${body}    ${CREATE_IMPORT_RT_DEFAULT}    ${CREATE_IMPORT_RT}
-    Log    IMPORT_RT:${CREATE_IMPORT_RT}
-    ${CREATE_TENANT_ID} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[5]}    default=${CREATE_TENANT_ID_DEFAULT}
-    ${body} =    Replace String    ${body}    ${CREATE_TENANT_ID_DEFAULT}    ${CREATE_TENANT_ID}
-    Log    TENANT_ID:${CREATE_TENANT_ID}
-    Set Global Variable    ${GET_ID}    ${CREATE_ID}
-    Log    ${body}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:createL3VPN    data=${body}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
-    ${body1} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${GETL3VPN}
-    ${body1} =    Replace String    ${body1}    ${CREATE_ID_DEFAULT}    ${CREATE_ID}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:getL3VPN    data=${body1}
-    Log    ${resp}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
+    Run keyword if    "routerid" in ${Kwargs}    Collections.Set_To_Dictionary    ${Kwargs}    router=, "router-id":"${Kwargs['routerid']}"
+    ...    ELSE    Collections.Set_To_Dictionary    ${Kwargs}    router=${empty}
+    &{L3vpn_create_actual_val} =    Collections.Copy_Dictionary    ${L3VPN_CREATE_DEFAULT}
+    Collections.Set_To_Dictionary    ${L3vpn_create_actual_val}    &{Kwargs}
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/l3vpn_create    mapping=${L3vpn_create_actual_val}    session=session
 
 VPN Get L3VPN
-    [Arguments]    ${GET_L3VPN_ID}
+    [Arguments]    &{Kwargs}
     [Documentation]    Will return detailed list of the L3VPN_ID received
-    ${body1} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${GETL3VPN}
-    ${body1} =    Replace String    ${body1}    ${CREATE_ID_DEFAULT}    ${GET_L3VPN_ID}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:getL3VPN    data=${body1}
+    ${resp} =    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/get_l3vpn    mapping=${Kwargs}    session=session
     Log    ${resp}
-    Log    BODY:${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
-    [Return]    ${resp.content}
+    [Return]    ${resp}
 
 Associate L3VPN To Network
     [Arguments]    &{Kwargs}
     [Documentation]    Associate the created L3VPN to a network-id received as dictionary argument
-    ${resp} =    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/assoc_l3vpn    mapping=${Kwargs}    session=session
-    Log    ${resp}
-    Get L3VPN Association
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/assoc_l3vpn    mapping=${Kwargs}    session=session
 
 Dissociate L3VPN From Networks
     [Arguments]    &{Kwargs}
     [Documentation]    Disssociate the already associated networks from L3VPN
-    ${resp} =    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/dissoc_l3vpn    mapping=${Kwargs}    session=session
-    Log    ${resp}
-    Get L3VPN Association
-
-Get L3VPN Association
-    [Documentation]    Will return detailed list of L3VPN created and associated networks
-    ${resp} =    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/get_l3vpn    mapping={"getid":${GET_ID}}    session=session
-    Log    ${resp}
-    [Return]    ${resp}
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/dissoc_l3vpn    mapping=${Kwargs}    session=session
 
 Associate VPN to Router
-    [Arguments]    ${ROUTER}    ${VPN_INSTANCE_NAME}
+    [Arguments]    &{Kwargs}
     [Documentation]    Associate the created L3VPN to a router-id received as argument
-    ${body} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/vpn_router.json
-    ${body} =    Replace String    ${body}    VPN_ID    ${VPN_INSTANCE_NAME}
-    ${body} =    Replace String    ${body}    ROUTER_ID    ${ROUTER}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:associateRouter    data=${body}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
-    ${body1} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${GETL3VPN}
-    ${body1} =    Replace String    ${body1}    ${CREATE_ID_DEFAULT}    ${GET_ID}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:getL3VPN    data=${body1}
-    Log    ${resp}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/assoc_router_l3vpn    mapping=${Kwargs}    session=session
 
 Dissociate VPN to Router
-    [Arguments]    ${ROUTER}    ${VPN_INSTANCE_NAME}
+    [Arguments]    &{Kwargs}
     [Documentation]    Dissociate the already associated routers from L3VPN
-    ${body} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/vpn_router.json
-    ${body} =    Replace String    ${body}    VPN_ID    ${VPN_INSTANCE_NAME}
-    ${body} =    Replace String    ${body}    ROUTER_ID    ${ROUTER}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:dissociateRouter    data=${body}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
-    ${body1} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${GETL3VPN}
-    ${body1} =    Replace String    ${body1}    ${CREATE_ID_DEFAULT}    ${GET_ID}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:getL3VPN    data=${body1}
-    Log    ${resp}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/dissoc_router_l3vpn    mapping=${Kwargs}    session=session
 
 VPN Delete L3VPN
-    [Arguments]    ${DEL_L3VPN_ID}
+    [Arguments]    &{Kwargs}
     [Documentation]    Delete the created L3VPN
-    ${body1} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${VPN_INSTANCE_DELETE}
-    Log    ${body1}
-    ${body1} =    Replace String    ${body1}    ${CREATE_ID_DEFAULT}    ${DEL_L3VPN_ID}
-    ${resp} =    RequestsLibrary.Post Request    session    ${OPERATIONS_API}/neutronvpn:deleteL3VPN    ${body1}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    ${CREATE_RESP_CODE}
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/l3vpn_delete    mapping=${Kwargs}    session=session
 
 ITM Create Tunnel
     [Arguments]    &{Kwargs}
     [Documentation]    Creates Tunnel between the two DPNs received in the dictionary argument
-    @{KeysList}    Create List    prefix    vlan-id    dpn-id1    portname1    ip-address1
-    ...    dpn-id2    portname2    ip-address2    gateway-ip    tunnel-type    zone-name
-    Log    Arguments Received:${Kwargs}
-    ${json_body} =    OperatingSystem.Get File    ${VPN_CONFIG_DIR}/${ITM_CREATE_JSON}
-    Run Keyword If    ${Kwargs}    Log    ${Kwargs}
-    Log    json_body:${json_body}
-    ${prefix} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[0]}    default=${itm_prefix_def}
-    ${json_body} =    Replace String    ${json_body}    prefix\"\:${itm_prefix_def}    prefix\"\:${prefix}
-    ${vlan-id} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[1]}    default=${itm_vlan-id_def}
-    ${json_body} =    Replace String    ${json_body}    vlan-id\"\:${itm_vlan-id_def}    vlan-id\"\:${vlan-id}
-    ${dpn-id1} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[2]}    default=${itm_dpn-id1_def}
-    ${json_body} =    Replace String    ${json_body}    dpn-id\"\:${itm_dpn-id1_def},    dpn-id\"\:${dpn-id1},
-    ${portname1} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[3]}    default=${itm_portname1_def}
-    ${json_body} =    Replace String    ${json_body}    portname\"\:${itm_portname1_def}    portname\"\:${portname1}
-    ${ip-address1} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[4]}    default=${itm_ip-address1_def}
-    ${json_body} =    Replace String    ${json_body}    ip-address\"\:${itm_ip-address1_def}    ip-address\"\:${ip-address1}
-    ${dpn-id2} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[5]}    default=${itm_dpn-id2_def}
-    ${json_body} =    Replace String    ${json_body}    dpn-id\"\:${itm_dpn-id2_def},    dpn-id\"\:${dpn-id2},
-    ${portname2} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[6]}    default=${itm_portname2_def}
-    ${json_body} =    Replace String    ${json_body}    portname\"\:${itm_portname2_def}    portname\"\:${portname2}
-    ${ip-address2} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[7]}    default=${itm_ip-address2_def}
-    ${json_body} =    Replace String    ${json_body}    ip-address\"\:${itm_ip-address2_def}    ip-address\"\:${ip-address2}
-    ${gateway-ip} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[8]}    default=${itm_gateway-ip_def}
-    ${json_body} =    Replace String    ${json_body}    gateway-ip\"\:${itm_gateway-ip_def}    gateway-ip\"\:${gateway-ip}
-    ${tunnel-type} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[9]}    default=${itm_tunnel-type_def}
-    ${json_body} =    Replace String    ${json_body}    \:tunnel-type-${itm_tunnel-type_def}    \:tunnel-type-${tunnel-type}
-    ${zone-name} =    Run Keyword If    ${Kwargs} != None    Pop From Dictionary    ${Kwargs}    ${KeysList[10]}    default=${itm_zone-name_def}
-    ${json_body} =    Replace String    ${json_body}    \"zone-name\":\"${itm_zone-name_def}    \"zone-name\":\"${zone-name}
-    Log    ${json_body}
-    ${resp} =    RequestsLibrary.Post Request    session    ${CONFIG_API}/itm:transport-zones/    data=${json_body}
-    Log    ${resp.content}
-    Log    ${resp.status_code}
-    Should Be Equal As Strings    ${resp.status_code}    204
+    &{Itm_actual_val} =    Collections.Copy_Dictionary    ${ITM_CREATE_DEFAULT}
+    Collections.Set_To_Dictionary    ${Itm_actual_val}    &{Kwargs}
+    TemplatedRequests.Post_As_Json_Templated    folder=${VAR_BASE}/itm_create    mapping=${Itm_actual_val}    session=session
 
 ITM Get Tunnels
     [Documentation]    Get all Tunnels and return the contents
@@ -194,3 +105,145 @@ ITM Delete Tunnel
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     [Return]    ${resp.content}
+
+Verify Flows Are Present For L3VPN
+    [Arguments]    ${ip}    ${vm_ips}
+    [Documentation]    Verify Flows Are Present For L3VPN
+    ${flow_output}=    Run Command On Remote System And Log    ${ip}    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+    Should Contain    ${flow_output}    table=${ODL_FLOWTABLE_L3VPN}
+    ${l3vpn_table} =    Get Lines Containing String    ${flow_output}    table=${ODL_FLOWTABLE_L3VPN},
+    Log    ${l3vpn_table}
+    : FOR    ${i}    IN    @{vm_ips}
+    \    ${resp}=    Should Contain    ${l3vpn_table}    ${i}
+
+Verify GWMAC Entry On ODL
+    [Arguments]    ${GWMAC_ADDRS}
+    [Documentation]    get ODL GWMAC table entry
+    ${resp} =    RequestsLibrary.Get Request    session    ${VPN_PORT_DATA_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${macAdd}    IN    @{GWMAC_ADDRS}
+    \    Should Contain    ${resp.content}    ${macAdd}
+
+Verify GWMAC Flow Entry Removed From Flow Table
+    [Arguments]    ${cnIp}
+    [Documentation]    Verify the GWMAC Table, ARP Response table and Dispatcher table.
+    ${flow_output}=    Run Command On Remote System And Log    ${cnIp}    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+    Should Contain    ${flow_output}    table=${GWMAC_TABLE}
+    ${gwmac_table} =    Get Lines Containing String    ${flow_output}    table=${GWMAC_TABLE}
+    Log    ${gwmac_table}
+    #Verify GWMAC address present in table 19
+    : FOR    ${macAdd}    IN    @{GWMAC_ADDRS}
+    \    Should Not Contain    ${gwmac_table}    dl_dst=${macAdd} actions=goto_table:${L3_TABLE}
+
+Verify ARP REQUEST in groupTable
+    [Arguments]    ${group_output}    ${Group-ID}
+    [Documentation]    get flow dump for group ID
+    Should Contain    ${group_output}    group_id=${Group-ID}
+    ${arp_group} =    Get Lines Containing String    ${group_output}    group_id=${Group-ID}
+    Log    ${arp_group}
+    Should Match Regexp    ${arp_group}    ${ARP_REQUEST_GROUP_REGEX}
+
+Verify Tunnel Status as UP
+    [Documentation]    Verify that the tunnels are UP
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
+    Log    ${output}
+    Should Contain    ${output}    ${STATE_UP}
+    Should Not Contain    ${output}    ${STATE_DOWN}
+    Should Not Contain    ${output}    ${STATE_UNKNOWN}
+
+Verify Tunnel Status as DOWN
+    [Documentation]    Verify that the tunnels are DOWN
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
+    Log    ${output}
+    Should Contain    ${output}    ${STATE_DOWN}
+    Should Not Contain    ${output}    ${STATE_UP}
+    Should Not Contain    ${output}    ${STATE_UNKNOWN}
+
+Verify Tunnel Status as UNKNOWN
+    [Documentation]    Verify that the tunnels are in Unknown state
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
+    Log    ${output}
+    Should Not Contain    ${output}    ${STATE_UP}
+    Should Not Contain    ${output}    ${STATE_DOWN}
+    Should Contain    ${output}    ${STATE_UNKNOWN}
+
+Verify VXLAN interface
+    [Documentation]    Verify that the VXLAN interfaces are Enabled
+    ${output}=    Issue Command On Karaf Console    ${VXLAN_SHOW}
+    Log    ${output}
+    Should Contain    ${output}    ${STATE_UP}
+    Should Contain    ${output}    ${STATE_ENABLE}
+    Should Not Contain    ${output}    ${STATE_DISABLE}
+
+Get Fib Entries
+    [Arguments]    ${session}
+    [Documentation]    Get Fib table entries from ODL session
+    ${resp}    RequestsLibrary.Get Request    ${session}    ${FIB_ENTRIES_URL}
+    Log    ${resp.content}
+    [Return]    ${resp.content}
+
+Get Gateway MAC And IP Address
+    [Arguments]    ${router_Name}    ${ip_regex}=${IP_REGEX}
+    [Documentation]    Get Gateway mac and IP Address
+    ${output} =    Write Commands Until Prompt    neutron router-port-list ${router_Name}    30s
+    @{MacAddr-list} =    Get Regexp Matches    ${output}    ${MAC_REGEX}
+    @{IpAddr-list} =    Get Regexp Matches    ${output}    ${ip_regex}
+    [Return]    ${MacAddr-list}    ${IpAddr-list}
+
+Test Teardown With Tcpdump Stop
+    [Arguments]    ${cn1_conn_id}    ${cn2_conn_id}    ${os_conn_id}
+    Stop Packet Capture on Node    ${cn1_conn_id}
+    Stop Packet Capture on Node    ${cn2_conn_id}
+    Stop Packet Capture on Node    ${os_conn_id}
+    Get Test Teardown Debugs
+
+Verify IPv4 GWMAC Flow Entry On Flow Table
+    [Arguments]    ${group_output}    ${group_id}    ${flow_output}
+    Verify ARP REQUEST in groupTable    ${group_output}    ${groupID[1]}
+    #Verify ARP_RESPONSE_TABLE - 81
+    Should Contain    ${flow_output}    table=${ARP_RESPONSE_TABLE}
+    ${arpResponder_table} =    Get Lines Containing String    ${flow_output}    table=${ARP_RESPONSE_TABLE}
+    Should Contain    ${arpResponder_table}    priority=0 actions=drop
+    : FOR    ${macAdd}    ${ipAdd}    IN ZIP    ${GWMAC_ADDRS}    ${GWIP_ADDRS}
+    \    ${ARP_RESPONSE_IP_MAC_REGEX} =    Set Variable    arp_tpa=${ipAdd},arp_op=1 actions=.*,set_field:${macAdd}->eth_src
+    \    Should Match Regexp    ${arpResponder_table}    ${ARP_RESPONSE_IP_MAC_REGEX}
+
+Verify IPv6 GWMAC Flow Entry On Flow Table
+    [Arguments]    ${flow_output}
+    Should Contain    ${flow_output}    table=${IPV6_TABLE}
+    ${icmp_ipv6_flows} =    Get Lines Containing String    ${flow_output}    icmp_type=135
+    : FOR    ${ip_addr}    IN    @{GWIP_ADDRS}
+    \    ${rule} =    Set Variable    icmp_type=135,icmp_code=0,nd_target=${ip_addr} actions=CONTROLLER:65535
+    \    Should Match Regexp    ${icmp_ipv6_flows}    ${rule}
+
+Verify GWMAC Flow Entry On Flow Table
+    [Arguments]    ${cnIp}    ${ipv}=ipv4
+    [Documentation]    Verify the GWMAC Table, ARP Response table and Dispatcher table.
+    ${flow_output}=    Run Command On Remote System    ${cnIp}    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+    ${group_output}=    Run Command On Remote System    ${cnIp}    sudo ovs-ofctl -O OpenFlow13 dump-groups br-int
+    Should Contain    ${flow_output}    table=${DISPATCHER_TABLE}
+    ${dispatcher_table} =    Get Lines Containing String    ${flow_output}    table=${DISPATCHER_TABLE}
+    Should Contain    ${dispatcher_table}    goto_table:${GWMAC_TABLE}
+    Should Not Contain    ${dispatcher_table}    goto_table:${ARP_RESPONSE_TABLE}
+    Should Contain    ${flow_output}    table=${GWMAC_TABLE}
+    ${gwmac_table} =    Get Lines Containing String    ${flow_output}    table=${GWMAC_TABLE}
+    #Verify GWMAC address present in table 19
+    : FOR    ${macAdd}    IN    @{GWMAC_ADDRS}
+    \    Should Contain    ${gwmac_table}    dl_dst=${macAdd} actions=goto_table:${L3_TABLE}
+    #verify Miss entry
+    Should Contain    ${gwmac_table}    actions=resubmit(,17)
+    #Verify ARP_CHECK_TABLE - 43
+    #arp request and response
+    ${arpchk_table} =    Get Lines Containing String    ${flow_output}    table=${ARP_CHECK_TABLE}
+    Should Match Regexp    ${arpchk_table}    ${ARP_RESPONSE_REGEX}
+    ${match} =    Should Match Regexp    ${arpchk_table}    ${ARP_REQUEST_REGEX}
+    ${groupID} =    Split String    ${match}    separator=:
+    BuiltIn.Run Keyword If    '${ipv}' == 'ipv4'    Verify IPv4 GWMAC Flow Entry On Flow Table    ${group_output}    ${group_id}    ${flow_output}
+    ...    ELSE    Verify IPv6 GWMAC Flow Entry On Flow Table    ${flow_output}
+
+Delete Multiple L3VPNs
+    [Arguments]    @{vpns}
+    [Documentation]    Delete three L3VPNs created using Multiple L3VPN Test
+    : FOR    ${vpn}    IN    ${vpns}
+    \    VPN Delete L3VPN    vpnid=${vpn}