Remove code for capwap
[integration/test.git] / csit / suites / netvirt / l3vpn_bgp / multi_vpn_bgp.robot
1 *** Settings ***
2 Documentation       Test suite to validate multiple 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
6 Library             OperatingSystem
7 Library             RequestsLibrary
8 Resource            ../../../libraries/BgpOperations.robot
9 Resource            ../../../libraries/DevstackUtils.robot
10 Resource            ../../../libraries/OpenStackOperations.robot
11 Resource            ../../../libraries/OVSDB.robot
12 Resource            ../../../libraries/SetupUtils.robot
13 Resource            ../../../libraries/Tcpdump.robot
14 Resource            ../../../libraries/Utils.robot
15 Resource            ../../../libraries/VpnOperations.robot
16 Resource            ../../../variables/Variables.robot
17 Resource            ../../../variables/netvirt/Variables.robot
18
19 Suite Setup         Suite Setup
20 Suite Teardown      OpenStackOperations.OpenStack Suite Teardown
21 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
22 Test Teardown       OpenStackOperations.Get Test Teardown Debugs
23
24
25 *** Variables ***
26 ${NUM_OF_PORTS_PER_HOST}    3
27 ${NUM_OF_VMS_PER_HOST}      3
28 ${NUM_OF_L3VPN}             3
29 ${AS_ID}                    100
30 ${DCGW_SYSTEM_IP}           ${TOOLS_SYSTEM_1_IP}
31 ${NET}                      mvpn_net_new
32 ${ROUTER}                   mvpn_router
33 ${LOOPBACK_IP}              5.5.5.2/32
34 ${CREATE_RT}                ["2200:2","2300:2","2400:2"]
35 ${RT_LIST_1}                ["2200:2","2300:2"]
36 ${RT_LIST_2}                ["2200:2","2400:2"]
37 @{SECURITY_GROUP}           mvpn_sg    mvpn_custom_sg
38 @{REQ_PREFIXLENGTHS}        40.1.0.0/28    41.1.0.0/16
39 @{REQ_SUBNETS_PREFIX}       mvpn_subnet10    mvpn_subnet11
40 @{NETWORKS}                 mvpn_net_1    mvpn_net_2    mvpn_net_3
41 @{SUBNETS}                  mvpn_sub_1    mvpn_sub_2    mvpn_sub_3
42 @{SUBNET_CIDRS}             11.1.1.0/24    22.1.1.0/24    33.1.1.0/24
43 @{PORTS_HOST1}
44 ...                         mvpn_net_1_port_1
45 ...                         mvpn_net_2_port_1
46 ...                         mvpn_net_3_port_1
47 ...                         mvpn_net_1_port1_csg
48 ...                         mvpn_net_2_port1_csg
49 @{PORTS_HOST2}              mvpn_net_1_port_2    mvpn_net_2_port_2    mvpn_net_3_port_2    mvpn_net_2_port2_csg
50 @{VMS_HOST1}
51 ...                         mvpn_net_1_vm_1
52 ...                         mvpn_net_2_vm_1
53 ...                         mvpn_net_3_vm_1
54 ...                         mvpn_net_1_vm1_csg
55 ...                         mvpn_net_2_vm1_csg
56 @{VMS_HOST2}                mvpn_net_1_vm_2    mvpn_net_2_vm_2    mvpn_net_3_vm_2    mvpn_net_2_vm2_csg
57 @{NET_1_VMS}                mvpn_net_1_vm_1    mvpn_net_1_vm_2    mvpn_net_1_vm1_csg
58 @{NET_2_VMS}                mvpn_net_2_vm_1    mvpn_net_2_vm_2    mvpn_net_2_vm1_csg    mvpn_net_2_vm2_csg
59 @{NET_3_VMS}                mvpn_net_3_vm_1    mvpn_net_3_vm_2
60 @{VPN_INSTANCE_IDS}
61 ...                         4ae8cd92-48ca-49b5-94e1-b2921a261441
62 ...                         4ae8cd92-48ca-49b5-94e1-b2921a261442
63 ...                         4ae8cd92-48ca-49b5-94e1-b2921a261443
64 @{VPN_NAMES}                mvpn_1    mvpn_2    mvpn_3
65 @{RDS}                      ["2200:2"]    ["2300:2"]    ["2400:2"]
66 @{DCGW_RD}                  2200:2    2300:2    2400:2
67 @{LOOPBACK_IPS}             5.5.5.2    2.2.2.2    3.3.3.3
68 @{LOOPBACK_NAMES}           int1    int2    int3
69
70
71 *** Test Cases ***
72 Check Datapath Traffic Across Networks With L3VPN
73     [Documentation]    Datapath Test Across the networks with VPN.
74     ${output} =    OpenStackOperations.Execute Command on VM Instance
75     ...    ${NETWORKS}[0]
76     ...    ${NET_1_VM_IPS}[0]
77     ...    ping -c 20 ${NET_1_VM_IPS}[1]
78     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
79     ${output} =    OpenStackOperations.Execute Command on VM Instance
80     ...    ${NETWORKS}[0]
81     ...    ${NET_1_VM_IPS}[0]
82     ...    ping -c 20 ${NET_2_VM_IPS}[1]
83     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
84     ${output} =    OpenStackOperations.Execute Command on VM Instance
85     ...    ${NETWORKS}[0]
86     ...    ${NET_1_VM_IPS}[0]
87     ...    ping -c 20 ${NET_2_VM_IPS}[0]
88     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
89     ${output} =    OpenStackOperations.Execute Command on VM Instance
90     ...    ${NETWORKS}[0]
91     ...    ${NET_1_VM_IPS}[2]
92     ...    ping -c 20 ${NET_2_VM_IPS}[2]
93     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
94     ${output} =    OpenStackOperations.Execute Command on VM Instance
95     ...    ${NETWORKS}[0]
96     ...    ${NET_1_VM_IPS}[2]
97     ...    ping -c 20 ${NET_2_VM_IPS}[3]
98     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
99
100 Verify Route Update In Bgp For Routes With Default Route And Various Prefix Lengths
101     [Documentation]    Create network with different prefix lengths and check the route update in bgp.
102     BuiltIn.Wait Until Keyword Succeeds
103     ...    30s
104     ...    10s
105     ...    Utils.Check For Elements At URI
106     ...    ${FIB_ENTRY_URL}
107     ...    ${SUBNET_CIDRS}
108     OpenStackOperations.Create Network    ${NET}
109     ${length} =    BuiltIn.Get Length    ${REQ_SUBNETS_PREFIX}
110     FOR    ${idx}    IN RANGE    ${length}
111         OpenStackOperations.Create SubNet    ${NET}    ${REQ_SUBNETS_PREFIX}[${idx}]    ${REQ_PREFIXLENGTHS}[${idx}]
112     END
113     BuiltIn.Wait Until Keyword Succeeds
114     ...    3s
115     ...    1s
116     ...    Utils.Check For Elements At URI
117     ...    ${SUBNETWORK_URL}
118     ...    ${REQ_SUBNETS_PREFIX}
119     ${net_id} =    OpenStackOperations.Get Net Id    ${NET}
120     VpnOperations.Associate L3VPN To Network    networkid=${net_id}    vpnid=${VPN_INSTANCE_IDS}[0]
121     VpnOperations.Verify L3VPN On ODL    ${VPN_INSTANCE_IDS}[0]
122     BuiltIn.Wait Until Keyword Succeeds
123     ...    30s
124     ...    10s
125     ...    Utils.Check For Elements At URI
126     ...    ${FIB_ENTRY_URL}
127     ...    ${REQ_PREFIXLENGTHS}
128     [Teardown]    BuiltIn.Run Keywords    VpnOperations.Dissociate L3VPN From Networks    networkid=${net_id}    vpnid=${VPN_INSTANCE_IDS}[0]
129     ...    AND    OpenStackOperations.Delete Network    ${NET}
130     ...    AND    Post Test Cleanup    ${VPN_INSTANCE_IDS}[0]
131
132 Verification Of Route Download With Three Vpns In SE And Qbgp With One-One Export Import Route Target
133     [Documentation]    Check the datapath traffic with one-one export import route target with three vpns.
134     Create Multiple L3VPN    ${NETWORKS}[0]    ${3}
135     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
136         BgpOperations.Configure BGP And Add Neighbor On DCGW
137         ...    ${DCGW_SYSTEM_IP}
138         ...    ${AS_ID}
139         ...    ${DCGW_SYSTEM_IP}
140         ...    ${ODL_SYSTEM_IP}
141         ...    ${VPN_NAMES}[${index}]
142         ...    ${DCGW_RD}[${index}]
143         ...    ${LOOPBACK_IPS}[${index}]
144     END
145     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${NETWORKS}
146     ${fib_values} =    BuiltIn.Create List
147     ...    @{NET_1_VM_IPS}
148     ...    @{NET_2_VM_IPS}
149     ...    @{NET_3_VM_IPS}
150     ...    @{SUBNET_CIDRS}
151     ...    @{LOOPBACK_IPS}
152     BuiltIn.Wait Until Keyword Succeeds
153     ...    30s
154     ...    10s
155     ...    Utils.Check For Elements At URI
156     ...    ${FIB_ENTRY_URL}
157     ...    ${fib_values}
158     ${fib1_values} =    BuiltIn.Create List    ${NET_1_VM_IPS}    ${SUBNET_CIDRS}[0]    ${LOOPBACK_IPS}[0]
159     BuiltIn.Wait Until Keyword Succeeds
160     ...    60s
161     ...    15s
162     ...    BgpOperations.Verify Routes On Quagga
163     ...    ${DCGW_SYSTEM_IP}
164     ...    ${DCGW_RD}[0]
165     ...    ${fib1_values}
166     ${fib2_values} =    BuiltIn.Create List    ${NET_2_VM_IPS}    ${SUBNET_CIDRS}[1]    ${LOOPBACK_IPS}[1]
167     BuiltIn.Wait Until Keyword Succeeds
168     ...    60s
169     ...    15s
170     ...    BgpOperations.Verify Routes On Quagga
171     ...    ${DCGW_SYSTEM_IP}
172     ...    ${DCGW_RD}[1]
173     ...    ${fib2_values}
174     ${fib3_values} =    BuiltIn.Create List    ${NET_3_VM_IPS}    ${SUBNET_CIDRS}[2]    ${LOOPBACK_IPS}[2]
175     BuiltIn.Wait Until Keyword Succeeds
176     ...    60s
177     ...    15s
178     ...    BgpOperations.Verify Routes On Quagga
179     ...    ${DCGW_SYSTEM_IP}
180     ...    ${DCGW_RD}[2]
181     ...    ${fib3_values}
182     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
183     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
184     ${output} =    OpenStackOperations.Execute Command on VM Instance
185     ...    ${NETWORKS}[0]
186     ...    ${NET_1_VM_IPS}[0]
187     ...    ping -c 3 ${NET_1_VM_IPS}[1]
188     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
189     ${output} =    OpenStackOperations.Execute Command on VM Instance
190     ...    ${NETWORKS}[1]
191     ...    ${NET_2_VM_IPS}[0]
192     ...    ping -c 3 ${NET_2_VM_IPS}[1]
193     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
194     ${output} =    OpenStackOperations.Execute Command on VM Instance
195     ...    ${NETWORKS}[0]
196     ...    ${NET_1_VM_IPS}[0]
197     ...    ping -c 3 ${NET_2_VM_IPS}[0]
198     BuiltIn.Should Contain    ${output}    ${NO_PING_REGEXP}
199     ${output} =    OpenStackOperations.Execute Command on VM Instance
200     ...    ${NETWORKS}[0]
201     ...    ${NET_1_VM_IPS}[0]
202     ...    ping -c 3 ${NET_2_VM_IPS}[1]
203     BuiltIn.Should Contain    ${output}    ${NO_PING_REGEXP}
204     [Teardown]    Post Test Cleanup    @{VPN_INSTANCE_IDS}
205
206 Verification Of Route Download With Three Vpns In SE And Qbgp With One-Many Export Import Route Target
207     [Documentation]    Check the datapath traffic with one-many export import route target with three vpns.
208     VpnOperations.VPN Create L3VPN
209     ...    vpnid=${VPN_INSTANCE_IDS}[0]
210     ...    name=${VPN_NAMES}[0]
211     ...    rd=${RDS}[0]
212     ...    exportrt=${CREATE_RT}
213     ...    importrt=${RDS}[0]
214     FOR    ${index}    IN RANGE    1    ${NUM_OF_L3VPN}
215         VpnOperations.VPN Create L3VPN
216         ...    vpnid=${VPN_INSTANCE_IDS}[${index}]
217         ...    name=${VPN_NAMES}[${index}]
218         ...    rd=${RDS}[${index}]
219         ...    exportrt=${RDS}[${index}]
220         ...    importrt=${RT_LIST_${index}}
221     END
222     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
223         BgpOperations.Configure BGP And Add Neighbor On DCGW
224         ...    ${DCGW_SYSTEM_IP}
225         ...    ${AS_ID}
226         ...    ${DCGW_SYSTEM_IP}
227         ...    ${ODL_SYSTEM_IP}
228         ...    ${VPN_NAMES}[${index}]
229         ...    ${DCGW_RD}[${index}]
230         ...    ${LOOPBACK_IPS}[${index}]
231     END
232     ${networks} =    BuiltIn.Create List    ${NETWORKS}[0]    ${NETWORKS}[1]
233     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${networks}
234     ${fib_values} =    BuiltIn.Create List
235     ...    ${NET_1_VM_IPS}
236     ...    ${NET_2_VM_IPS}
237     ...    ${SUBNET_CIDRS}[0]
238     ...    ${SUBNET_CIDRS}[1]
239     BuiltIn.Wait Until Keyword Succeeds
240     ...    30s
241     ...    10s
242     ...    Utils.Check For Elements At URI
243     ...    ${FIB_ENTRY_URL}
244     ...    ${fib_values}
245     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
246     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
247     [Teardown]    Post Test Cleanup    @{VPN_INSTANCE_IDS}
248
249 Verification Of Route Download With Three Vpns In SE And Qbgp With Many-One Export Import Route Target
250     [Documentation]    Check the datapath traffic with many-one export import route target with three vpns.
251     VpnOperations.VPN Create L3VPN
252     ...    vpnid=${VPN_INSTANCE_IDS}[0]
253     ...    name=${VPN_NAMES}[0]
254     ...    rd=${RDS}[0]
255     ...    exportrt=${RDS}[0]
256     ...    importrt=${CREATE_RT}
257     FOR    ${index}    IN RANGE    1    ${NUM_OF_L3VPN}
258         VpnOperations.VPN Create L3VPN
259         ...    vpnid=${VPN_INSTANCE_IDS}[${index}]
260         ...    name=${VPN_NAMES}[${index}]
261         ...    rd=${RDS}[${index}]
262         ...    exportrt=${RT_LIST_${index}}
263         ...    importrt=${RDS}[${index}]
264     END
265     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
266         BgpOperations.Configure BGP And Add Neighbor On DCGW
267         ...    ${DCGW_SYSTEM_IP}
268         ...    ${AS_ID}
269         ...    ${DCGW_SYSTEM_IP}
270         ...    ${ODL_SYSTEM_IP}
271         ...    ${VPN_NAMES}[${index}]
272         ...    ${DCGW_RD}[${index}]
273         ...    ${LOOPBACK_IPS}[${index}]
274     END
275     ${networks} =    BuiltIn.Create List    ${NETWORKS}[0]    ${NETWORKS}[1]
276     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${networks}
277     ${fib_values} =    BuiltIn.Create List
278     ...    ${NET_1_VM_IPS}
279     ...    ${NET_2_VM_IPS}
280     ...    ${SUBNET_CIDRS}[0]
281     ...    ${SUBNET_CIDRS}[1]
282     BuiltIn.Wait Until Keyword Succeeds
283     ...    30s
284     ...    10s
285     ...    Utils.Check For Elements At URI
286     ...    ${FIB_ENTRY_URL}
287     ...    ${fib_values}
288     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
289     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
290     [Teardown]    Post Test Cleanup    @{VPN_INSTANCE_IDS}
291
292 Verification Of Route Download With Three Vpns In SE And Qbgp With Many-Many Export Import Route Target
293     [Documentation]    Check the datapath traffic with many-many export import route target with three vpns.
294     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
295         VpnOperations.VPN Create L3VPN
296         ...    vpnid=${VPN_INSTANCE_IDS}[${index}]
297         ...    name=${VPN_NAMES}[${index}]
298         ...    rd=${RDS}[${index}]
299         ...    exportrt=${CREATE_RT}
300         ...    importrt=${CREATE_RT}
301     END
302     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
303         BgpOperations.Configure BGP And Add Neighbor On DCGW
304         ...    ${DCGW_SYSTEM_IP}
305         ...    ${AS_ID}
306         ...    ${DCGW_SYSTEM_IP}
307         ...    ${ODL_SYSTEM_IP}
308         ...    ${VPN_NAMES}[${index}]
309         ...    ${DCGW_RD}[${index}]
310         ...    ${LOOPBACK_IPS}[${index}]
311     END
312     ${networks} =    BuiltIn.Create List    ${NETWORKS}[0]    ${NETWORKS}[1]
313     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${networks}
314     ${fib_values} =    BuiltIn.Create List
315     ...    ${NET_1_VM_IPS}
316     ...    ${NET_2_VM_IPS}
317     ...    ${SUBNET_CIDRS}[0]
318     ...    ${SUBNET_CIDRS}[1]
319     BuiltIn.Wait Until Keyword Succeeds
320     ...    30s
321     ...    10s
322     ...    Utils.Check For Elements At URI
323     ...    ${FIB_ENTRY_URL}
324     ...    ${fib_values}
325     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
326     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
327
328
329 *** Keywords ***
330 Suite Setup
331     [Documentation]    Basic setup.
332     VpnOperations.Basic Suite Setup
333     BgpOperations.Start Quagga Processes On ODL    ${ODL_SYSTEM_IP}
334     BgpOperations.Start Quagga Processes On DCGW    ${DCGW_SYSTEM_IP}
335     Create Setup
336     OpenStackOperations.Show Debugs    @{NET_1_VMS}    @{NET_2_VMS}    @{NET_3_VMS}
337     OpenStackOperations.Get Suite Debugs
338
339 Create Setup
340     [Documentation]    Create basic topology
341     Create Neutron Networks
342     Create Neutron Subnets
343     OpenStackOperations.Create Allow All SecurityGroup    ${SECURITY_GROUP[0]}
344     Security Group Rule with Remote SG    ${SECURITY_GROUP[1]}
345     Create Neutron Ports
346     Create Nova VMs
347     VpnOperations.VPN Create L3VPN
348     ...    vpnid=${VPN_INSTANCE_IDS}[0]
349     ...    name=${VPN_NAMES}[0]
350     ...    rd=${RDS}[0]
351     ...    exportrt=${RDS}[0]
352     ...    importrt=${RDS}[0]
353     VpnOperations.Verify L3VPN On ODL    ${VPN_INSTANCE_IDS}[0]
354     FOR    ${network}    IN    @{NETWORKS}
355         ${network_id} =    OpenStackOperations.Get Net Id    ${network}
356         VpnOperations.Associate L3VPN To Network    networkid=${network_id}    vpnid=${VPN_INSTANCE_IDS}[0]
357     END
358     Create BGP Config On ODL
359     Create BGP Config On DCGW
360     Create External Tunnel Endpoint
361
362 Create Neutron Networks
363     [Documentation]    Create required number of networks
364     FOR    ${NET}    IN    @{NETWORKS}
365         OpenStackOperations.Create Network    ${NET}
366     END
367     BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements At URI    ${NETWORK_URL}    ${NETWORKS}
368
369 Create Neutron Subnets
370     [Documentation]    Create required number of subnets for previously created networks
371     ${num_of_networks} =    BuiltIn.Get Length    ${NETWORKS}
372     FOR    ${index}    IN RANGE    0    ${num_of_networks}
373         OpenStackOperations.Create SubNet    ${NETWORKS}[${index}]    ${SUBNETS}[${index}]    ${SUBNET_CIDRS}[${index}]
374     END
375     BuiltIn.Wait Until Keyword Succeeds
376     ...    3s
377     ...    1s
378     ...    Utils.Check For Elements At URI
379     ...    ${SUBNETWORK_URL}
380     ...    ${SUBNETS}
381
382 Create Neutron Ports
383     [Documentation]    Create required number of ports under previously created subnets
384     FOR    ${index}    IN RANGE    0    ${NUM_OF_PORTS_PER_HOST}
385         OpenStackOperations.Create Port    ${NETWORKS}[${index}]    ${PORTS_HOST1}[${index}]    sg=${SECURITY_GROUP}[0]
386     END
387     FOR    ${index}    IN RANGE    0    ${NUM_OF_PORTS_PER_HOST}
388         OpenStackOperations.Create Port    ${NETWORKS}[${index}]    ${PORTS_HOST2}[${index}]    sg=${SECURITY_GROUP}[0]
389     END
390     OpenStackOperations.Create Port    ${NETWORKS}[0]    ${PORTS_HOST1}[3]    ${SECURITY_GROUP}[1]
391     OpenStackOperations.Create Port    ${NETWORKS}[1]    ${PORTS_HOST1}[4]    ${SECURITY_GROUP}[1]
392     OpenStackOperations.Create Port    ${NETWORKS}[1]    ${PORTS_HOST2}[3]    ${SECURITY_GROUP}[1]
393     ${PORTS} =    BuiltIn.Create List    @{PORTS_HOST1}    @{PORTS_HOST2}
394     BuiltIn.Wait Until Keyword Succeeds
395     ...    3s
396     ...    1s
397     ...    Utils.Check For Elements At URI
398     ...    ${CONFIG_API}/neutron:neutron/ports/
399     ...    ${PORTS}
400
401 Create Nova VMs
402     [Documentation]    Create Vm instances on compute nodes
403     FOR    ${index}    IN RANGE    0    ${NUM_OF_VMS_PER_HOST}
404         OpenStackOperations.Create Vm Instance With Port On Compute Node
405         ...    ${PORTS_HOST1}[${index}]
406         ...    ${VMS_HOST1}[${index}]
407         ...    ${OS_CMP1_HOSTNAME}
408         ...    sg=${SECURITY_GROUP}[0]
409     END
410     FOR    ${index}    IN RANGE    0    ${NUM_OF_VMS_PER_HOST}
411         OpenStackOperations.Create Vm Instance With Port On Compute Node
412         ...    ${PORTS_HOST2}[${index}]
413         ...    ${VMS_HOST2}[${index}]
414         ...    ${OS_CMP2_HOSTNAME}
415         ...    sg=${SECURITY_GROUP}[0]
416     END
417     OpenStackOperations.Create Vm Instance With Port On Compute Node
418     ...    ${PORTS_HOST1}[3]
419     ...    ${VMS_HOST1}[3]
420     ...    ${OS_CMP1_HOSTNAME}
421     ...    sg=${SECURITY_GROUP}[1]
422     OpenStackOperations.Create Vm Instance With Port On Compute Node
423     ...    ${PORTS_HOST1}[4]
424     ...    ${VMS_HOST1}[4]
425     ...    ${OS_CMP1_HOSTNAME}
426     ...    sg=${SECURITY_GROUP}[1]
427     OpenStackOperations.Create Vm Instance With Port On Compute Node
428     ...    ${PORTS_HOST2}[3]
429     ...    ${VMS_HOST2}[3]
430     ...    ${OS_CMP2_HOSTNAME}
431     ...    sg=${SECURITY_GROUP}[1]
432     @{NET_1_VM_IPS}    ${NET_1_DHCP_IP} =    OpenStackOperations.Get VM IPs    @{NET_1_VMS}
433     @{NET_2_VM_IPS}    ${NET_2_DHCP_IP} =    OpenStackOperations.Get VM IPs    @{NET_2_VMS}
434     @{NET_3_VM_IPS}    ${NET_3_DHCP_IP} =    OpenStackOperations.Get VM IPs    @{NET_3_VMS}
435     BuiltIn.Set Suite Variable    @{NET_1_VM_IPS}
436     BuiltIn.Set Suite Variable    @{NET_2_VM_IPS}
437     BuiltIn.Set Suite Variable    @{NET_3_VM_IPS}
438     BuiltIn.Should Not Contain    ${NET_1_VM_IPS}    None
439     BuiltIn.Should Not Contain    ${NET_2_VM_IPS}    None
440     BuiltIn.Should Not Contain    ${NET_3_VM_IPS}    None
441     BuiltIn.Should Not Contain    ${NET_1_DHCP_IP}    None
442     BuiltIn.Should Not Contain    ${NET_2_DHCP_IP}    None
443     BuiltIn.Should Not Contain    ${NET_3_DHCP_IP}    None
444
445 Create External Tunnel Endpoint
446     [Documentation]    Create and verify external tunnel endpoint between ODL and GWIP
447     BgpOperations.Create External Tunnel Endpoint Configuration    destIp=${DCGW_SYSTEM_IP}
448     ${output} =    BgpOperations.Get External Tunnel Endpoint Configuration    ${DCGW_SYSTEM_IP}
449     BuiltIn.Should Contain    ${output}    ${DCGW_SYSTEM_IP}
450
451 Create BGP Config On ODL
452     [Documentation]    Configure BGP Config on ODL
453     KarafKeywords.Issue Command On Karaf Console    ${BGP_CONFIG_SERVER_CMD}
454     BgpOperations.Create BGP Configuration On ODL    localas=${AS_ID}    routerid=${ODL_SYSTEM_IP}
455     BgpOperations.AddNeighbor To BGP Configuration On ODL    remoteas=${AS_ID}    neighborAddr=${DCGW_SYSTEM_IP}
456     ${output} =    BgpOperations.Get BGP Configuration On ODL    session
457     BuiltIn.Should Contain    ${output}    ${DCGW_SYSTEM_IP}
458
459 Create BGP Config On DCGW
460     [Documentation]    Configure BGP on DCGW
461     BgpOperations.Configure BGP And Add Neighbor On DCGW
462     ...    ${DCGW_SYSTEM_IP}
463     ...    ${AS_ID}
464     ...    ${DCGW_SYSTEM_IP}
465     ...    ${ODL_SYSTEM_IP}
466     ...    ${VPN_NAMES}[0]
467     ...    ${DCGW_RD}[0]
468     ...    ${LOOPBACK_IPS}[0]
469     ${output} =    BgpOperations.Execute Show Command On Quagga    ${DCGW_SYSTEM_IP}    ${RUN_CONFIG}
470     BuiltIn.Should Contain    ${output}    ${ODL_SYSTEM_IP}
471     ${output} =    BuiltIn.Wait Until Keyword Succeeds
472     ...    180s
473     ...    10s
474     ...    BgpOperations.Verify BGP Neighbor Status On Quagga
475     ...    ${DCGW_SYSTEM_IP}
476     ...    ${ODL_SYSTEM_IP}
477
478 Create Multiple L3VPN
479     [Documentation]    Creates multiple L3VPNs and then verify the same
480     [Arguments]    ${network}    ${num_of_l3vpns}
481     FOR    ${index}    IN RANGE    0    ${num_of_l3vpns}
482         BuiltIn.Wait Until Keyword Succeeds
483         ...    40s
484         ...    10s
485         ...    VpnOperations.VPN Create L3VPN
486         ...    vpnid=${VPN_INSTANCE_IDS}[${index}]
487         ...    name=${VPN_NAMES}[${index}]
488         ...    rd=${RDS}[${index}]
489         ...    exportrt=${RDS}[${index}]
490         ...    importrt=${RDS}[${index}]
491         VpnOperations.Verify L3VPN On ODL    ${VPN_INSTANCE_IDS}[${index}]
492     END
493
494 Security Group Rule with Remote SG
495     [Documentation]    Allow all TCP/UDP/ICMP packets for this suite
496     [Arguments]    ${sec_grp}
497     OpenStackOperations.Neutron Security Group Create    ${sec_grp}
498     OpenStackOperations.Neutron Security Group Rule Create
499     ...    ${sec_grp}
500     ...    direction=ingress
501     ...    port_range_max=65535
502     ...    port_range_min=1
503     ...    protocol=tcp
504     ...    remote-group-id=${sec_grp}
505     OpenStackOperations.Neutron Security Group Rule Create
506     ...    ${sec_grp}
507     ...    direction=egress
508     ...    port_range_max=65535
509     ...    port_range_min=1
510     ...    protocol=tcp
511     ...    remote-group-id=${sec_grp}
512     OpenStackOperations.Neutron Security Group Rule Create
513     ...    ${sec_grp}
514     ...    direction=ingress
515     ...    protocol=icmp
516     ...    remote-group-id=${sec_grp}
517     OpenStackOperations.Neutron Security Group Rule Create
518     ...    ${sec_grp}
519     ...    direction=egress
520     ...    protocol=icmp
521     ...    remote-group-id=${sec_grp}
522     OpenStackOperations.Neutron Security Group Rule Create
523     ...    ${sec_grp}
524     ...    direction=ingress
525     ...    port_range_max=65535
526     ...    port_range_min=1
527     ...    protocol=udp
528     ...    remote_group_id=${sec_grp}
529     OpenStackOperations.Neutron Security Group Rule Create
530     ...    ${sec_grp}
531     ...    direction=egress
532     ...    port_range_max=65535
533     ...    port_range_min=1
534     ...    protocol=udp
535     ...    remote-group-id=${sec_grp}
536
537 Post Test Cleanup
538     [Documentation]    Test Case Cleanup.
539     [Arguments]    @{vpn_ids}
540     VpnOperations.Delete Multiple L3VPNs    @{vpn_ids}
541     BgpOperations.Delete BGP Config On Quagga    ${DCGW_SYSTEM_IP}    ${AS_ID}