2 Documentation Test suite to validate BGP vpnservice functionality in an openstack integrated environment.
3 ... The assumption of this suite is that the environment is already configured with the proper
4 ... integration bridges and vxlan tunnels.
5 Suite Setup BGP Vpnservice Suite Setup
6 Suite Teardown BGP Vpnservice Suite Teardown
7 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
8 Test Teardown Get Test Teardown Debugs
9 Library OperatingSystem
10 Library RequestsLibrary
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OpenStackOperations.robot
13 Resource ../../../libraries/DevstackUtils.robot
14 Resource ../../../libraries/VpnOperations.robot
15 Resource ../../../libraries/OVSDB.robot
16 Resource ../../../libraries/SetupUtils.robot
17 Resource ../../../libraries/BgpOperations.robot
18 Resource ../../../variables/Variables.robot
19 Resource ../../../variables/netvirt/Variables.robot
22 @{NETWORKS} NET101 NET102 NET103 NET104
23 @{SUBNETS} SUBNET101 SUBNET102 SUBNET103 SUBNET104
24 @{SUBNET_CIDR} 101.1.1.0/8 102.1.1.0/16 103.1.1.0/24 104.1.1.0/24
25 @{PORTS} PORT101 PORT102 PORT103 PORT104
26 @{VM_NAMES} VM101 VM102 VM103 VM104
27 @{VPN_INSTANCE_IDS} 4ae8cd92-48ca-49b5-94e1-b2921a261111 4ae8cd92-48ca-49b5-94e1-b2921a261112
28 @{RD_LIST} ["2200:2"] ["2300:2"]
29 @{VPN_NAMES} vpn101 vpn102
30 ${LOOPBACK_IP} 5.5.5.2
31 ${DCGW_SYSTEM_IP} ${TOOLS_SYSTEM_1_IP}
34 ${SECURITY_GROUP} sg-vpnservice-bgp
37 Create BGP Config On ODL
38 [Documentation] Create BGP Config on ODL
39 Create BGP Configuration On ODL localas=${AS_ID} routerid=${ODL_SYSTEM_IP}
40 AddNeighbor To BGP Configuration On ODL remoteas=${AS_ID} neighborAddr=${DCGW_SYSTEM_IP}
41 ${output} = Get BGP Configuration On ODL session
43 Should Contain ${output} ${DCGW_SYSTEM_IP}
45 Create BGP Config On DCGW
46 [Documentation] Configure BGP Config on DCGW
47 Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} ${VPN_NAMES[0]} ${DCGW_RD}
49 Add Loopback Interface On DCGW ${DCGW_SYSTEM_IP} lo ${LOOPBACK_IP}
50 ${output} = Execute Show Command On Quagga ${DCGW_SYSTEM_IP} show running-config
52 Should Contain ${output} ${ODL_SYSTEM_IP}
54 Verify BGP Neighbor Status
55 [Documentation] Verify BGP status established
56 ${output} = Wait Until Keyword Succeeds 60s 15s Verify BGP Neighbor Status On Quagga ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP}
58 ${output1} = Execute Show Command On Quagga ${DCGW_SYSTEM_IP} show ip bgp vrf ${DCGW_RD}
60 Should Contain ${output1} ${LOOPBACK_IP}
62 Create External Tunnel Endpoint
63 [Documentation] Create and verify external tunnel endpoint between ODL and GWIP
64 Create External Tunnel Endpoint Configuration destIp=${DCGW_SYSTEM_IP}
65 ${output} = Get External Tunnel Endpoint Configuration ${DCGW_SYSTEM_IP}
66 Should Contain ${output} ${DCGW_SYSTEM_IP}
68 Verify Routes Exchange Between ODL And DCGW
69 [Documentation] Verify routes exchange between ODL and DCGW
70 ${fib_values} = Create List ${LOOPBACK_IP} @{VM_IPS}
71 Wait Until Keyword Succeeds 60s 15s Check For Elements At URI ${CONFIG_API}/odl-fib:fibEntries/vrfTables/${DCGW_RD}/ ${fib_values}
72 Wait Until Keyword Succeeds 60s 15s Verify Routes On Quagga ${DCGW_SYSTEM_IP} ${DCGW_RD} ${fib_values}
73 [Teardown] Run Keywords Report_Failure_Due_To_Bug 7607
74 ... AND Get Test Teardown Debugs
76 Delete External Tunnel Endpoint
77 [Documentation] Delete external tunnel endpoint
78 Delete External Tunnel Endpoint Configuration destIp=${DCGW_SYSTEM_IP}
79 ${output} = Get External Tunnel Endpoint Configuration ${DCGW_SYSTEM_IP}
80 Should Not Contain ${output} ${DCGW_SYSTEM_IP}
82 Delete BGP Config On ODL
83 [Documentation] Delete BGP Configuration on ODL
84 Delete BGP Configuration On ODL session
85 ${output} = Get BGP Configuration On ODL session
87 Should Not Contain ${output} ${DCGW_SYSTEM_IP}
88 Run Command On Remote System ${ODL_SYSTEM_IP} sudo cp /opt/quagga/var/log/quagga/zrpcd.init.log /tmp/
90 Delete BGP Config On DCGW
91 [Documentation] Delete BGP Configuration on DCGW
92 ${output} = Delete BGP Config On Quagga ${DCGW_SYSTEM_IP} ${AS_ID}
94 Should Not Contain ${output} ${ODL_SYSTEM_IP}
97 BGP Vpnservice Suite Setup
98 SetupUtils.Setup_Utils_For_Setup_And_Teardown
99 DevstackUtils.Devstack Suite Setup
100 Create And Configure Security Group ${SECURITY_GROUP}
101 Start Quagga Processes On ODL ${ODL_SYSTEM_IP}
102 Start Quagga Processes On DCGW ${DCGW_SYSTEM_IP}
103 Create Basic Configuartion for BGP VPNservice Suite
105 BGP Vpnservice Suite Teardown
106 Delete Basic Configuartion for BGP VPNservice Suite
107 Delete SecurityGroup ${SECURITY_GROUP}
108 Close All Connections
110 Create Basic Configuartion for BGP VPNservice Suite
111 [Documentation] Create basic configuration for BGP VPNservice suite
112 Start Quagga Processes On ODL ${ODL_SYSTEM_IP}
113 : FOR ${Network} IN @{NETWORKS}
114 \ Create Network ${Network}
115 Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${NETWORK_URL} ${NETWORKS}
116 ${length}= Get Length ${SUBNETS}
117 : FOR ${idx} IN RANGE ${length}
118 \ Create SubNet ${NETWORKS[${idx}]} ${SUBNETS[${idx}]} ${SUBNET_CIDR[${idx}]}
119 Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS}
120 : FOR ${network} ${port} IN ZIP ${NETWORKS} ${PORTS}
121 \ Create Port ${network} ${port} sg=${SECURITY_GROUP}
122 Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${PORT_URL} ${PORTS}
123 Create Vm Instance With Port On Compute Node ${PORTS[0]} ${VM_NAMES[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
124 Create Vm Instance With Port On Compute Node ${PORTS[1]} ${VM_NAMES[1]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
125 Create Vm Instance With Port On Compute Node ${PORTS[2]} ${VM_NAMES[2]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
126 Create Vm Instance With Port On Compute Node ${PORTS[3]} ${VM_NAMES[3]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
127 @{VM_IPS} ${DHCP_IPS} = Get VM IPs @{VM_NAMES}
128 Set Suite Variable @{VM_IPS}
129 Should Not Contain ${VM_IPS} None
130 Should Not Contain ${DHCP_IPS} None
131 ${net_id} = Get Net Id @{NETWORKS}[0] ${devstack_conn_id}
132 ${tenant_id} = Get Tenant ID From Network ${net_id}
133 VPN Create L3VPN vpnid=${VPN_INSTANCE_IDS[0]} name=${VPN_NAMES[0]} rd=${RD_LIST[0]} exportrt=${RD_LIST[0]} importrt=${RD_LIST[0]} tenantid=${tenant_id}
134 : FOR ${network} IN @{NETWORKS}
135 \ ${network_id} = Get Net Id ${network} ${devstack_conn_id}
136 \ Associate L3VPN To Network networkid=${network_id} vpnid=${VPN_INSTANCE_IDS[0]}
137 ${resp} = VPN Get L3VPN vpnid=${VPN_INSTANCE_IDS[0]}
140 Delete Basic Configuartion for BGP VPNservice Suite
141 [Documentation] Delete basic configuration for BGP Vpnservice suite
142 : FOR ${network} IN @{NETWORKS}
143 \ ${network_id} = Get Net Id ${network} ${devstack_conn_id}
144 \ Dissociate L3VPN From Networks networkid=${network_id} vpnid=${VPN_INSTANCE_IDS[0]}
145 VPN Delete L3VPN vpnid=${VPN_INSTANCE_IDS[0]}
146 : FOR ${vmName} IN @{VM_NAMES}
147 \ Delete Vm Instance ${vmName}
148 : FOR ${port} IN @{PORTS}
149 \ Delete Port ${port}
150 : FOR ${Subnet} IN @{SUBNETS}
151 \ Delete SubNet ${Subnet}
152 : FOR ${Network} IN @{NETWORKS}
153 \ Delete Network ${Network}