Fix DHCP checks in netvirt CSIT, fail and log
[integration/test.git] / csit / suites / netvirt / Netvirt_Vpnservice / basic_vpnservice.robot
1 *** Settings ***
2 Documentation     Test suite to validate 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       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_Teardown
6 ...               AND    DevstackUtils.Devstack Suite Setup
7 ...               AND    Enable ODL Karaf Log
8 Suite Teardown    Close All Connections
9 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
10 Test Teardown     Get Test Teardown Debugs
11 Library           OperatingSystem
12 Library           RequestsLibrary
13 Resource          ../../../libraries/Utils.robot
14 Resource          ../../../libraries/OpenStackOperations.robot
15 Resource          ../../../libraries/DevstackUtils.robot
16 Resource          ../../../libraries/VpnOperations.robot
17 Resource          ../../../libraries/OVSDB.robot
18 Resource          ../../../libraries/SetupUtils.robot
19 Resource          ../../../variables/Variables.robot
20
21 *** Variables ***
22 @{NETWORKS}       NET10    NET20
23 @{SUBNETS}        SUBNET1    SUBNET2
24 @{SUBNET_CIDR}    10.1.1.0/24    20.1.1.0/24
25 @{PORT_LIST}      PORT11    PORT21    PORT12    PORT22
26 @{VM_INSTANCES_NET10}    VM11    VM21
27 @{VM_INSTANCES_NET20}    VM12    VM22
28 @{ROUTERS}        ROUTER_1    ROUTER_2
29 @{VPN_INSTANCE_ID}    4ae8cd92-48ca-49b5-94e1-b2921a261111    4ae8cd92-48ca-49b5-94e1-b2921a261112    4ae8cd92-48ca-49b5-94e1-b2921a261113
30 @{VPN_NAME}       vpn1    vpn2    vpn3
31 @{CREATE_RD}      ["2200:2"]    ["2300:2"]    ["2400:2"]
32 @{CREATE_EXPORT_RT}    ["2200:2"]    ["2300:2"]    ["2400:2"]
33 @{CREATE_IMPORT_RT}    ["2200:2"]    ["2300:2"]    ["2400:2"]
34 @{EXTRA_NW_IP}    40.1.1.2    50.1.1.2
35 @{EXTRA_NW_SUBNET}    40.1.1.0/24    50.1.1.0/24
36 # Values passed for extra routes
37 ${RT_OPTIONS}     --routes type=dict list=true
38 ${RT_CLEAR}       --routes action=clear
39
40 *** Test Cases ***
41 Create Neutron Networks
42     [Documentation]    Create two networks
43     Create Network    ${NETWORKS[0]}
44     Create Network    ${NETWORKS[1]}
45     ${NET_LIST}    List Networks
46     Log    ${NET_LIST}
47     Should Contain    ${NET_LIST}    ${NETWORKS[0]}
48     Should Contain    ${NET_LIST}    ${NETWORKS[1]}
49     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${CONFIG_API}/neutron:neutron/networks/    ${NETWORKS}
50
51 Create Neutron Subnets
52     [Documentation]    Create two subnets for previously created networks
53     Create SubNet    ${NETWORKS[0]}    ${SUBNETS[0]}    ${SUBNET_CIDR[0]}
54     Create SubNet    ${NETWORKS[1]}    ${SUBNETS[1]}    ${SUBNET_CIDR[1]}
55     ${SUB_LIST}    List Subnets
56     Log    ${SUB_LIST}
57     Should Contain    ${SUB_LIST}    ${SUBNETS[0]}
58     Should Contain    ${SUB_LIST}    ${SUBNETS[1]}
59     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${CONFIG_API}/neutron:neutron/subnets/    ${SUBNETS}
60
61 Add Ssh Allow Rule
62     [Documentation]    Allow all TCP/UDP/ICMP packets for this suite
63     Neutron Security Group Create    sg-vpnservice
64     Neutron Security Group Rule Create    sg-vpnservice    direction=ingress    port_range_max=65535    port_range_min=1    protocol=tcp    remote_ip_prefix=0.0.0.0/0
65     Neutron Security Group Rule Create    sg-vpnservice    direction=egress    port_range_max=65535    port_range_min=1    protocol=tcp    remote_ip_prefix=0.0.0.0/0
66     Neutron Security Group Rule Create    sg-vpnservice    direction=ingress    protocol=icmp    remote_ip_prefix=0.0.0.0/0
67     Neutron Security Group Rule Create    sg-vpnservice    direction=egress    protocol=icmp    remote_ip_prefix=0.0.0.0/0
68     Neutron Security Group Rule Create    sg-vpnservice    direction=ingress    port_range_max=65535    port_range_min=1    protocol=udp    remote_ip_prefix=0.0.0.0/0
69     Neutron Security Group Rule Create    sg-vpnservice    direction=egress    port_range_max=65535    port_range_min=1    protocol=udp    remote_ip_prefix=0.0.0.0/0
70
71 Create Neutron Ports
72     [Documentation]    Create four ports under previously created subnets
73     Create Port    ${NETWORKS[0]}    ${PORT_LIST[0]}    sg=sg-vpnservice
74     Create Port    ${NETWORKS[0]}    ${PORT_LIST[1]}    sg=sg-vpnservice
75     Create Port    ${NETWORKS[1]}    ${PORT_LIST[2]}    sg=sg-vpnservice
76     Create Port    ${NETWORKS[1]}    ${PORT_LIST[3]}    sg=sg-vpnservice
77     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${CONFIG_API}/neutron:neutron/ports/    ${PORT_LIST}
78
79 Create Nova VMs
80     [Documentation]    Create Vm instances on compute node with port
81     Create Vm Instance With Port On Compute Node    ${PORT_LIST[0]}    ${VM_INSTANCES_NET10[0]}    ${OS_COMPUTE_1_IP}    sg=sg-vpnservice
82     Create Vm Instance With Port On Compute Node    ${PORT_LIST[1]}    ${VM_INSTANCES_NET10[1]}    ${OS_COMPUTE_2_IP}    sg=sg-vpnservice
83     Create Vm Instance With Port On Compute Node    ${PORT_LIST[2]}    ${VM_INSTANCES_NET20[0]}    ${OS_COMPUTE_1_IP}    sg=sg-vpnservice
84     Create Vm Instance With Port On Compute Node    ${PORT_LIST[3]}    ${VM_INSTANCES_NET20[1]}    ${OS_COMPUTE_2_IP}    sg=sg-vpnservice
85     ${VM_INSTANCES} =    Create List    @{VM_INSTANCES_NET10}    @{VM_INSTANCES_NET20}
86     : FOR    ${VM}    IN    @{VM_INSTANCES}
87     \    Wait Until Keyword Succeeds    25s    5s    Verify VM Is ACTIVE    ${VM}
88     Log    Check for routes
89     Wait Until Keyword Succeeds    30s    10s    Wait For Routes To Propogate
90     : FOR    ${index}    IN RANGE    1    5
91     \    ${VM_IP_NET10}    ${DHCP_IP1}    Wait Until Keyword Succeeds    30s    10s    Verify VMs Received DHCP Lease
92     \    ...    @{VM_INSTANCES_NET10}
93     \    ${VM_IP_NET20}    ${DHCP_IP2}    Wait Until Keyword Succeeds    30s    10s    Verify VMs Received DHCP Lease
94     \    ...    @{VM_INSTANCES_NET20}
95     \    ${VM_IPS}=    Collections.Combine Lists    ${VM_IP_NET10}    ${VM_IP_NET20}
96     \    ${status}    ${message}    Run Keyword And Ignore Error    List Should Not Contain Value    ${VM_IPS}    None
97     \    Exit For Loop If    '${status}' == 'PASS'
98     \    BuiltIn.Sleep    5s
99     : FOR    ${vm}    IN    @{VM_INSTANCES_NET10}    @{VM_INSTANCES_NET20}
100     \    Write Commands Until Prompt    nova console-log ${vm}    30s
101     Log    ${VM_IP_NET10}
102     Set Suite Variable    ${VM_IP_NET10}
103     Log    ${VM_IP_NET20}
104     Set Suite Variable    ${VM_IP_NET20}
105     Should Not Contain    ${VM_IP_NET10)    None
106     Should Not Contain    ${VM_IP_NET20}    None
107
108 Check ELAN Datapath Traffic Within The Networks
109     [Documentation]    Checks datapath within the same network with different vlans.
110     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ping -c 3 ${VM_IP_NET10[1]}
111     Should Contain    ${output}    64 bytes
112     ${output} =    Execute Command on VM Instance    @{NETWORKS}[1]    ${VM_IP_NET20[0]}    ping -c 3 ${VM_IP_NET20[1]}
113     Should Contain    ${output}    64 bytes
114
115 Create Routers
116     [Documentation]    Create Router
117     Create Router    ${ROUTERS[0]}
118     ${router_output} =    List Router
119     Log    ${router_output}
120     Should Contain    ${router_output}    ${ROUTERS[0]}
121     ${router_list} =    Create List    ${ROUTERS[0]}
122     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${CONFIG_API}/neutron:neutron/routers/    ${router_list}
123
124 Add Interfaces To Router
125     [Documentation]    Add Interfaces
126     ${devstack_conn_id} =    Get ControlNode Connection
127     : FOR    ${INTERFACE}    IN    @{SUBNETS}
128     \    Add Router Interface    ${ROUTERS[0]}    ${INTERFACE}
129     ${interface_output} =    Show Router Interface    ${ROUTERS[0]}
130     : FOR    ${INTERFACE}    IN    @{SUBNETS}
131     \    ${subnet_id} =    Get Subnet Id    ${INTERFACE}    ${devstack_conn_id}
132     \    Should Contain    ${interface_output}    ${subnet_id}
133
134 Check L3_Datapath Traffic Across Networks With Router
135     [Documentation]    Datapath test across the networks using router for L3.
136     Log    Verification of FIB Entries and Flow
137     ${vm_instances} =    Create List    @{VM_IP_NET10}    @{VM_IP_NET20}
138     Wait Until Keyword Succeeds    30s    5s    Check For Elements At URI    ${CONFIG_API}/odl-fib:fibEntries/    ${vm_instances}
139     Wait Until Keyword Succeeds    30s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_1_IP}    ${VM_IP_NET10}
140     Wait Until Keyword Succeeds    30s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_1_IP}    ${VM_IP_NET20}
141     Log    L3 Datapath test across the networks using router
142     ${dst_ip_list} =    Create List    ${VM_IP_NET10[1]}    @{VM_IP_NET20}
143     Log    ${dst_ip_list}
144     Test Operations From Vm Instance    ${NETWORKS[0]}    ${VM_IP_NET10[1]}    ${dst_ip_list}
145     ${dst_ip_list} =    Create List    ${VM_IP_NET20[1]}    @{VM_IP_NET10}
146     Log    ${dst_ip_list}
147     Test Operations From Vm Instance    ${NETWORKS[1]}    ${VM_IP_NET20[0]}    ${dst_ip_list}
148
149 Add Multiple Extra Routes And Check Datapath Before L3VPN Creation
150     [Documentation]    Add multiple extra routes and check data path before L3VPN creation
151     Log    "Adding extra one route to VM"
152     ${CONFIG_EXTRA_ROUTE_IP1} =    Catenate    sudo ifconfig eth0:1 @{EXTRA_NW_IP}[0] netmask 255.255.255.0 up
153     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ${CONFIG_EXTRA_ROUTE_IP1}
154     ${CONFIG_EXTRA_ROUTE_IP2} =    Catenate    sudo ifconfig eth0:2 @{EXTRA_NW_IP}[1] netmask 255.255.255.0 up
155     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ${CONFIG_EXTRA_ROUTE_IP2}
156     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ifconfig
157     ${EXT_RT1} =    Set Variable    destination=40.1.1.0/24,nexthop=${VM_IP_NET10[0]}
158     ${EXT_RT2} =    Set Variable    destination=50.1.1.0/24,nexthop=${VM_IP_NET10[0]}
159     ${cmd} =    Catenate    ${RT_OPTIONS}    ${EXT_RT1}    ${EXT_RT2}
160     Update Router    @{ROUTERS}[0]    ${cmd}
161     Show Router    @{ROUTERS}[0]    -D
162     Log    "Verify FIB table"
163     ${vm_instances} =    Create List    @{EXTRA_NW_SUBNET}
164     Wait Until Keyword Succeeds    30s    5s    Check For Elements At URI    ${CONFIG_API}/odl-fib:fibEntries/    ${vm_instances}
165     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping -c 3 @{EXTRA_NW_IP}[1]
166     Should Contain    ${output}    64 bytes
167     ${output} =    Execute Command on VM Instance    @{NETWORKS}[1]    ${VM_IP_NET20[1]}    ping -c 3 @{EXTRA_NW_IP}[1]
168     Should Contain    ${output}    64 bytes
169     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping -c 3 @{EXTRA_NW_IP}[0]
170     Should Contain    ${output}    64 bytes
171
172 Delete Extra Route
173     [Documentation]    Delete the extra routes
174     Update Router    @{ROUTERS}[0]    ${RT_CLEAR}
175     Show Router    @{ROUTERS}[0]    -D
176
177 Delete And Recreate Extra Route
178     [Documentation]    Recreate multiple extra route and check data path before L3VPN creation
179     Log    "Adding extra route to VM"
180     ${CONFIG_EXTRA_ROUTE_IP1} =    Catenate    sudo ifconfig eth0:1 @{EXTRA_NW_IP}[0] netmask 255.255.255.0 up
181     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ${CONFIG_EXTRA_ROUTE_IP1}
182     ${EXT_RT1} =    Set Variable    destination=40.1.1.0/24,nexthop=${VM_IP_NET10[0]}
183     ${cmd} =    Catenate    ${RT_OPTIONS}    ${EXT_RT1}
184     Update Router    @{ROUTERS}[0]    ${cmd}
185     Show Router    @{ROUTERS}[0]    -D
186     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping -c 3 @{EXTRA_NW_IP}[0]
187     Should Contain    ${output}    64 bytes
188     # clear off extra-routes before the next set of tests
189     [Teardown]    Run Keywords    Update Router    @{ROUTERS}[0]    ${RT_CLEAR}
190     ...    AND    Show Router    @{ROUTERS}[0]    -D
191     ...    AND    Get Test Teardown Debugs
192
193 Create L3VPN
194     [Documentation]    Creates L3VPN and verify the same
195     ${devstack_conn_id} =    Get ControlNode Connection
196     Switch Connection    ${devstack_conn_id}
197     ${net_id} =    Get Net Id    @{NETWORKS}[0]    ${devstack_conn_id}
198     ${tenant_id} =    Get Tenant ID From Network    ${net_id}
199     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[0]}    name=${VPN_NAME[0]}    rd=${CREATE_RD[0]}    exportrt=${CREATE_EXPORT_RT[0]}    importrt=${CREATE_IMPORT_RT[0]}    tenantid=${tenant_id}
200     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
201     Should Contain    ${resp}    ${VPN_INSTANCE_ID[0]}
202
203 Associate L3VPN To Routers
204     [Documentation]    Associating router to L3VPN
205     ${devstack_conn_id}=    Get ControlNode Connection
206     ${router_id}=    Get Router Id    ${ROUTERS[0]}    ${devstack_conn_id}
207     Associate VPN to Router    routerid=${router_id}    vpnid=${VPN_INSTANCE_ID[0]}
208     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
209     Should Contain    ${resp}    ${router_id}
210
211 Verify L3VPN Datapath With Router Association
212     [Documentation]    Datapath test across the networks using L3VPN with router association.
213     Log    Verify VPN interfaces, FIB entries and Flow table
214     ${vm_instances} =    Create List    @{VM_IP_NET10}    @{VM_IP_NET20}
215     Wait Until Keyword Succeeds    30s    5s    Check For Elements At URI    ${CONFIG_API}/l3vpn:vpn-interfaces/    ${vm_instances}
216     ${RD} =    Strip String    ${CREATE_RD[0]}    characters="[]
217     Log    ${RD}
218     Wait Until Keyword Succeeds    60s    5s    Check For Elements At URI    ${CONFIG_API}/odl-fib:fibEntries/vrfTables/${RD}/    ${vm_instances}
219     Wait Until Keyword Succeeds    60s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_1_IP}    ${vm_instances}
220     Wait Until Keyword Succeeds    60s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_2_IP}    ${vm_instances}
221     Log    Check datapath from network1 to network2
222     ${dst_ip_list} =    Create List    @{VM_IP_NET10}[1]    @{VM_IP_NET20}
223     Log    ${dst_ip_list}
224     Test Operations From Vm Instance    ${NETWORKS[0]}    @{VM_IP_NET10}[0]    ${dst_ip_list}
225     Log    Check datapath from network2 to network1
226     ${dst_ip_list} =    Create List    @{VM_IP_NET20}[1]    @{VM_IP_NET10}
227     Log    ${dst_ip_list}
228     Test Operations From Vm Instance    ${NETWORKS[1]}    @{VM_IP_NET20}[0]    ${dst_ip_list}
229
230 Dissociate L3VPN From Routers
231     [Documentation]    Dissociating router from L3VPN
232     ${devstack_conn_id}=    Get ControlNode Connection
233     ${router_id}=    Get Router Id    ${ROUTERS[0]}    ${devstack_conn_id}
234     Dissociate VPN to Router    routerid=${router_id}    vpnid=${VPN_INSTANCE_ID[0]}
235     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
236     Should Not Contain    ${resp}    ${router_id}
237
238 Delete Router And Router Interfaces With L3VPN
239     [Documentation]    Delete Router and Interface to the subnets with L3VPN assciate
240     # Asscoiate router with L3VPN
241     ${devstack_conn_id} =    Get ControlNode Connection
242     ${router_id}=    Get Router Id    ${ROUTERS[0]}    ${devstack_conn_id}
243     Associate VPN to Router    routerid=${router_id}    vpnid=${VPN_INSTANCE_ID[0]}
244     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
245     Should Contain    ${resp}    ${router_id}
246     #Delete Interface
247     : FOR    ${INTERFACE}    IN    @{SUBNETS}
248     \    Remove Interface    ${ROUTERS[0]}    ${INTERFACE}
249     ${interface_output} =    Show Router Interface    ${ROUTERS[0]}
250     : FOR    ${INTERFACE}    IN    @{SUBNETS}
251     \    ${subnet_id} =    Get Subnet Id    ${INTERFACE}    ${devstack_conn_id}
252     \    Should Not Contain    ${interface_output}    ${subnet_id}
253     # Delete Router and Interface to the subnets.
254     Delete Router    ${ROUTERS[0]}
255     ${router_output} =    List Router
256     Log    ${router_output}
257     Should Not Contain    ${router_output}    ${ROUTERS[0]}
258     ${router_list} =    Create List    ${ROUTERS[0]}
259     Wait Until Keyword Succeeds    3s    1s    Check For Elements Not At URI    ${CONFIG_API}/neutron:neutron/routers/    ${router_list}
260     # Verify Router Entry removed from L3VPN
261     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
262     Should Not Contain    ${resp}    ${router_id}
263
264 Delete Router With NonExistentRouter Name
265     [Documentation]    Delete router with nonExistentRouter name
266     ${devstack_conn_id}=    Get ControlNode Connection
267     Switch Connection    ${devstack_conn_id}
268     ${output} =    Write Commands Until Prompt    neutron router-delete nonExistentRouter    30s
269     Close Connection
270     Should Match Regexp    ${output}    Unable to find router with name or id 'nonExistentRouter'|Unable to find router\\(s\\) with id\\(s\\) 'nonExistentRouter'
271
272 Associate L3VPN To Networks
273     [Documentation]    Associates L3VPN to networks and verify
274     ${devstack_conn_id} =    Get ControlNode Connection
275     ${network1_id} =    Get Net Id    ${NETWORKS[0]}    ${devstack_conn_id}
276     ${network2_id} =    Get Net Id    ${NETWORKS[1]}    ${devstack_conn_id}
277     Associate L3VPN To Network    networkid=${network1_id}    vpnid=${VPN_INSTANCE_ID[0]}
278     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
279     Should Contain    ${resp}    ${network1_id}
280     Associate L3VPN To Network    networkid=${network2_id}    vpnid=${VPN_INSTANCE_ID[0]}
281     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
282     Should Contain    ${resp}    ${network2_id}
283
284 Dissociate L3VPN From Networks
285     [Documentation]    Dissociate L3VPN from networks
286     ${devstack_conn_id} =    Get ControlNode Connection
287     ${network1_id} =    Get Net Id    ${NETWORKS[0]}    ${devstack_conn_id}
288     ${network2_id} =    Get Net Id    ${NETWORKS[1]}    ${devstack_conn_id}
289     Dissociate L3VPN From Networks    networkid=${network1_id}    vpnid=${VPN_INSTANCE_ID[0]}
290     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
291     Should Not Contain    ${resp}    ${network1_id}
292     Dissociate L3VPN From Networks    networkid=${network2_id}    vpnid=${VPN_INSTANCE_ID[0]}
293     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
294     Should Not Contain    ${resp}    ${network2_id}
295
296 Delete L3VPN
297     [Documentation]    Delete L3VPN
298     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
299
300 Create Multiple L3VPN
301     [Documentation]    Creates three L3VPNs and then verify the same
302     ${devstack_conn_id} =    Get ControlNode Connection
303     Switch Connection    ${devstack_conn_id}
304     ${net_id} =    Get Net Id    @{NETWORKS}[0]    ${devstack_conn_id}
305     ${tenant_id} =    Get Tenant ID From Network    ${net_id}
306     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[0]}    name=${VPN_NAME[0]}    rd=${CREATE_RD[0]}    exportrt=${CREATE_EXPORT_RT[0]}    importrt=${CREATE_IMPORT_RT[0]}    tenantid=${tenant_id}
307     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[1]}    name=${VPN_NAME[1]}    rd=${CREATE_RD[1]}    exportrt=${CREATE_EXPORT_RT[1]}    importrt=${CREATE_IMPORT_RT[1]}    tenantid=${tenant_id}
308     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[2]}    name=${VPN_NAME[2]}    rd=${CREATE_RD[2]}    exportrt=${CREATE_EXPORT_RT[2]}    importrt=${CREATE_IMPORT_RT[2]}    tenantid=${tenant_id}
309     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
310     Should Contain    ${resp}    ${VPN_INSTANCE_ID[0]}
311     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[1]}
312     Should Contain    ${resp}    ${VPN_INSTANCE_ID[1]}
313     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[2]}
314     Should Contain    ${resp}    ${VPN_INSTANCE_ID[2]}
315
316 Delete Multiple L3VPN
317     [Documentation]    Delete three L3VPNs created using Multiple L3VPN Test
318     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
319     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[1]}
320     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[2]}
321
322 Check Datapath Traffic Across Networks With L3VPN
323     [Documentation]    Datapath Test Across the networks with VPN.
324     [Tags]    exclude
325     Log    This test will be added in the next patch
326
327 Delete Vm Instances
328     [Documentation]    Delete Vm instances in the given Instance List
329     ${VM_INSTANCES} =    Create List    @{VM_INSTANCES_NET10}    @{VM_INSTANCES_NET20}
330     : FOR    ${VmInstance}    IN    @{VM_INSTANCES}
331     \    Delete Vm Instance    ${VmInstance}
332
333 Delete Neutron Ports
334     [Documentation]    Delete Neutron Ports in the given Port List.
335     : FOR    ${Port}    IN    @{PORT_LIST}
336     \    Delete Port    ${Port}
337
338 Delete Sub Networks
339     [Documentation]    Delete Sub Nets in the given Subnet List.
340     : FOR    ${Subnet}    IN    @{SUBNETS}
341     \    Delete SubNet    ${Subnet}
342
343 Delete Networks
344     [Documentation]    Delete Networks in the given Net List
345     : FOR    ${Network}    IN    @{NETWORKS}
346     \    Delete Network    ${Network}
347
348 Create ITM Tunnel
349     [Documentation]    Checks that vxlan tunnels are created successfully. This testcase expects that the two DPNs are in the same network hence populates the gateway accordingly.
350     ${node_1_dpid} =    Get DPID    ${OS_COMPUTE_1_IP}
351     ${node_2_dpid} =    Get DPID    ${OS_COMPUTE_2_IP}
352     ${node_1_adapter} =    Get Ethernet Adapter    ${OS_COMPUTE_1_IP}
353     ${node_2_adapter} =    Get Ethernet Adapter    ${OS_COMPUTE_2_IP}
354     ${subnet} =    Get Subnet    ${OS_COMPUTE_1_IP}
355     ${gateway} =    Get Default Gateway    ${OS_COMPUTE_1_IP}
356     ITM Create Tunnel    tunneltype=vxlan    vlanid=0    prefix=${subnet}    gateway=${gateway}    ipaddress1=${OS_COMPUTE_1_IP}    dpnid1=${node_1_dpid}
357     ...    portname1=${node_1_adapter}    ipaddress2=${OS_COMPUTE_2_IP}    dpnid2=${node_2_dpid}    portname2=${node_2_adapter}
358     Get DumpFlows And Ovsconfig    ${OS_COMPUTE_1_IP}
359     Get DumpFlows And Ovsconfig    ${OS_COMPUTE_2_IP}
360     ${output} =    ITM Get Tunnels
361     Log    ${output}
362
363 Delete ITM Tunnel
364     [Documentation]    Delete tunnels with specific transport-zone.
365     ITM Delete Tunnel    TZA
366
367 *** Keywords ***
368 Basic Vpnservice Suite Setup
369     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
370
371 Basic Vpnservice Suite Teardown
372     Delete All Sessions
373
374 Wait For Routes To Propogate
375     ${devstack_conn_id} =    Get ControlNode Connection
376     Switch Connection    ${devstack_conn_id}
377     ${net_id} =    Get Net Id    @{NETWORKS}[0]    ${devstack_conn_id}
378     ${output} =    Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ip route    ]>
379     Should Contain    ${output}    @{SUBNET_CIDR}[0]
380     ${net_id} =    Get Net Id    @{NETWORKS}[1]    ${devstack_conn_id}
381     ${output} =    Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ip route    ]>
382     Should Contain    ${output}    @{SUBNET_CIDR}[1]
383
384 Enable ODL Karaf Log
385     [Documentation]    Uses log:set TRACE org.opendaylight.netvirt to enable log
386     Log    "Enabled ODL Karaf log for org.opendaylight.netvirt"
387     ${output}=    Issue Command On Karaf Console    log:set TRACE org.opendaylight.netvirt
388     Log    ${output}