Upgrade RF syntax for v3.2 compatibility
[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 Suite Setup       Suite Setup
6 Suite Teardown    OpenStackOperations.OpenStack Suite Teardown
7 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
8 Test Teardown     OpenStackOperations.Get Test Teardown Debugs
9 Library           OperatingSystem
10 Library           RequestsLibrary
11 Resource          ../../../libraries/BgpOperations.robot
12 Resource          ../../../libraries/DevstackUtils.robot
13 Resource          ../../../libraries/OpenStackOperations.robot
14 Resource          ../../../libraries/OVSDB.robot
15 Resource          ../../../libraries/SetupUtils.robot
16 Resource          ../../../libraries/Tcpdump.robot
17 Resource          ../../../libraries/Utils.robot
18 Resource          ../../../libraries/VpnOperations.robot
19 Resource          ../../../variables/Variables.robot
20 Resource          ../../../variables/netvirt/Variables.robot
21
22 *** Variables ***
23 ${NUM_OF_PORTS_PER_HOST}    3
24 ${NUM_OF_VMS_PER_HOST}    3
25 ${NUM_OF_L3VPN}    3
26 ${AS_ID}          100
27 ${DCGW_SYSTEM_IP}    ${TOOLS_SYSTEM_1_IP}
28 ${NET}            mvpn_net_new
29 ${ROUTER}         mvpn_router
30 ${LOOPBACK_IP}    5.5.5.2/32
31 ${CREATE_RT}      ["2200:2","2300:2","2400:2"]
32 ${RT_LIST_1}      ["2200:2","2300:2"]
33 ${RT_LIST_2}      ["2200:2","2400:2"]
34 @{SECURITY_GROUP}    mvpn_sg    mvpn_custom_sg
35 @{REQ_PREFIXLENGTHS}    40.1.0.0/28    41.1.0.0/16
36 @{REQ_SUBNETS_PREFIX}    mvpn_subnet10    mvpn_subnet11
37 @{NETWORKS}       mvpn_net_1    mvpn_net_2    mvpn_net_3
38 @{SUBNETS}        mvpn_sub_1    mvpn_sub_2    mvpn_sub_3
39 @{SUBNET_CIDRS}    11.1.1.0/24    22.1.1.0/24    33.1.1.0/24
40 @{PORTS_HOST1}    mvpn_net_1_port_1    mvpn_net_2_port_1    mvpn_net_3_port_1    mvpn_net_1_port1_csg    mvpn_net_2_port1_csg
41 @{PORTS_HOST2}    mvpn_net_1_port_2    mvpn_net_2_port_2    mvpn_net_3_port_2    mvpn_net_2_port2_csg
42 @{VMS_HOST1}      mvpn_net_1_vm_1    mvpn_net_2_vm_1    mvpn_net_3_vm_1    mvpn_net_1_vm1_csg    mvpn_net_2_vm1_csg
43 @{VMS_HOST2}      mvpn_net_1_vm_2    mvpn_net_2_vm_2    mvpn_net_3_vm_2    mvpn_net_2_vm2_csg
44 @{NET_1_VMS}      mvpn_net_1_vm_1    mvpn_net_1_vm_2    mvpn_net_1_vm1_csg
45 @{NET_2_VMS}      mvpn_net_2_vm_1    mvpn_net_2_vm_2    mvpn_net_2_vm1_csg    mvpn_net_2_vm2_csg
46 @{NET_3_VMS}      mvpn_net_3_vm_1    mvpn_net_3_vm_2
47 @{VPN_INSTANCE_IDS}    4ae8cd92-48ca-49b5-94e1-b2921a261441    4ae8cd92-48ca-49b5-94e1-b2921a261442    4ae8cd92-48ca-49b5-94e1-b2921a261443
48 @{VPN_NAMES}      mvpn_1    mvpn_2    mvpn_3
49 @{RDS}            ["2200:2"]    ["2300:2"]    ["2400:2"]
50 @{DCGW_RD}        2200:2    2300:2    2400:2
51 @{LOOPBACK_IPS}    5.5.5.2    2.2.2.2    3.3.3.3
52 @{LOOPBACK_NAMES}    int1    int2    int3
53
54 *** Test Cases ***
55 Check Datapath Traffic Across Networks With L3VPN
56     [Documentation]    Datapath Test Across the networks with VPN.
57     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[0]    ping -c 20 @{NET_1_VM_IPS}[1]
58     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
59     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[0]    ping -c 20 @{NET_2_VM_IPS}[1]
60     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
61     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[0]    ping -c 20 @{NET_2_VM_IPS}[0]
62     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
63     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[2]    ping -c 20 @{NET_2_VM_IPS}[2]
64     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
65     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[2]    ping -c 20 @{NET_2_VM_IPS}[3]
66     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
67
68 Verify Route Update In Bgp For Routes With Default Route And Various Prefix Lengths
69     [Documentation]    Create network with different prefix lengths and check the route update in bgp.
70     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${SUBNET_CIDRS}
71     OpenStackOperations.Create Network    ${NET}
72     ${length} =    BuiltIn.Get Length    ${REQ_SUBNETS_PREFIX}
73     FOR    ${idx}    IN RANGE    ${length}
74         OpenStackOperations.Create SubNet    ${NET}    @{REQ_SUBNETS_PREFIX}[${idx}]    @{REQ_PREFIXLENGTHS}[${idx}]
75     END
76     BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements At URI    ${SUBNETWORK_URL}    ${REQ_SUBNETS_PREFIX}
77     ${net_id} =    OpenStackOperations.Get Net Id    ${NET}
78     VpnOperations.Associate L3VPN To Network    networkid=${net_id}    vpnid=@{VPN_INSTANCE_IDS}[0]
79     VpnOperations.Verify L3VPN On ODL    @{VPN_INSTANCE_IDS}[0]
80     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${REQ_PREFIXLENGTHS}
81     [Teardown]    BuiltIn.Run Keywords    VpnOperations.Dissociate L3VPN From Networks    networkid=${net_id}    vpnid=@{VPN_INSTANCE_IDS}[0]
82     ...    AND    OpenStackOperations.Delete Network    ${NET}
83     ...    AND    Post Test Cleanup    @{VPN_INSTANCE_IDS}[0]
84
85 Verification Of Route Download With Three Vpns In SE And Qbgp With One-One Export Import Route Target
86     [Documentation]    Check the datapath traffic with one-one export import route target with three vpns.
87     Create Multiple L3VPN    @{NETWORKS}[0]    ${3}
88     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
89         BgpOperations.Configure BGP And Add Neighbor On DCGW    ${DCGW_SYSTEM_IP}    ${AS_ID}    ${DCGW_SYSTEM_IP}    ${ODL_SYSTEM_IP}    @{VPN_NAMES}[${index}]
90         ...    @{DCGW_RD}[${index}]    @{LOOPBACK_IPS}[${index}]
91     END
92     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${NETWORKS}
93     ${fib_values} =    BuiltIn.Create List    @{NET_1_VM_IPS}    @{NET_2_VM_IPS}    @{NET_3_VM_IPS}    @{SUBNET_CIDRS}    @{LOOPBACK_IPS}
94     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${fib_values}
95     ${fib1_values} =    BuiltIn.Create List    @{NET_1_VM_IPS}    @{SUBNET_CIDRS}[0]    @{LOOPBACK_IPS}[0]
96     BuiltIn.Wait Until Keyword Succeeds    60s    15s    BgpOperations.Verify Routes On Quagga    ${DCGW_SYSTEM_IP}    @{DCGW_RD}[0]    ${fib1_values}
97     ${fib2_values} =    BuiltIn.Create List    @{NET_2_VM_IPS}    @{SUBNET_CIDRS}[1]    @{LOOPBACK_IPS}[1]
98     BuiltIn.Wait Until Keyword Succeeds    60s    15s    BgpOperations.Verify Routes On Quagga    ${DCGW_SYSTEM_IP}    @{DCGW_RD}[1]    ${fib2_values}
99     ${fib3_values} =    BuiltIn.Create List    @{NET_3_VM_IPS}    @{SUBNET_CIDRS}[2]    @{LOOPBACK_IPS}[2]
100     BuiltIn.Wait Until Keyword Succeeds    60s    15s    BgpOperations.Verify Routes On Quagga    ${DCGW_SYSTEM_IP}    @{DCGW_RD}[2]    ${fib3_values}
101     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
102     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
103     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[0]    ping -c 3 @{NET_1_VM_IPS}[1]
104     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
105     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[1]    @{NET_2_VM_IPS}[0]    ping -c 3 @{NET_2_VM_IPS}[1]
106     BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
107     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[0]    ping -c 3 @{NET_2_VM_IPS}[0]
108     BuiltIn.Should Contain    ${output}    ${NO_PING_REGEXP}
109     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{NET_1_VM_IPS}[0]    ping -c 3 @{NET_2_VM_IPS}[1]
110     BuiltIn.Should Contain    ${output}    ${NO_PING_REGEXP}
111     [Teardown]    Post Test Cleanup    @{VPN_INSTANCE_IDS}
112
113 Verification Of Route Download With Three Vpns In SE And Qbgp With One-Many Export Import Route Target
114     [Documentation]    Check the datapath traffic with one-many export import route target with three vpns.
115     VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[0]    name=@{VPN_NAMES}[0]    rd=@{RDS}[0]    exportrt=${CREATE_RT}    importrt=@{RDS}[0]
116     FOR    ${index}    IN RANGE    1    ${NUM_OF_L3VPN}
117         VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[${index}]    name=@{VPN_NAMES}[${index}]    rd=@{RDS}[${index}]    exportrt=@{RDS}[${index}]    importrt=${RT_LIST_${index}}
118     END
119     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
120         BgpOperations.Configure BGP And Add Neighbor On DCGW    ${DCGW_SYSTEM_IP}    ${AS_ID}    ${DCGW_SYSTEM_IP}    ${ODL_SYSTEM_IP}    @{VPN_NAMES}[${index}]
121         ...    @{DCGW_RD}[${index}]    @{LOOPBACK_IPS}[${index}]
122     END
123     ${networks} =    BuiltIn.Create List    @{NETWORKS}[0]    @{NETWORKS}[1]
124     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${networks}
125     ${fib_values} =    BuiltIn.Create List    @{NET_1_VM_IPS}    @{NET_2_VM_IPS}    @{SUBNET_CIDRS}[0]    @{SUBNET_CIDRS}[1]
126     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${fib_values}
127     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
128     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
129     [Teardown]    Post Test Cleanup    @{VPN_INSTANCE_IDS}
130
131 Verification Of Route Download With Three Vpns In SE And Qbgp With Many-One Export Import Route Target
132     [Documentation]    Check the datapath traffic with many-one export import route target with three vpns.
133     VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[0]    name=@{VPN_NAMES}[0]    rd=@{RDS}[0]    exportrt=@{RDS}[0]    importrt=${CREATE_RT}
134     FOR    ${index}    IN RANGE    1    ${NUM_OF_L3VPN}
135         VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[${index}]    name=@{VPN_NAMES}[${index}]    rd=@{RDS}[${index}]    exportrt=${RT_LIST_${index}}    importrt=@{RDS}[${index}]
136     END
137     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
138         BgpOperations.Configure BGP And Add Neighbor On DCGW    ${DCGW_SYSTEM_IP}    ${AS_ID}    ${DCGW_SYSTEM_IP}    ${ODL_SYSTEM_IP}    @{VPN_NAMES}[${index}]
139         ...    @{DCGW_RD}[${index}]    @{LOOPBACK_IPS}[${index}]
140     END
141     ${networks} =    BuiltIn.Create List    @{NETWORKS}[0]    @{NETWORKS}[1]
142     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${networks}
143     ${fib_values} =    BuiltIn.Create List    @{NET_1_VM_IPS}    @{NET_2_VM_IPS}    @{SUBNET_CIDRS}[0]    @{SUBNET_CIDRS}[1]
144     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${fib_values}
145     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
146     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
147     [Teardown]    Post Test Cleanup    @{VPN_INSTANCE_IDS}
148
149 Verification Of Route Download With Three Vpns In SE And Qbgp With Many-Many Export Import Route Target
150     [Documentation]    Check the datapath traffic with many-many export import route target with three vpns.
151     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
152         VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[${index}]    name=@{VPN_NAMES}[${index}]    rd=@{RDS}[${index}]    exportrt=${CREATE_RT}    importrt=${CREATE_RT}
153     END
154     FOR    ${index}    IN RANGE    0    ${NUM_OF_L3VPN}
155         BgpOperations.Configure BGP And Add Neighbor On DCGW    ${DCGW_SYSTEM_IP}    ${AS_ID}    ${DCGW_SYSTEM_IP}    ${ODL_SYSTEM_IP}    @{VPN_NAMES}[${index}]
156         ...    @{DCGW_RD}[${index}]    @{LOOPBACK_IPS}[${index}]
157     END
158     ${networks} =    BuiltIn.Create List    @{NETWORKS}[0]    @{NETWORKS}[1]
159     VpnOperations.Associate L3VPNs To Networks    ${VPN_INSTANCE_IDS}    ${networks}
160     ${fib_values} =    BuiltIn.Create List    @{NET_1_VM_IPS}    @{NET_2_VM_IPS}    @{SUBNET_CIDRS}[0]    @{SUBNET_CIDRS}[1]
161     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${fib_values}
162     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_1_VM_IPS}
163     VpnOperations.Verify Flows Are Present For L3VPN    ${OS_CMP1_IP}    ${NET_2_VM_IPS}
164
165 *** Keywords ***
166 Suite Setup
167     [Documentation]    Basic setup.
168     VpnOperations.Basic Suite Setup
169     BgpOperations.Start Quagga Processes On ODL    ${ODL_SYSTEM_IP}
170     BgpOperations.Start Quagga Processes On DCGW    ${DCGW_SYSTEM_IP}
171     Create Setup
172     OpenStackOperations.Show Debugs    @{NET_1_VMS}    @{NET_2_VMS}    @{NET_3_VMS}
173     OpenStackOperations.Get Suite Debugs
174
175 Create Setup
176     [Documentation]    Create basic topology
177     Create Neutron Networks
178     Create Neutron Subnets
179     OpenStackOperations.Create Allow All SecurityGroup    ${SECURITY_GROUP[0]}
180     Security Group Rule with Remote SG    ${SECURITY_GROUP[1]}
181     Create Neutron Ports
182     Create Nova VMs
183     VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[0]    name=@{VPN_NAMES}[0]    rd=@{RDS}[0]    exportrt=@{RDS}[0]    importrt=@{RDS}[0]
184     VpnOperations.Verify L3VPN On ODL    @{VPN_INSTANCE_IDS}[0]
185     FOR    ${network}    IN    @{NETWORKS}
186         ${network_id} =    OpenStackOperations.Get Net Id    ${network}
187         VpnOperations.Associate L3VPN To Network    networkid=${network_id}    vpnid=@{VPN_INSTANCE_IDS}[0]
188     END
189     Create BGP Config On ODL
190     Create BGP Config On DCGW
191     Create External Tunnel Endpoint
192
193 Create Neutron Networks
194     [Documentation]    Create required number of networks
195     FOR    ${NET}    IN    @{NETWORKS}
196         OpenStackOperations.Create Network    ${NET}
197     END
198     BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements At URI    ${NETWORK_URL}    ${NETWORKS}
199
200 Create Neutron Subnets
201     [Documentation]    Create required number of subnets for previously created networks
202     ${num_of_networks} =    BuiltIn.Get Length    ${NETWORKS}
203     FOR    ${index}    IN RANGE    0    ${num_of_networks}
204         OpenStackOperations.Create SubNet    @{NETWORKS}[${index}]    @{SUBNETS}[${index}]    @{SUBNET_CIDRS}[${index}]
205     END
206     BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements At URI    ${SUBNETWORK_URL}    ${SUBNETS}
207
208 Create Neutron Ports
209     [Documentation]    Create required number of ports under previously created subnets
210     FOR    ${index}    IN RANGE    0    ${NUM_OF_PORTS_PER_HOST}
211         OpenStackOperations.Create Port    @{NETWORKS}[${index}]    @{PORTS_HOST1}[${index}]    sg=@{SECURITY_GROUP}[0]
212     END
213     FOR    ${index}    IN RANGE    0    ${NUM_OF_PORTS_PER_HOST}
214         OpenStackOperations.Create Port    @{NETWORKS}[${index}]    @{PORTS_HOST2}[${index}]    sg=@{SECURITY_GROUP}[0]
215     END
216     OpenStackOperations.Create Port    @{NETWORKS}[0]    @{PORTS_HOST1}[3]    @{SECURITY_GROUP}[1]
217     OpenStackOperations.Create Port    @{NETWORKS}[1]    @{PORTS_HOST1}[4]    @{SECURITY_GROUP}[1]
218     OpenStackOperations.Create Port    @{NETWORKS}[1]    @{PORTS_HOST2}[3]    @{SECURITY_GROUP}[1]
219     ${PORTS} =    BuiltIn.Create List    @{PORTS_HOST1}    @{PORTS_HOST2}
220     BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements At URI    ${CONFIG_API}/neutron:neutron/ports/    ${PORTS}
221
222 Create Nova VMs
223     [Documentation]    Create Vm instances on compute nodes
224     FOR    ${index}    IN RANGE    0    ${NUM_OF_VMS_PER_HOST}
225         OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS_HOST1}[${index}]    @{VMS_HOST1}[${index}]    ${OS_CMP1_HOSTNAME}    sg=@{SECURITY_GROUP}[0]
226     END
227     FOR    ${index}    IN RANGE    0    ${NUM_OF_VMS_PER_HOST}
228         OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS_HOST2}[${index}]    @{VMS_HOST2}[${index}]    ${OS_CMP2_HOSTNAME}    sg=@{SECURITY_GROUP}[0]
229     END
230     OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS_HOST1}[3]    @{VMS_HOST1}[3]    ${OS_CMP1_HOSTNAME}    sg=@{SECURITY_GROUP}[1]
231     OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS_HOST1}[4]    @{VMS_HOST1}[4]    ${OS_CMP1_HOSTNAME}    sg=@{SECURITY_GROUP}[1]
232     OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS_HOST2}[3]    @{VMS_HOST2}[3]    ${OS_CMP2_HOSTNAME}    sg=@{SECURITY_GROUP}[1]
233     @{NET_1_VM_IPS}    ${NET_1_DHCP_IP} =    OpenStackOperations.Get VM IPs    @{NET_1_VMS}
234     @{NET_2_VM_IPS}    ${NET_2_DHCP_IP} =    OpenStackOperations.Get VM IPs    @{NET_2_VMS}
235     @{NET_3_VM_IPS}    ${NET_3_DHCP_IP} =    OpenStackOperations.Get VM IPs    @{NET_3_VMS}
236     BuiltIn.Set Suite Variable    @{NET_1_VM_IPS}
237     BuiltIn.Set Suite Variable    @{NET_2_VM_IPS}
238     BuiltIn.Set Suite Variable    @{NET_3_VM_IPS}
239     BuiltIn.Should Not Contain    ${NET_1_VM_IPS}    None
240     BuiltIn.Should Not Contain    ${NET_2_VM_IPS}    None
241     BuiltIn.Should Not Contain    ${NET_3_VM_IPS}    None
242     BuiltIn.Should Not Contain    ${NET_1_DHCP_IP}    None
243     BuiltIn.Should Not Contain    ${NET_2_DHCP_IP}    None
244     BuiltIn.Should Not Contain    ${NET_3_DHCP_IP}    None
245
246 Create External Tunnel Endpoint
247     [Documentation]    Create and verify external tunnel endpoint between ODL and GWIP
248     BgpOperations.Create External Tunnel Endpoint Configuration    destIp=${DCGW_SYSTEM_IP}
249     ${output} =    BgpOperations.Get External Tunnel Endpoint Configuration    ${DCGW_SYSTEM_IP}
250     BuiltIn.Should Contain    ${output}    ${DCGW_SYSTEM_IP}
251
252 Create BGP Config On ODL
253     [Documentation]    Configure BGP Config on ODL
254     KarafKeywords.Issue Command On Karaf Console    ${BGP_CONFIG_SERVER_CMD}
255     BgpOperations.Create BGP Configuration On ODL    localas=${AS_ID}    routerid=${ODL_SYSTEM_IP}
256     BgpOperations.AddNeighbor To BGP Configuration On ODL    remoteas=${AS_ID}    neighborAddr=${DCGW_SYSTEM_IP}
257     ${output} =    BgpOperations.Get BGP Configuration On ODL    session
258     BuiltIn.Should Contain    ${output}    ${DCGW_SYSTEM_IP}
259
260 Create BGP Config On DCGW
261     [Documentation]    Configure BGP on DCGW
262     BgpOperations.Configure BGP And Add Neighbor On DCGW    ${DCGW_SYSTEM_IP}    ${AS_ID}    ${DCGW_SYSTEM_IP}    ${ODL_SYSTEM_IP}    @{VPN_NAMES}[0]    @{DCGW_RD}[0]
263     ...    @{LOOPBACK_IPS}[0]
264     ${output} =    BgpOperations.Execute Show Command On Quagga    ${DCGW_SYSTEM_IP}    ${RUN_CONFIG}
265     BuiltIn.Should Contain    ${output}    ${ODL_SYSTEM_IP}
266     ${output} =    BuiltIn.Wait Until Keyword Succeeds    180s    10s    BgpOperations.Verify BGP Neighbor Status On Quagga    ${DCGW_SYSTEM_IP}    ${ODL_SYSTEM_IP}
267
268 Create Multiple L3VPN
269     [Arguments]    ${network}    ${num_of_l3vpns}
270     [Documentation]    Creates multiple L3VPNs and then verify the same
271     FOR    ${index}    IN RANGE    0    ${num_of_l3vpns}
272         BuiltIn.Wait Until Keyword Succeeds    40s    10s    VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_IDS}[${index}]    name=@{VPN_NAMES}[${index}]
273         ...    rd=@{RDS}[${index}]    exportrt=@{RDS}[${index}]    importrt=@{RDS}[${index}]
274         VpnOperations.Verify L3VPN On ODL    @{VPN_INSTANCE_IDS}[${index}]
275     END
276
277 Security Group Rule with Remote SG
278     [Arguments]    ${sec_grp}
279     [Documentation]    Allow all TCP/UDP/ICMP packets for this suite
280     OpenStackOperations.Neutron Security Group Create    ${sec_grp}
281     OpenStackOperations.Neutron Security Group Rule Create    ${sec_grp}    direction=ingress    port_range_max=65535    port_range_min=1    protocol=tcp    remote-group-id=${sec_grp}
282     OpenStackOperations.Neutron Security Group Rule Create    ${sec_grp}    direction=egress    port_range_max=65535    port_range_min=1    protocol=tcp    remote-group-id=${sec_grp}
283     OpenStackOperations.Neutron Security Group Rule Create    ${sec_grp}    direction=ingress    protocol=icmp    remote-group-id=${sec_grp}
284     OpenStackOperations.Neutron Security Group Rule Create    ${sec_grp}    direction=egress    protocol=icmp    remote-group-id=${sec_grp}
285     OpenStackOperations.Neutron Security Group Rule Create    ${sec_grp}    direction=ingress    port_range_max=65535    port_range_min=1    protocol=udp    remote_group_id=${sec_grp}
286     OpenStackOperations.Neutron Security Group Rule Create    ${sec_grp}    direction=egress    port_range_max=65535    port_range_min=1    protocol=udp    remote-group-id=${sec_grp}
287
288 Post Test Cleanup
289     [Arguments]    @{vpn_ids}
290     [Documentation]    Test Case Cleanup.
291     VpnOperations.Delete Multiple L3VPNs    @{vpn_ids}
292     BgpOperations.Delete BGP Config On Quagga    ${DCGW_SYSTEM_IP}    ${AS_ID}