+ Genius.Delete All Vteps
+ Genius.Genius Suite Debugs ${data_models}
+ Genius.Genius Suite Teardown
+
+Verify Tunnel Monitoring Status
+ [Arguments] ${tunnel_monitor_status}
+ ${output}= KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW}
+ BuiltIn.Should Contain ${output} ${tunnel_monitor_status}
+
+Set Switch Configuration
+ [Documentation] This keyword will set manager,controller,tap port,bridge on each OVS
+ FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM}
+ SSHLibrary.Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}]
+ SSHLibrary.Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
+ SSHLibrary.Execute Command sudo ovs-vsctl add-br ${Bridge}
+ SSHLibrary.Execute Command sudo ovs-vsctl set bridge ${Bridge} protocols=OpenFlow13
+ SSHLibrary.Execute Command sudo ovs-vsctl set-controller ${Bridge} tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT_6653}
+ SSHLibrary.Execute Command sudo ifconfig ${Bridge} up
+ SSHLibrary.Execute Command sudo ovs-vsctl add-port ${Bridge} tap${tool_system_index}ed70586-6c -- set Interface tap${tool_system_index}ed70586-6c type=tap
+ SSHLibrary.Execute Command sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+ SSHLibrary.Execute Command sudo ovs-vsctl show
+ END
+
+Ovs Verification For Each Dpn
+ [Arguments] ${tools_system_ip} ${tools_ips}
+ [Documentation] This keyword will verify whether local and remote ip are present on the tunnels available on OVS
+ ${ovs_output} = Utils.Run Command On Remote System And Log ${tools_system_ip} sudo ovs-vsctl show
+ @{updated_tools_ip_list} = BuiltIn.Create List @{tools_ips}
+ Collections.Remove Values From List ${updated_tools_ip_list} ${tools_system_ip}
+ BuiltIn.Log Many @{updated_tools_ip_list}
+ ${num_tool_ips} BuiltIn.Get Length ${updated_tools_ip_list}
+ FOR ${num} IN RANGE ${num_tool_ips}
+ ${tools_ip} = Collections.Get From List ${updated_tools_ip_list} ${num}
+ BuiltIn.Should Contain ${ovs_output} ${tools_ip}
+ END
+
+Get Tunnels List
+ [Documentation] The keyword fetches the list of operational tunnels from ODL
+ ${no_of_tunnels} KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE}
+ ${tunnels} = String.Get Regexp Matches ${no_of_tunnels} tun[\\w\\d]+
+ BuiltIn.Log ${tunnels}
+ [Return] ${tunnels}
+
+Verify Table0 Entry After fetching Port Number
+ [Documentation] This keyword will get the port number and checks the table0 entry for each dpn
+ FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS}
+ ${check} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl -O OpenFlow13 show ${Bridge}
+ ${port_numbers} = String.Get Regexp Matches ${check} (\\d+).tun.* 1
+ Genius.Check Table0 Entry In a Dpn ${tools_ip} ${Bridge} ${port_numbers}
+ END
+
+Verify Deleted Tunnels On OVS
+ [Arguments] ${tunnel_list} ${resp_data}
+ [Documentation] This will verify whether tunnel is deleted.
+ BuiltIn.Log ${resp_data}
+ FOR ${tunnel} IN @{tunnel_list}
+ BuiltIn.Should Not Contain ${resp_data} ${tunnel}
+ END
+
+Verify Response Code Of Dpn End Point Config API
+ [Arguments] ${dpn_list}=${DPN_ID_LIST}
+ [Documentation] This keyword will verify response code from itm-state: dpn endpoints config api for each dpn
+ FOR ${dpn} IN @{dpn_list}
+ BuiltIn.Wait Until Keyword Succeeds 40 5 Utils.Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/
+ END
+
+Get Tunnel Between DPNs
+ [Arguments] ${tunnel_type} ${config_api_type} ${src_dpn_id} @{dst_dpn_ids}
+ [Documentation] This keyword will Get All the Tunnels available on DPN's
+ FOR ${dst_dpn_id} IN @{dst_dpn_ids}
+ ${tunnel} = BuiltIn.Wait Until Keyword Succeeds 30 10 Genius.Get Tunnel ${src_dpn_id}
+ ... ${dst_dpn_id} ${tunnel_type} ${config_api_type}
+ END
+
+Update Dpn id List And Get Tunnels
+ [Arguments] ${tunnel_type} ${config_api_type}=${EMPTY} ${dpn_ids}=${DPN_ID_LIST}
+ [Documentation] Update the exisisting dpn id list to form different combination of dpn ids such that tunnel formation between all dpns is verified.
+ FOR ${dpn_id} IN @{dpn_ids}
+ @{dpn_ids_updated} = BuiltIn.Create List @{dpn_ids}
+ Collections.Remove Values From List ${dpn_ids_updated} ${dpn_id}
+ BuiltIn.Log Many ${dpn_ids_updated}
+ Genius.Get Tunnel Between DPNs ${tunnel_type} ${config_api_type} ${dpn_id} @{dpn_ids_updated}
+ END