Documentation Library to deal with mdsal data models. Initially, as a common place to show and
... debug a list of data models.
Library RequestsLibrary
+Resource ../variables/netvirt/Variables.robot
*** Variables ***
@{internal_data_models} ${EMPTY}
Verify No Ingress Dispatcher Non-Default Flow Entries
[Arguments] ${ovs_ip}
[Documentation] Verify the ingress dispatcher table has no non-default flows after neutron was cleaned up
- ${flow_output}= Run Command On Remote System ${ovs_ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int table=${DISPATCHER_TABLE} | grep -v "priority=0"
+ ${flow_output}= Run Command On Remote System ${ovs_ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE} table=${DISPATCHER_TABLE} | grep -v "priority=0"
Log ${flow_output}
#Should Not Contain ${flow_output} table=${DISPATCHER_TABLE} # Skipping test verification until bug 7451 is resolved
[Documentation] Keyword to set OVS manager and controller to ${ODL_IP} for the OVS IP connected in ${conn_id} and verify the entries in OVSDB NETWORK TOPOLOGY and NETSTAT results.
${output}= Exec Command ${conn_id} ${OVS_RESTART}
${output}= Exec Command ${conn_id} ${OVS_DEL_MGR}
- ${output}= Exec Command ${conn_id} ${OVS_DEL_CTRLR} ${OVS_BRIDGE}
- ${output}= Exec Command ${conn_id} ${DEL_OVS_BRIDGE} ${OVS_BRIDGE}
+ ${output}= Exec Command ${conn_id} ${OVS_DEL_CTRLR} ${INTEGRATION_BRIDGE}
+ ${output}= Exec Command ${conn_id} ${DEL_OVS_BRIDGE} ${INTEGRATION_BRIDGE}
${output}= Exec Command ${conn_id} ${OVS_SHOW}
Should Not Contain ${output} Manager
Should Not Contain ${output} Controller
- ${output}= Exec Command ${conn_id} ${CREATE_OVS_BRIDGE} ${OVS_BRIDGE}
- ${output}= Exec Command ${conn_id} ${SET_FAIL_MODE} ${OVS_BRIDGE} secure
+ ${output}= Exec Command ${conn_id} ${CREATE_OVS_BRIDGE} ${INTEGRATION_BRIDGE}
+ ${output}= Exec Command ${conn_id} ${SET_FAIL_MODE} ${INTEGRATION_BRIDGE} secure
${output}= Exec Command ${conn_id} ${OVS_SET_MGR}:${ODL_IP}:${OVSDBPORT}
- ${output}= Exec Command ${conn_id} ${OVS_SET_CTRLR} ${OVS_BRIDGE} tcp:${ODL_IP}:${ODL_OF_PORT}
+ ${output}= Exec Command ${conn_id} ${OVS_SET_CTRLR} ${INTEGRATION_BRIDGE} tcp:${ODL_IP}:${ODL_OF_PORT}
Wait Until Keyword Succeeds 60s 2s Verify Strings In Command Output ${conn_id} ${OVS_SHOW} Manager "tcp:${ODL_IP}:${OVSDBPORT}"
... Controller "tcp:${ODL_IP}:${ODL_OF_PORT}"
${output}= Exec Command ${conn_id} ${NETSTAT}
Wait Until Keyword Succeeds 30s 2s Validate Regexp In String ${output} ${NETSTAT_OVSDB_REGEX}
Wait Until Keyword Succeeds 30s 2s Validate Regexp In String ${output} ${NETSTAT_OF_REGEX}
- @{list_to_check}= Create List bridge/${OVS_BRIDGE} bridge/${hwvtep_bridge}
+ @{list_to_check}= Create List bridge/${INTEGRATION_BRIDGE} bridge/${hwvtep_bridge}
Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${OVSDB_NETWORK_TOPOLOGY} ${list_to_check} session
Create Itm Tunnel Between Hwvtep and Ovs
Log ${conn_id}
Flexible SSH Login ${DEFAULT_USER} ${DEFAULT_PASSWORD}
Start Command ${command}
- ${output}= Exec Command ${conn_id} sudo ovs-ofctl dump-flows br-int -O Openflow13
+ ${output}= Exec Command ${conn_id} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -O Openflow13
Log ${output}
close connection
Verify Elan Flow Entries
[Arguments] ${ip} ${srcMacAddrs} ${destMacAddrs}
[Documentation] Verify Flows Are Present For ELAN service
- ${flow_output} = Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+ ${flow_output} = Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
Log ${flow_output}
Should Contain ${flow_output} table=50
${sMac_output} = Get Lines Containing String ${flow_output} table=50
Resource Utils.robot
Resource ${CURDIR}/TemplatedRequests.robot
Resource ../variables/Variables.robot
+Resource ../variables/netvirt/Variables.robot
*** Variables ***
${OVSDB_CONFIG_DIR} ${CURDIR}/../variables/ovsdb
[Return] ${uuid}
Collect OVSDB Debugs
- [Arguments] ${switch}=br-int
+ [Arguments] ${switch}=${INTEGRATION_BRIDGE}
[Documentation] Used to log useful test debugs for OVSDB related system tests.
${output} = Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl show
BuiltIn.Log ${output}
Get DPID
[Arguments] ${ip}
[Documentation] Returns the dpnid from the system at the given ip address using ovs-ofctl assuming br-int is present.
- ${output} = Utils.Run Command On Remote System ${ip} sudo ovs-ofctl show -O Openflow13 br-int | head -1 | awk -F "dpid:" '{print $2}'
+ ${output} = Utils.Run Command On Remote System ${ip} sudo ovs-ofctl show -O Openflow13 ${INTEGRATION_BRIDGE} | head -1 | awk -F "dpid:" '{print $2}'
${dpnid} = BuiltIn.Convert To Integer ${output} 16
BuiltIn.Log ${dpnid}
[Return] ${dpnid}
Get Port Number
[Arguments] ${subportid} ${ip_addr}
[Documentation] Get the port number for the given sub-port id
- ${command} = Set Variable sudo ovs-ofctl -O OpenFlow13 show br-int | grep ${subportid} | awk '{print$1}'
- BuiltIn.Log sudo ovs-ofctl -O OpenFlow13 show br-int | grep ${subportid} | awk '{print$1}'
+ ${command} = Set Variable sudo ovs-ofctl -O OpenFlow13 show ${INTEGRATION_BRIDGE} | grep ${subportid} | awk '{print$1}'
+ BuiltIn.Log sudo ovs-ofctl -O OpenFlow13 show ${INTEGRATION_BRIDGE} | grep ${subportid} | awk '{print$1}'
${output} = Utils.Run Command On Remote System ${ip_addr} ${command}
${port_number} = BuiltIn.Should Match Regexp ${output} [0-9]+
[Return] ${port_number}
Get Port Metadata
[Arguments] ${ip_addr} ${port}
[Documentation] Get the Metadata for a given port
- ${cmd} = Set Variable sudo ovs-ofctl dump-flows -O Openflow13 br-int| grep table=0 | grep in_port=${port}
+ ${cmd} = Set Variable sudo ovs-ofctl dump-flows -O Openflow13 ${INTEGRATION_BRIDGE} | grep table=0 | grep in_port=${port}
${output} = Utils.Run Command On Remote System ${ip_addr} ${cmd}
@{list_any_matches} = String.Get_Regexp_Matches ${output} metadata:(\\w{12}) 1
${metadata} = Builtin.Convert To String @{list_any_matches}
\ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT}
Utils.Write Commands Until Expected Prompt sudo ovs-vsctl show ${DEFAULT_LINUX_PROMPT_STRICT}
Utils.Write Commands Until Expected Prompt sudo ovs-vsctl list Open_vSwitch ${DEFAULT_LINUX_PROMPT_STRICT}
- Utils.Write Commands Until Expected Prompt sudo ovs-ofctl show br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
- Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
- Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-groups br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
- Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
+ Utils.Write Commands Until Expected Prompt sudo ovs-ofctl show ${INTEGRATION_BRIDGE} -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
+ Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
+ Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-groups ${INTEGRATION_BRIDGE} -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
+ Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-group-stats ${INTEGRATION_BRIDGE} -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
Get ControlNode Connection
SSHLibrary.Switch Connection ${OS_CNTL_CONN_ID}
*** Settings ***
Library SSHLibrary
+Resource ../../variables/netvirt/Variables.robot
*** Variables ***
Get Flows In Docker Containers
${docker_list}= DockerSfc.Get Docker Names As List
- ${docker_flows} DockerSfc.Multiple Docker Exec ${docker_list} ovs-ofctl dump-flows -OOpenflow13 br-int OFPST_FLOW
+ ${docker_flows} DockerSfc.Multiple Docker Exec ${docker_list} ovs-ofctl dump-flows -OOpenflow13 ${INTEGRATION_BRIDGE} OFPST_FLOW
[Return] ${docker_flows}
Get Docker Bridge Subnet
Resource TemplatedRequests.robot
Resource KarafKeywords.robot
Resource ../variables/Variables.robot
+Resource ../variables/netvirt/Variables.robot
Library Collections
Library String
Library OperatingSystem
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
+ ${flow_output}= Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
Should Contain ${flow_output} table=${ODL_FLOWTABLE_L3VPN}
${l3vpn_table} = Get Lines Containing String ${flow_output} table=${ODL_FLOWTABLE_L3VPN},
Log ${l3vpn_table}
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
+ ${flow_output}= Run Command On Remote System And Log ${cnIp} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
Should Contain ${flow_output} table=${GWMAC_TABLE}
${gwmac_table} = Get Lines Containing String ${flow_output} table=${GWMAC_TABLE}
Log ${gwmac_table}
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
+ ${flow_output}= Run Command On Remote System ${cnIp} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
+ ${group_output}= Run Command On Remote System ${cnIp} sudo ovs-ofctl -O OpenFlow13 dump-groups ${INTEGRATION_BRIDGE}
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}
Verify Flows Are Present For ELAN Service
[Arguments] ${ip} ${smacs} ${dmacs}
- ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+ ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
Builtin.Log ${smac_output}
Verify Flows Are Removed For ELAN Service
[Arguments] ${ip} ${smacs}
- ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+ ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
Builtin.Log ${smac_output}
${SECURITY_GROUP} l2l3_gw_mac_arp_sg
${TABLE_NO_0} table=0
${TABLE_NO_220} table=220
-${DUMP_FLOWS} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
-${GROUP_FLOWS} sudo ovs-ofctl -O OpenFlow13 dump-groups br-int
+${DUMP_FLOWS} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
+${GROUP_FLOWS} sudo ovs-ofctl -O OpenFlow13 dump-groups ${INTEGRATION_BRIDGE}
${ARP_REQUEST_OPERATIONAL_CODE} 1
${ARP_RESPONSE_OPERATIONAL_CODE} 2
Verify Flows Are Present
[Arguments] ${ip}
[Documentation] Verify Flows Are Present
- ${flow_output}= Utils.Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+ ${flow_output}= Utils.Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
BuiltIn.Log ${flow_output}
${resp} = BuiltIn.Should Contain ${flow_output} table=50
${resp} = BuiltIn.Should Contain ${flow_output} table=21,
Verify GWMAC Flow Entry On Flow Table
[Arguments] ${cnIp}
[Documentation] Verify 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
+ ${flow_output} = Run Command On Remote System ${cnIp} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
+ ${group_output} = Run Command On Remote System ${cnIp} sudo ovs-ofctl -O OpenFlow13 dump-groups ${INTEGRATION_BRIDGE}
BuiltIn.Should Contain ${flow_output} table=${DISPATCHER_TABLE}
${dispatcher_table} = Get Lines Containing String ${flow_output} table=${DISPATCHER_TABLE}
BuiltIn.Should Contain ${dispatcher_table} goto_table:${GWMAC_TABLE}
Resource ../../../libraries/KarafKeywords.robot
Resource ../../../libraries/FlowLib.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/netvirt/Variables.robot
Resource ../../../libraries/DataModels.robot
*** Variables ***
Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo service openvswitch-switch restart
Wait Until Keyword Succeeds 30s 1s FlowLib.Check Operational Flow ${True} ${data}
Log Check if static flow is removed in the switch
- ${Ovs1Flow} Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-ofctl dump-flows br-int -OOpenflow13
+ ${Ovs1Flow} Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenflow13
Should Not Contain ${Ovs1Flow} ${STATIC_FLOW}
Log Check if flows are pushed as bundle messages
${Resyncdone_msg}= BuiltIn.Set Variable "Completing bundle based reconciliation for device ID:${switch_idx}"
Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo service openvswitch-switch restart
Wait Until Keyword Succeeds 30s 1s FlowLib.Check Operational Flow ${True} ${data}
Log Check if static flow is removed in the switch
- ${Ovs1Flow} Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo ovs-ofctl dump-flows br-int -OOpenflow13
+ ${Ovs1Flow} Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenflow13
Should Not Contain ${Ovs1Flow} ${STATIC_FLOW}
Log Check if flows are pushed as bundle messages
${Resyncdone_msg}= BuiltIn.Set Variable "Completing bundle based reconciliation for device ID:${switch_idx}"
Configure DPN
[Arguments] ${ip}
[Documentation] Add the bridge in the DPN specified and set manager,controller for the bridge
- Utils.Run Command On Remote System ${ip} sudo ovs-vsctl add-br br-int
+ Utils.Run Command On Remote System ${ip} sudo ovs-vsctl add-br ${INTEGRATION_BRIDGE}
Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
- Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-controller br-int tcp:${ODL_SYSTEM_IP}:6653
- Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set bridge br-int protocols=OpenFlow13
+ Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-controller ${INTEGRATION_BRIDGE} tcp:${ODL_SYSTEM_IP}:6653
+ Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set bridge ${INTEGRATION_BRIDGE} protocols=OpenFlow13
DataModels.Get Model Dump ${ODL_SYSTEM_IP} ${DATA_MODELS}
Push Static Flow
[Arguments] ${ip}
[Documentation] Add Static Flow in the DPN specified
- Utils.Run Command On Remote System ${ip} sudo ovs-ofctl dump-flows br-int -OOpenflow13
- Utils.Run Command On Remote System ${ip} sudo ovs-ofctl add-flow br-int table=91,ipv6,actions=dec_ttl -OOpenflow13
+ Utils.Run Command On Remote System ${ip} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenflow13
+ Utils.Run Command On Remote System ${ip} sudo ovs-ofctl add-flow ${INTEGRATION_BRIDGE} table=91,ipv6,actions=dec_ttl -OOpenflow13
Push Flow Via Restcall
[Arguments] ${switch_idx} ${flowfile}
+*** Settings ***
+Resource ../../variables/netvirt/Variables.robot
+
*** Variables ***
#Configurable Variables
${OS_IP} ${OS_CONTROL_NODE_IP}
${NS2_TAP1} TAP4
${NS3_TAP1} TAP5
${NS4_TAP1} TAP6
-${OVS_BRIDGE} br-int
${OVS_PORT_1} OVSPORT1
${OVS_PORT_2} OVSPORT2
${OVS2_PORT_1} OVSPORT3
${CREATE_OVSDB} sudo ovsdb-tool create /etc/openvswitch/ovs.db ${OVS_HOME}/vswitch.ovsschema
${DEL_OVS_BRIDGE} sudo ovs-vsctl del-br
${DETACH_VSWITCHD} sudo ovs-vswitchd --pidfile --detach
-${GET_DPNID} printf "%d\\n" 0x`sudo ovs-ofctl show -O Openflow13 br-int | head -1 | awk -F "dpid:" '{print $2}'`
+${GET_DPNID} printf "%d\\n" 0x`sudo ovs-ofctl show -O Openflow13 ${INTEGRATION_BRIDGE} | head -1 | awk -F "dpid:" '{print $2}'`
${GET_PORT_URL} neutron:neutron/ports/port
${GREP_OVS} ps -ef | grep ovs
${GREP_OVSDB_DUMP_MANAGER_TABLE} sudo ovsdb-client dump hardware_vtep -f csv | grep -A2 "Manager table"
${PRE_CLEAN_OPENSTACK_ALL} False
${EXTERNAL_NET_NAME} external-net
${EXTERNAL_SUBNET_NAME} external-subnet
+${INTEGRATION_BRIDGE} br-int
${EXTERNAL_GATEWAY} 10.10.10.250
${EXTERNAL_SUBNET} 10.10.10.0/24
${EXTERNAL_SUBNET_ALLOCATION_POOL} start=10.10.10.2,end=10.10.10.249