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]}
- # Delete Vm instances from the given Instance List
${VM_INSTANCES} = Create List @{VM_INSTANCES_NET10} @{VM_INSTANCES_NET20}
: FOR ${VmInstance} IN @{VM_INSTANCES}
\ Run Keyword And Ignore Error Delete Vm Instance ${VmInstance}
- # Delete Neutron Ports from the given Port List.
: FOR ${Port} IN @{PORT_LIST}
\ Run Keyword And Ignore Error Delete Port ${Port}
- # Delete Sub Nets from the given Subnet List.
: FOR ${Subnet} IN @{SUBNETS}
\ Run Keyword And Ignore Error Delete SubNet ${Subnet}
- # Delete Networks in the given Net List
: FOR ${Network} IN @{NETWORKS}
\ Run Keyword And Ignore Error Delete Network ${Network}
- # Remove security group created earlier
Run Keyword And Ignore Error Delete SecurityGroup ${SECURITY_GROUP}
Close All Connections
Verify Flows Are Present For L3VPN
[Arguments] ${ip} ${vm_ips}
[Documentation] Verify Flows Are Present For L3VPN
- ${flow_output}= Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
- Log ${flow_output}
+ ${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}
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 ${cnIp} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
- Log ${flow_output}
+ ${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}
${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}
@{PORT_LIST} PORT11 PORT21 PORT12 PORT22
@{VM_INSTANCES_NET10} VM11 VM21
@{VM_INSTANCES_NET20} VM12 VM22
-@{ROUTERS} ROUTER_1 ROUTER_2
+@{ROUTERS} ROUTER_1
@{EXTRA_NW_IP} 40.1.1.2 50.1.1.2
@{EXTRA_NW_SUBNET} 40.1.1.0/24 50.1.1.0/24
${SECURITY_GROUP} sg-vpnservice
*** Test Cases ***
Create Neutron Networks
[Documentation] Create two networks
+ # TODO: Many of these steps to verify if updates occurred should be in a different suite
+ # that is checking for such operations.
Create Network ${NETWORKS[0]}
Create Network ${NETWORKS[1]}
- ${NET_LIST} List Networks
- Should Contain ${NET_LIST} ${NETWORKS[0]}
- Should Contain ${NET_LIST} ${NETWORKS[1]}
Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${NETWORK_URL} ${NETWORKS}
Update Network ${NETWORKS[0]} additional_args=--description ${UPDATE_NETWORK}
${output} = Show Network ${NETWORKS[0]}
[Documentation] Create two subnets for previously created networks
Create SubNet ${NETWORKS[0]} ${SUBNETS[0]} ${SUBNETS_CIDR[0]}
Create SubNet ${NETWORKS[1]} ${SUBNETS[1]} ${SUBNETS_CIDR[1]}
- ${SUB_LIST} List Subnets
- Should Contain ${SUB_LIST} ${SUBNETS[0]}
- Should Contain ${SUB_LIST} ${SUBNETS[1]}
Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS}
Update SubNet ${SUBNETS[0]} additional_args=--description ${UPDATE_SUBNET}
${output} = Show SubNet ${SUBNETS[0]}
Set Suite Variable ${PORTS_MACADDR}
Update Port ${PORT_LIST[0]} additional_args=--description ${UPDATE_PORT}
${output} = Show Port ${PORT_LIST[0]}
+ Should Contain ${output} ${UPDATE_PORT}
Create Nova VMs
[Documentation] Create Vm instances on compute node with port
${VM_IP_NET20} ${DHCP_IP2} Collect VM IP Addresses false @{VM_INSTANCES_NET20}
${VM_INSTANCES}= Collections.Combine Lists ${VM_INSTANCES_NET10} ${VM_INSTANCES_NET20}
${VM_IPS}= Collections.Combine Lists ${VM_IP_NET10} ${VM_IP_NET20}
- Log Many Obtained IPs ${VM_IPS}
${LOOP_COUNT} Get Length ${VM_INSTANCES_NET10}
: FOR ${index} IN RANGE 0 ${LOOP_COUNT}
\ ${status} ${message} Run Keyword And Ignore Error Should Not Contain @{VM_IPS}[${index}] None
\ Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt openstack console log show @{VM_INSTANCES}[${index}] 30s
- Log ${VM_IP_NET10}
Set Suite Variable ${VM_IP_NET10}
- Log ${VM_IP_NET20}
Set Suite Variable ${VM_IP_NET20}
Should Not Contain ${VM_IP_NET10} None
Should Not Contain ${VM_IP_NET20} None
Create Routers
[Documentation] Create Router
Create Router ${ROUTERS[0]}
- ${router_output} = List Router
- Should Contain ${router_output} ${ROUTERS[0]}
- ${router_list} = Create List ${ROUTERS[0]}
- Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${ROUTER_URL} ${router_list}
+ Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${ROUTER_URL} ${ROUTERS}
Add Interfaces To Router
[Documentation] Add Interfaces
: FOR ${INTERFACE} IN @{SUBNETS}
\ Add Router Interface ${ROUTERS[0]} ${INTERFACE}
${interface_output} = Show Router Interface ${ROUTERS[0]}
- ${GWMAC_ADDRS} ${GWIP_ADDRS} = Get Gateway MAC And IP Address ${ROUTERS[0]}
- Log ${GWMAC_ADDRS}
+ ${GWMAC_ADDRS} ${GWIP_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTERS[0]}
Set Suite Variable ${GWMAC_ADDRS}
- Log ${GWIP_ADDRS}
Set Suite Variable ${GWIP_ADDRS}
Check L3_Datapath Traffic Across Networks With Router
Wait Until Keyword Succeeds 30s 5s Check For Elements At URI ${FIB_ENTRY_URL} ${vm_instances}
Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For L3VPN ${OS_COMPUTE_1_IP} ${vm_instances}
Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For L3VPN ${OS_COMPUTE_2_IP} ${vm_instances}
- #Verify GWMAC Table
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Entry On ODL ${GWMAC_ADDRS}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_1_IP}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_2_IP}
- Log L3 Datapath test across the networks using router
${dst_ip_list} = Create List ${VM_IP_NET10[1]} @{VM_IP_NET20}
Test Operations From Vm Instance ${NETWORKS[0]} ${VM_IP_NET10[0]} ${dst_ip_list}
${dst_ip_list} = Create List ${VM_IP_NET20[1]} @{VM_IP_NET10}
Test Operations From Vm Instance ${NETWORKS[1]} ${VM_IP_NET20[0]} ${dst_ip_list}
- [Teardown] Test Teardown With Tcpdump Stop ${cn1_conn_id} ${cn2_conn_id} ${os_conn_id}
+ [Teardown] VpnOperations.Test Teardown With Tcpdump Stop ${cn1_conn_id} ${cn2_conn_id} ${os_conn_id}
Add Multiple Extra Routes And Check Datapath Before L3VPN Creation
[Documentation] Add multiple extra routes and check data path before L3VPN creation
- Log "Adding extra one route to VM"
${CONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ifconfig eth0:1 @{EXTRA_NW_IP}[0] netmask 255.255.255.0 up
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[0]} ${CONFIG_EXTRA_ROUTE_IP1}
${CONFIG_EXTRA_ROUTE_IP2} = Catenate sudo ifconfig eth0:2 @{EXTRA_NW_IP}[1] netmask 255.255.255.0 up
${cmd} = Catenate ${RT_OPTIONS} ${EXT_RT1} ${RT_OPTIONS} ${EXT_RT2}
Update Router @{ROUTERS}[0] ${cmd}
Show Router @{ROUTERS}[0] -D
- Log "Verify FIB table"
${vm_instances} = Create List @{EXTRA_NW_SUBNET}
Wait Until Keyword Succeeds 30s 5s Check For Elements At URI ${FIB_ENTRY_URL} ${vm_instances}
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[1]} ping -c 3 @{EXTRA_NW_IP}[1]
Delete And Recreate Extra Route
[Documentation] Recreate multiple extra route and check data path before L3VPN creation
- Log "Adding extra route to VM"
${CONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ifconfig eth0:1 @{EXTRA_NW_IP}[0] netmask 255.255.255.0 up
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[0]} ${CONFIG_EXTRA_ROUTE_IP1}
${EXT_RT1} = Set Variable destination=40.1.1.0/24,gateway=${VM_IP_NET10[0]}
Verify L3VPN Datapath With Router Association
[Documentation] Datapath test across the networks using L3VPN with router association.
- Log Verify VPN interfaces, FIB entries and Flow table
${vm_instances} = Create List @{VM_IP_NET10} @{VM_IP_NET20}
Wait Until Keyword Succeeds 30s 5s Check For Elements At URI ${VPN_IFACES_URL} ${vm_instances}
${RD} = Strip String ${RDS[0]} characters="[]
Wait Until Keyword Succeeds 60s 5s Check For Elements At URI ${CONFIG_API}/odl-fib:fibEntries/vrfTables/${RD}/ ${vm_instances}
Wait Until Keyword Succeeds 60s 5s Verify Flows Are Present For L3VPN ${OS_COMPUTE_1_IP} ${vm_instances}
Wait Until Keyword Succeeds 60s 5s Verify Flows Are Present For L3VPN ${OS_COMPUTE_2_IP} ${vm_instances}
- #Verify GWMAC Table
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Entry On ODL ${GWMAC_ADDRS}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_1_IP}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_2_IP}
Delete Router And Router Interfaces With L3VPN
[Documentation] Delete Router and Interface to the subnets with L3VPN assciate
- # Asscoiate router with L3VPN
${router_id}= Get Router Id ${ROUTERS[0]} ${devstack_conn_id}
Associate VPN to Router routerid=${router_id} vpnid=${VPN_INSTANCE_ID[0]}
${resp}= VPN Get L3VPN vpnid=${VPN_INSTANCE_ID[0]}
Should Contain ${resp} ${router_id}
- #Delete Interface
: FOR ${INTERFACE} IN @{SUBNETS}
\ Remove Interface ${ROUTERS[0]} ${INTERFACE}
${interface_output} = Show Router Interface ${ROUTERS[0]}
: FOR ${INTERFACE} IN @{SUBNETS}
\ ${subnet_id} = Get Subnet Id ${INTERFACE} ${devstack_conn_id}
\ Should Not Contain ${interface_output} ${subnet_id}
- # Delete Router and Interface to the subnets.
Delete Router ${ROUTERS[0]}
${router_output} = List Router
Should Not Contain ${router_output} ${ROUTERS[0]}
${router_list} = Create List ${ROUTERS[0]}
Wait Until Keyword Succeeds 3s 1s Check For Elements Not At URI ${ROUTER_URL} ${router_list}
- # Verify Router Entry removed from L3VPN
${resp}= VPN Get L3VPN vpnid=${VPN_INSTANCE_ID[0]}
Should Not Contain ${resp} ${router_id}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry Removed From Flow Table ${OS_COMPUTE_1_IP}
VPN Delete L3VPN vpnid=${VPN_INSTANCE_ID[0]}
VPN Delete L3VPN vpnid=${VPN_INSTANCE_ID[1]}
VPN Delete L3VPN vpnid=${VPN_INSTANCE_ID[2]}
-
-*** Keywords ***
-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
-
-Get Gateway MAC And IP Address
- [Arguments] ${router_Name}
- [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}
-
-Verify GWMAC Flow Entry On Flow Table
- [Arguments] ${cnIp}
- [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
- #Verify DISPATCHER_TABLE - 17
- 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}
- #Verify GWMAC_TABLE - 19
- 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=:
- 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}
[Documentation] Create two networks
Create Network ${NETWORKS[0]}
Create Network ${NETWORKS[1]}
- ${NET_LIST} List Networks
- Should Contain ${NET_LIST} ${NETWORKS[0]}
- Should Contain ${NET_LIST} ${NETWORKS[1]}
Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${NETWORK_URL} ${NETWORKS}
Update Network ${NETWORKS[0]} additional_args=--description ${UPDATE_NETWORK}
${output} = Show Network ${NETWORKS[0]}
${net2_additional_args}= Catenate --ip-version=6 --ipv6-address-mode=slaac --ipv6-ra-mode=slaac ${NET2_IPV6_ADDR_POOL}
Create SubNet ${NETWORKS[0]} ${SUBNETS[0]} ${SUBNETS_CIDR[0]} ${net1_additional_args}
Create SubNet ${NETWORKS[1]} ${SUBNETS[1]} ${SUBNETS_CIDR[1]} ${net2_additional_args}
- ${SUB_LIST} List Subnets
- Should Contain ${SUB_LIST} ${SUBNETS[0]}
- Should Contain ${SUB_LIST} ${SUBNETS[1]}
Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS}
Update SubNet ${SUBNETS[0]} additional_args=--description ${UPDATE_SUBNET}
${output} = Show SubNet ${SUBNETS[0]}
Create Routers
[Documentation] Create Router
Create Router ${ROUTERS[0]}
- ${router_output} = List Router
- Should Contain ${router_output} ${ROUTERS[0]}
- ${router_list} = Create List ${ROUTERS[0]}
- Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${ROUTER_URL} ${router_list}
+ Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${ROUTER_URL} ${ROUTERS}
Add Interfaces To Router
[Documentation] Add Interfaces
: FOR ${INTERFACE} IN @{SUBNETS}
\ ${subnet_id} = Get Subnet Id ${INTERFACE} ${devstack_conn_id}
\ Should Contain ${interface_output} ${subnet_id}
- ${GWMAC_ADDRS} ${GWIP_ADDRS} = Get Gateway MAC And IP Address ${ROUTERS[0]}
+ ${GWMAC_ADDRS} ${GWIP_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTERS[0]} ${IP6_REGEX}
Set Suite Variable ${GWMAC_ADDRS}
Set Suite Variable ${GWIP_ADDRS}
${VM_IP_NET20}= Collect VM IPv6 SLAAC Addresses false ${prefix_net20} @{VM_INSTANCES_NET20}
${VM_INSTANCES}= Collections.Combine Lists ${VM_INSTANCES_NET10} ${VM_INSTANCES_NET20}
${VM_IPS}= Collections.Combine Lists ${VM_IP_NET10} ${VM_IP_NET20}
- Log Many Obtained IPs ${VM_IPS}
${LOOP_COUNT} Get Length ${VM_INSTANCES_NET10}
: FOR ${index} IN RANGE 0 ${LOOP_COUNT}
\ ${status} ${message} Run Keyword And Ignore Error Should Not Contain @{VM_IPS}[${index}] None
\ Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt openstack console log show @{VM_INSTANCES}[${index}] 30s
- Log ${VM_IP_NET10}
Set Suite Variable ${VM_IP_NET10}
- Log ${VM_IP_NET20}
Set Suite Variable ${VM_IP_NET20}
Should Not Contain ${VM_IP_NET10} None
Should Not Contain ${VM_IP_NET20} None
Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For L3VPN ${OS_COMPUTE_1_IP} ${VM_IP_NET10}
Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For L3VPN ${OS_COMPUTE_1_IP} ${VM_IP_NET20}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Entry On ODL ${GWMAC_ADDRS}
- Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_1_IP}
- Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_2_IP}
- Log L3 Datapath test across the networks using router
+ Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_1_IP} ipv6
+ Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry On Flow Table ${OS_COMPUTE_2_IP} ipv6
${dst_ip_list} = Create List ${VM_IP_NET10[1]} @{VM_IP_NET20}
- Log Many Source IP ${VM_IP_NET10[1]}
Test Operations From Vm Instance ${NETWORKS[0]} ${VM_IP_NET10[0]} ${dst_ip_list}
${dst_ip_list} = Create List ${VM_IP_NET20[1]} @{VM_IP_NET10}
- Log Many Source IP ${VM_IP_NET20[0]}
Test Operations From Vm Instance ${NETWORKS[1]} ${VM_IP_NET20[0]} ${dst_ip_list}
- [Teardown] Test Teardown With Tcpdump Stop ${cn1_conn_id} ${cn2_conn_id} ${os_conn_id}
+ [Teardown] VpnOperations.Test Teardown With Tcpdump Stop ${cn1_conn_id} ${cn2_conn_id} ${os_conn_id}
Add Multiple Extra Routes And Check Datapath Before L3VPN Creation
[Documentation] Add multiple extra routes and check data path before L3VPN creation
- Log "Adding extra one route to VM"
${CONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ip -6 addr add ${EXTRA_NW_IP[0]}/64 dev eth0
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[0]} ${CONFIG_EXTRA_ROUTE_IP1}
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[0]} ip -6 a
${cmd} = Catenate ${RT_OPTIONS} ${EXT_RT1} ${RT_OPTIONS} ${EXT_RT2}
Update Router @{ROUTERS}[0] ${cmd}
Show Router @{ROUTERS}[0] -D
- Log "Verify FIB table"
${vm_instances} = Create List @{EXTRA_NW_SUBNET}
Wait Until Keyword Succeeds 30s 5s Check For Elements At URI ${FIB_ENTRY_URL} ${vm_instances}
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[1]} ping6 -c 3 @{EXTRA_NW_IP}[1]
Delete And Recreate Extra Route
[Documentation] Recreate multiple extra route and check data path before L3VPN creation
- Log "Adding extra route to VM"
${CONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ip -6 addr add ${EXTRA_NW_IP[1]}/64 dev eth0
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET10[0]} ${CONFIG_EXTRA_ROUTE_IP1}
${EXT_RT1} = Set Variable destination=${EXTRA_NW_SUBNET[0]},gateway=${VM_IP_NET10[0]}
Delete Router And Router Interfaces With L3VPN
[Documentation] Delete Router and Interface to the subnets with L3VPN associate
- # Asscoiate router with L3VPN
${router_id}= Get Router Id ${ROUTERS[0]} ${devstack_conn_id}
Associate VPN to Router routerid=${router_id} vpnid=${VPN_INSTANCE_ID[0]}
${resp}= VPN Get L3VPN vpnid=${VPN_INSTANCE_ID[0]}
Should Contain ${resp} ${router_id}
- #Delete Interface
: FOR ${INTERFACE} IN @{SUBNETS}
\ Remove Interface ${ROUTERS[0]} ${INTERFACE}
${interface_output} = Show Router Interface ${ROUTERS[0]}
: FOR ${INTERFACE} IN @{SUBNETS}
\ ${subnet_id} = Get Subnet Id ${INTERFACE} ${devstack_conn_id}
\ Should Not Contain ${interface_output} ${subnet_id}
- # Delete Router and Interface to the subnets.
Delete Router ${ROUTERS[0]}
${router_output} = List Router
Should Not Contain ${router_output} ${ROUTERS[0]}
${router_list} = Create List ${ROUTERS[0]}
Wait Until Keyword Succeeds 3s 1s Check For Elements Not At URI ${ROUTER_URL} ${router_list}
- # Verify Router Entry removed from L3VPN
${resp}= VPN Get L3VPN vpnid=${VPN_INSTANCE_ID[0]}
Should Not Contain ${resp} ${router_id}
Wait Until Keyword Succeeds 30s 5s Verify GWMAC Flow Entry Removed From Flow Table ${OS_COMPUTE_1_IP}
VPN Delete L3VPN vpnid=${VPN_INSTANCE_ID[0]}
VPN Delete L3VPN vpnid=${VPN_INSTANCE_ID[1]}
VPN Delete L3VPN vpnid=${VPN_INSTANCE_ID[2]}
-
-*** Keywords ***
-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
-
-Get Gateway MAC And IP Address
- [Arguments] ${router_Name}
- [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} ${IP6_REGEX}
- [Return] ${MacAddr-list} ${IpAddr-list}
-
-Verify GWMAC Flow Entry On Flow Table
- [Arguments] ${cnIp}
- [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=:
- 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}
${output}= Get Fib Entries session
${resp}= Should Match Regexp ${output} destPrefix\\":\\"${FIB_ENTRY_3}\/32".*"${OS_COMPUTE_2_IP}\\"
${resp}= Should Match Regexp ${output} destPrefix\\":\\"${FIB_ENTRY_1}\/32".*"${OS_COMPUTE_1_IP}\\"
- Log Checking the RX Packets Count on VM1 and VM2 before ARP Broadcast
${rx_packet1_before} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[1]} ifconfig eth0
${rx_packet0_before} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[0]} ifconfig eth0
${CONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ifconfig eth0:1 @{EXTRA_NW_IP}[0] netmask 255.255.255.0 up
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[1]} ${RPING_MIP_IP}
Should Contain ${output} broadcast
Should Contain ${output} Received 0 reply
- Log Checking the RX Packets Count on VM1 and VM2 after ARP Broadcast
${rx_packet1_after} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[1]} ifconfig eth0
${rx_packet0_after} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[0]} ifconfig eth0
Should Not Be Equal ${rx_packet0_before} ${rx_packet0_after}
TC02 Verify MIP Migration
[Documentation] Verify that after migration of movable ip across compute nodes, the controller updates the routes
- Log Bring down the Sub Interface on DPN2
${UNCONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ifconfig eth0:1 down
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[1]} ${UNCONFIG_EXTRA_ROUTE_IP1}
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[1]} ifconfig
${output} Get Fib Entries session
${resp}= Should Match Regexp ${output} destPrefix\\":\\"${FIB_ENTRY_2}\\/32".*"${OS_COMPUTE_1_IP}\\"
Verify Ping To Sub Interface ${FIB_ENTRY_2}
- Log Removing the created sub-interface
${UNCONFIG_EXTRA_ROUTE_IP1} = Catenate sudo ifconfig eth0:1 down
${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_NET1[0]} ${UNCONFIG_EXTRA_ROUTE_IP1}