Remove extra Logging in VPNService suites
[integration/test.git] / csit / suites / netvirt / Netvirt_Vpnservice / 03_basic_ipv6_vpnservice.robot
1 *** Settings ***
2 Documentation     Test suite to validate IPv6 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    Get OvsDebugInfo
6 ...               AND    Basic Vpnservice Suite Setup
7 ...               AND    Get OvsDebugInfo
8 Suite Teardown    BuiltIn.Run Keywords    Basic Vpnservice Suite Teardown
9 ...               AND    Get OvsDebugInfo
10 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
11 Test Teardown     Get Test Teardown Debugs
12 Library           OperatingSystem
13 Library           RequestsLibrary
14 Resource          ../../../libraries/Utils.robot
15 Resource          ../../../libraries/OpenStackOperations.robot
16 Resource          ../../../libraries/DevstackUtils.robot
17 Resource          ../../../libraries/VpnOperations.robot
18 Resource          ../../../libraries/OVSDB.robot
19 Resource          ../../../libraries/SetupUtils.robot
20 Resource          ../../../libraries/Tcpdump.robot
21 Resource          ../../../variables/Variables.robot
22 Resource          ../../../variables/netvirt/Variables.robot
23
24 *** Variables ***
25 @{NETWORKS}       NET1_IPV6    NET2_IPV6
26 @{SUBNETS}        SUBNET1_IPV6    SUBNET2_IPV6
27 @{SUBNETS_CIDR}    2001:db8:0:2::/64    2001:db8:0:3::/64
28 @{PORT_LIST}      PORT11_IPV6    PORT21_IPV6    PORT12_IPV6    PORT22_IPV6
29 @{VM_INSTANCES_NET10}    VM11_IPV6    VM21_IPV6
30 @{VM_INSTANCES_NET20}    VM12_IPV6    VM22_IPV6
31 @{ROUTERS}        ROUTER_1_IPV6
32 @{EXTRA_NW_IP}    2001:db9:cafe:d::10    2001:db9:abcd:d::20
33 @{EXTRA_NW_SUBNET}    2001:db9:cafe:d::/64    2001:db9:abcd:d::/64
34 ${SECURITY_GROUP}    sg-ipv6-vpnservice
35 ${UPDATE_NETWORK}    UpdateNetwork
36 ${UPDATE_SUBNET}    UpdateSubnet
37 ${UPDATE_PORT}    UpdatePort
38
39 *** Test Cases ***
40 Create Neutron Networks
41     [Documentation]    Create two networks
42     Create Network    ${NETWORKS[0]}
43     Create Network    ${NETWORKS[1]}
44     ${NET_LIST}    List Networks
45     Should Contain    ${NET_LIST}    ${NETWORKS[0]}
46     Should Contain    ${NET_LIST}    ${NETWORKS[1]}
47     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${NETWORK_URL}    ${NETWORKS}
48     Update Network    ${NETWORKS[0]}    additional_args=--description ${UPDATE_NETWORK}
49     ${output} =    Show Network    ${NETWORKS[0]}
50     Should Contain    ${output}    ${UPDATE_NETWORK}
51
52 Create Neutron Subnets
53     [Documentation]    Create two subnets for previously created networks
54     ${net1_additional_args}=    Catenate    --ip-version=6 --ipv6-address-mode=slaac --ipv6-ra-mode=slaac ${NET1_IPV6_ADDR_POOL}
55     ${net2_additional_args}=    Catenate    --ip-version=6 --ipv6-address-mode=slaac --ipv6-ra-mode=slaac ${NET2_IPV6_ADDR_POOL}
56     Create SubNet    ${NETWORKS[0]}    ${SUBNETS[0]}    ${SUBNETS_CIDR[0]}    ${net1_additional_args}
57     Create SubNet    ${NETWORKS[1]}    ${SUBNETS[1]}    ${SUBNETS_CIDR[1]}    ${net2_additional_args}
58     ${SUB_LIST}    List Subnets
59     Should Contain    ${SUB_LIST}    ${SUBNETS[0]}
60     Should Contain    ${SUB_LIST}    ${SUBNETS[1]}
61     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${SUBNETWORK_URL}    ${SUBNETS}
62     Update SubNet    ${SUBNETS[0]}    additional_args=--description ${UPDATE_SUBNET}
63     ${output} =    Show SubNet    ${SUBNETS[0]}
64     Should Contain    ${output}    ${UPDATE_SUBNET}
65
66 Create Routers
67     [Documentation]    Create Router
68     Create Router    ${ROUTERS[0]}
69     ${router_output} =    List Router
70     Should Contain    ${router_output}    ${ROUTERS[0]}
71     ${router_list} =    Create List    ${ROUTERS[0]}
72     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${ROUTER_URL}    ${router_list}
73
74 Add Interfaces To Router
75     [Documentation]    Add Interfaces
76     : FOR    ${INTERFACE}    IN    @{SUBNETS}
77     \    Add Router Interface    ${ROUTERS[0]}    ${INTERFACE}
78     ${interface_output} =    Show Router Interface    ${ROUTERS[0]}
79     : FOR    ${INTERFACE}    IN    @{SUBNETS}
80     \    ${subnet_id} =    Get Subnet Id    ${INTERFACE}    ${devstack_conn_id}
81     \    Should Contain    ${interface_output}    ${subnet_id}
82     ${GWMAC_ADDRS}    ${GWIP_ADDRS} =    Get Gateway MAC And IP Address    ${ROUTERS[0]}
83     Set Suite Variable    ${GWMAC_ADDRS}
84     Set Suite Variable    ${GWIP_ADDRS}
85
86 Add Ssh V6 Allow Rule
87     [Documentation]    Allow all TCP/UDP/ICMP6 packets for this suite
88     OpenStackOperations.Create Allow All SecurityGroup    ${SECURITY_GROUP}    IPv6
89
90 Create Neutron Ports
91     [Documentation]    Create four ports under previously created subnets
92     ${allowed_address_pairs_args}=    Set Variable If    '${OPENSTACK_BRANCH}'=='stable/newton'    --allowed-address ip_address=${EXTRA_NW_SUBNET[0]} --allowed-address ip_address=${EXTRA_NW_SUBNET[1]}    --allowed-address ip-address=${EXTRA_NW_SUBNET[0]} --allowed-address ip-address=${EXTRA_NW_SUBNET[1]}
93     Create Port    ${NETWORKS[0]}    ${PORT_LIST[0]}    sg=${SECURITY_GROUP}    additional_args=${allowed_address_pairs_args}
94     Create Port    ${NETWORKS[0]}    ${PORT_LIST[1]}    sg=${SECURITY_GROUP}    additional_args=${allowed_address_pairs_args}
95     Create Port    ${NETWORKS[1]}    ${PORT_LIST[2]}    sg=${SECURITY_GROUP}    additional_args=${allowed_address_pairs_args}
96     Create Port    ${NETWORKS[1]}    ${PORT_LIST[3]}    sg=${SECURITY_GROUP}    additional_args=${allowed_address_pairs_args}
97     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${PORT_URL}    ${PORT_LIST}
98     Update Port    ${PORT_LIST[0]}    additional_args=--name ${UPDATE_PORT}
99     ${output} =    Show Port    ${UPDATE_PORT}
100     Should Contain    ${output}    ${UPDATE_PORT}
101     Update Port    ${UPDATE_PORT}    additional_args=--name ${PORT_LIST[0]}
102
103 Create Nova VMs
104     [Documentation]    Create Vm instances on compute node with port
105     Create Vm Instance With Port On Compute Node    ${PORT_LIST[0]}    ${VM_INSTANCES_NET10[0]}    ${OS_COMPUTE_1_IP}    sg=${SECURITY_GROUP}
106     Create Vm Instance With Port On Compute Node    ${PORT_LIST[1]}    ${VM_INSTANCES_NET10[1]}    ${OS_COMPUTE_2_IP}    sg=${SECURITY_GROUP}
107     Create Vm Instance With Port On Compute Node    ${PORT_LIST[2]}    ${VM_INSTANCES_NET20[0]}    ${OS_COMPUTE_1_IP}    sg=${SECURITY_GROUP}
108     Create Vm Instance With Port On Compute Node    ${PORT_LIST[3]}    ${VM_INSTANCES_NET20[1]}    ${OS_COMPUTE_2_IP}    sg=${SECURITY_GROUP}
109     ${VM_INSTANCES}=    Create List    @{VM_INSTANCES_NET10}    @{VM_INSTANCES_NET20}
110     : FOR    ${VM}    IN    @{VM_INSTANCES}
111     \    Poll VM Is ACTIVE    ${VM}
112     Wait Until Keyword Succeeds    30s    10s    Wait For Routes To Propogate    ${NETWORKS}    ${SUBNETS_CIDR}
113     ${prefix_net10}=    Replace String    ${SUBNETS_CIDR[0]}    ::/64    (:[a-f0-9]{,4}){,4}
114     ${status}    ${message}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    5x    60s    Collect VM IPv6 SLAAC Addresses
115     ...    true    ${prefix_net10}    @{VM_INSTANCES_NET10}
116     ${prefix_net20}=    Replace String    ${SUBNETS_CIDR[1]}    ::/64    (:[a-f0-9]{,4}){,4}
117     ${status}    ${message}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    5x    60s    Collect VM IPv6 SLAAC Addresses
118     ...    true    ${prefix_net20}    @{VM_INSTANCES_NET20}
119     ${VM_IP_NET10}=    Collect VM IPv6 SLAAC Addresses    false    ${prefix_net10}    @{VM_INSTANCES_NET10}
120     ${VM_IP_NET20}=    Collect VM IPv6 SLAAC Addresses    false    ${prefix_net20}    @{VM_INSTANCES_NET20}
121     ${VM_INSTANCES}=    Collections.Combine Lists    ${VM_INSTANCES_NET10}    ${VM_INSTANCES_NET20}
122     ${VM_IPS}=    Collections.Combine Lists    ${VM_IP_NET10}    ${VM_IP_NET20}
123     Log Many    Obtained IPs    ${VM_IPS}
124     ${LOOP_COUNT}    Get Length    ${VM_INSTANCES_NET10}
125     : FOR    ${index}    IN RANGE    0    ${LOOP_COUNT}
126     \    ${status}    ${message}    Run Keyword And Ignore Error    Should Not Contain    @{VM_IPS}[${index}]    None
127     \    Run Keyword If    '${status}' == 'FAIL'    Write Commands Until Prompt    openstack console log show @{VM_INSTANCES}[${index}]    30s
128     Log    ${VM_IP_NET10}
129     Set Suite Variable    ${VM_IP_NET10}
130     Log    ${VM_IP_NET20}
131     Set Suite Variable    ${VM_IP_NET20}
132     Should Not Contain    ${VM_IP_NET10}    None
133     Should Not Contain    ${VM_IP_NET20}    None
134     [Teardown]    Run Keywords    Show Debugs    @{VM_INSTANCES_NET10}    @{VM_INSTANCES_NET20}
135     ...    AND    Get Test Teardown Debugs
136
137 Check ELAN Datapath Traffic Within The Networks
138     [Documentation]    Checks datapath within the same network with different vlans.
139     ${output}=    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ping6 -c 3 ${VM_IP_NET10[1]}
140     Should Contain    ${output}    64 bytes
141     ${output}=    Execute Command on VM Instance    @{NETWORKS}[1]    ${VM_IP_NET20[0]}    ping6 -c 3 ${VM_IP_NET20[1]}
142     Should Contain    ${output}    64 bytes
143
144 Check L3_Datapath Traffic Across Networks With Router
145     [Documentation]    Datapath test across the networks using router for L3.
146     Log    Verification of FIB Entries and Flow
147     ${cn1_conn_id} =    Start Packet Capture on Node    ${OS_COMPUTE_1_IP}    file_Name=tcpDumpCN1
148     ${cn2_conn_id} =    Start Packet Capture on Node    ${OS_COMPUTE_2_IP}    file_Name=tcpDumpCN2
149     ${os_conn_id} =    Start Packet Capture on Node    ${OS_CONTROL_NODE_IP}    file_Name=tcpDumpOS
150     ${vm_instances} =    Create List    @{VM_IP_NET10}    @{VM_IP_NET20}
151     Wait Until Keyword Succeeds    30s    5s    Check For Elements At URI    ${FIB_ENTRY_URL}    ${vm_instances}
152     Wait Until Keyword Succeeds    30s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_1_IP}    ${VM_IP_NET10}
153     Wait Until Keyword Succeeds    30s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_1_IP}    ${VM_IP_NET20}
154     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Entry On ODL    ${GWMAC_ADDRS}
155     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Flow Entry On Flow Table    ${OS_COMPUTE_1_IP}
156     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Flow Entry On Flow Table    ${OS_COMPUTE_2_IP}
157     Log    L3 Datapath test across the networks using router
158     ${dst_ip_list} =    Create List    ${VM_IP_NET10[1]}    @{VM_IP_NET20}
159     Log Many    Source IP    ${VM_IP_NET10[1]}
160     Test Operations From Vm Instance    ${NETWORKS[0]}    ${VM_IP_NET10[0]}    ${dst_ip_list}
161     ${dst_ip_list} =    Create List    ${VM_IP_NET20[1]}    @{VM_IP_NET10}
162     Log Many    Source IP    ${VM_IP_NET20[0]}
163     Test Operations From Vm Instance    ${NETWORKS[1]}    ${VM_IP_NET20[0]}    ${dst_ip_list}
164     [Teardown]    Test Teardown With Tcpdump Stop    ${cn1_conn_id}    ${cn2_conn_id}    ${os_conn_id}
165
166 Add Multiple Extra Routes And Check Datapath Before L3VPN Creation
167     [Documentation]    Add multiple extra routes and check data path before L3VPN creation
168     Log    "Adding extra one route to VM"
169     ${CONFIG_EXTRA_ROUTE_IP1} =    Catenate    sudo ip -6 addr add ${EXTRA_NW_IP[0]}/64 dev eth0
170     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ${CONFIG_EXTRA_ROUTE_IP1}
171     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ip -6 a
172     ${CONFIG_EXTRA_ROUTE_IP2} =    Catenate    sudo ip -6 addr add ${EXTRA_NW_IP[1]}/64 dev eth0
173     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ${CONFIG_EXTRA_ROUTE_IP2}
174     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ip -6 a
175     ${EXT_RT1} =    Set Variable    destination=${EXTRA_NW_SUBNET[0]},gateway=${VM_IP_NET10[0]}
176     ${EXT_RT2} =    Set Variable    destination=${EXTRA_NW_SUBNET[1]},gateway=${VM_IP_NET10[0]}
177     ${cmd} =    Catenate    ${RT_OPTIONS}    ${EXT_RT1}    ${RT_OPTIONS}    ${EXT_RT2}
178     Update Router    @{ROUTERS}[0]    ${cmd}
179     Show Router    @{ROUTERS}[0]    -D
180     Log    "Verify FIB table"
181     ${vm_instances} =    Create List    @{EXTRA_NW_SUBNET}
182     Wait Until Keyword Succeeds    30s    5s    Check For Elements At URI    ${FIB_ENTRY_URL}    ${vm_instances}
183     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping6 -c 3 @{EXTRA_NW_IP}[1]
184     Should Contain    ${output}    64 bytes
185     ${output} =    Execute Command on VM Instance    @{NETWORKS}[1]    ${VM_IP_NET20[1]}    ping6 -c 3 @{EXTRA_NW_IP}[1]
186     Should Contain    ${output}    64 bytes
187     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping6 -c 3 @{EXTRA_NW_IP}[0]
188     Should Contain    ${output}    64 bytes
189
190 Delete Extra Route
191     [Documentation]    Delete the extra routes
192     Update Router    @{ROUTERS}[0]    ${RT_CLEAR}
193     Show Router    @{ROUTERS}[0]    -D
194
195 Delete And Recreate Extra Route
196     [Documentation]    Recreate multiple extra route and check data path before L3VPN creation
197     Log    "Adding extra route to VM"
198     ${CONFIG_EXTRA_ROUTE_IP1} =    Catenate    sudo ip -6 addr add ${EXTRA_NW_IP[1]}/64 dev eth0
199     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[0]}    ${CONFIG_EXTRA_ROUTE_IP1}
200     ${EXT_RT1} =    Set Variable    destination=${EXTRA_NW_SUBNET[0]},gateway=${VM_IP_NET10[0]}
201     ${cmd} =    Catenate    ${RT_OPTIONS}    ${EXT_RT1}
202     Update Router    @{ROUTERS}[0]    ${cmd}
203     Show Router    @{ROUTERS}[0]    -D
204     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping6 -c 3 @{EXTRA_NW_IP}[0]
205     Should Contain    ${output}    64 bytes
206     # clear off extra-routes before the next set of tests
207     [Teardown]    Run Keywords    Update Router    @{ROUTERS}[0]    ${RT_CLEAR}
208     ...    AND    Show Router    @{ROUTERS}[0]    -D
209     ...    AND    Get Test Teardown Debugs
210
211 Create L3VPN
212     [Documentation]    Creates L3VPN and verify the same
213     ${net_id} =    Get Net Id    @{NETWORKS}[0]    ${devstack_conn_id}
214     ${tenant_id} =    Get Tenant ID From Network    ${net_id}
215     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[0]}    name=${VPN_NAME[0]}    rd=@{RDS}[0]    exportrt=@{RDS}[0]    importrt=@{RDS}[0]    tenantid=${tenant_id}
216     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
217     Should Contain    ${resp}    ${VPN_INSTANCE_ID[0]}
218
219 Associate L3VPN To Routers
220     [Documentation]    Associating router to L3VPN
221     ${router_id}=    Get Router Id    ${ROUTERS[0]}    ${devstack_conn_id}
222     Associate VPN to Router    routerid=${router_id}    vpnid=${VPN_INSTANCE_ID[0]}
223     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
224     Should Contain    ${resp}    ${router_id}
225
226 Verify L3VPN Datapath With Router Association
227     [Documentation]    Datapath test across the networks using L3VPN with router association.
228     Log    Verify VPN interfaces, FIB entries and Flow table
229     ${vm_instances} =    Create List    @{VM_IP_NET10}    @{VM_IP_NET20}
230     Wait Until Keyword Succeeds    30s    5s    Check For Elements At URI    ${VPN_IFACES_URL}    ${vm_instances}
231     ${RD} =    Strip String    ${RDS[0]}    characters="[]
232     Wait Until Keyword Succeeds    60s    5s    Check For Elements At URI    ${CONFIG_API}/odl-fib:fibEntries/vrfTables/${RD}/    ${vm_instances}
233     Wait Until Keyword Succeeds    60s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_1_IP}    ${vm_instances}
234     Wait Until Keyword Succeeds    60s    5s    Verify Flows Are Present For L3VPN    ${OS_COMPUTE_2_IP}    ${vm_instances}
235     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Entry On ODL    ${GWMAC_ADDRS}
236     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Flow Entry On Flow Table    ${OS_COMPUTE_1_IP}
237     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Flow Entry On Flow Table    ${OS_COMPUTE_2_IP}
238     Log    Check datapath from network1 to network2
239     ${dst_ip_list} =    Create List    @{VM_IP_NET10}[1]    @{VM_IP_NET20}
240     Test Operations From Vm Instance    ${NETWORKS[0]}    @{VM_IP_NET10}[0]    ${dst_ip_list}
241     Log    Check datapath from network2 to network1
242     ${dst_ip_list} =    Create List    @{VM_IP_NET20}[1]    @{VM_IP_NET10}
243     Test Operations From Vm Instance    ${NETWORKS[1]}    @{VM_IP_NET20}[0]    ${dst_ip_list}
244
245 Dissociate L3VPN From Routers
246     [Documentation]    Dissociating router from L3VPN
247     ${router_id}=    Get Router Id    ${ROUTERS[0]}    ${devstack_conn_id}
248     Dissociate VPN to Router    routerid=${router_id}    vpnid=${VPN_INSTANCE_ID[0]}
249     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
250     Should Not Contain    ${resp}    ${router_id}
251
252 Delete Router And Router Interfaces With L3VPN
253     [Documentation]    Delete Router and Interface to the subnets with L3VPN associate
254     # Asscoiate router with L3VPN
255     ${router_id}=    Get Router Id    ${ROUTERS[0]}    ${devstack_conn_id}
256     Associate VPN to Router    routerid=${router_id}    vpnid=${VPN_INSTANCE_ID[0]}
257     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
258     Should Contain    ${resp}    ${router_id}
259     #Delete Interface
260     : FOR    ${INTERFACE}    IN    @{SUBNETS}
261     \    Remove Interface    ${ROUTERS[0]}    ${INTERFACE}
262     ${interface_output} =    Show Router Interface    ${ROUTERS[0]}
263     : FOR    ${INTERFACE}    IN    @{SUBNETS}
264     \    ${subnet_id} =    Get Subnet Id    ${INTERFACE}    ${devstack_conn_id}
265     \    Should Not Contain    ${interface_output}    ${subnet_id}
266     # Delete Router and Interface to the subnets.
267     Delete Router    ${ROUTERS[0]}
268     ${router_output} =    List Router
269     Should Not Contain    ${router_output}    ${ROUTERS[0]}
270     ${router_list} =    Create List    ${ROUTERS[0]}
271     Wait Until Keyword Succeeds    3s    1s    Check For Elements Not At URI    ${ROUTER_URL}    ${router_list}
272     # Verify Router Entry removed from L3VPN
273     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
274     Should Not Contain    ${resp}    ${router_id}
275     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Flow Entry Removed From Flow Table    ${OS_COMPUTE_1_IP}
276     Wait Until Keyword Succeeds    30s    5s    Verify GWMAC Flow Entry Removed From Flow Table    ${OS_COMPUTE_2_IP}
277
278 Delete Router With NonExistentRouter Name
279     [Documentation]    Delete router with nonExistentRouter name
280     ${rc}    ${output}=    Run And Return Rc And Output    neutron router-delete nonExistentRouter
281     Should Match Regexp    ${output}    Unable to find router with name or id 'nonExistentRouter'|Unable to find router\\(s\\) with id\\(s\\) 'nonExistentRouter'
282
283 Associate L3VPN To Networks
284     [Documentation]    Associates L3VPN to networks and verify
285     ${network1_id} =    Get Net Id    ${NETWORKS[0]}    ${devstack_conn_id}
286     ${network2_id} =    Get Net Id    ${NETWORKS[1]}    ${devstack_conn_id}
287     Associate L3VPN To Network    networkid=${network1_id}    vpnid=${VPN_INSTANCE_ID[0]}
288     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
289     Should Contain    ${resp}    ${network1_id}
290     Associate L3VPN To Network    networkid=${network2_id}    vpnid=${VPN_INSTANCE_ID[0]}
291     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
292     Should Contain    ${resp}    ${network2_id}
293
294 Dissociate L3VPN From Networks
295     [Documentation]    Dissociate L3VPN from networks
296     ${network1_id} =    Get Net Id    ${NETWORKS[0]}    ${devstack_conn_id}
297     ${network2_id} =    Get Net Id    ${NETWORKS[1]}    ${devstack_conn_id}
298     Dissociate L3VPN From Networks    networkid=${network1_id}    vpnid=${VPN_INSTANCE_ID[0]}
299     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
300     Should Not Contain    ${resp}    ${network1_id}
301     Dissociate L3VPN From Networks    networkid=${network2_id}    vpnid=${VPN_INSTANCE_ID[0]}
302     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
303     Should Not Contain    ${resp}    ${network2_id}
304
305 Delete L3VPN
306     [Documentation]    Delete L3VPN
307     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
308
309 Create Multiple L3VPN
310     [Documentation]    Creates three L3VPNs and then verify the same
311     ${net_id} =    Get Net Id    @{NETWORKS}[0]    ${devstack_conn_id}
312     ${tenant_id} =    Get Tenant ID From Network    ${net_id}
313     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[0]}    name=${VPN_NAME[0]}    rd=${RDS[0]}    exportrt=${RDS[0]}    importrt=${RDS[0]}    tenantid=${tenant_id}
314     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[1]}    name=${VPN_NAME[1]}    rd=${RDS[1]}    exportrt=${RDS[1]}    importrt=${RDS[1]}    tenantid=${tenant_id}
315     VPN Create L3VPN    vpnid=${VPN_INSTANCE_ID[2]}    name=${VPN_NAME[2]}    rd=${RDS[2]}    exportrt=${RDS[2]}    importrt=${RDS[2]}    tenantid=${tenant_id}
316     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
317     Should Contain    ${resp}    ${VPN_INSTANCE_ID[0]}
318     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[1]}
319     Should Contain    ${resp}    ${VPN_INSTANCE_ID[1]}
320     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[2]}
321     Should Contain    ${resp}    ${VPN_INSTANCE_ID[2]}
322
323 Delete Multiple L3VPN
324     [Documentation]    Delete three L3VPNs created using Multiple L3VPN Test
325     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
326     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[1]}
327     VPN Delete L3VPN    vpnid=${VPN_INSTANCE_ID[2]}
328
329 *** Keywords ***
330 Test Teardown With Tcpdump Stop
331     [Arguments]    ${cn1_conn_id}    ${cn2_conn_id}    ${os_conn_id}
332     Stop Packet Capture on Node    ${cn1_conn_id}
333     Stop Packet Capture on Node    ${cn2_conn_id}
334     Stop Packet Capture on Node    ${os_conn_id}
335     Get Test Teardown Debugs
336
337 Get Gateway MAC And IP Address
338     [Arguments]    ${router_Name}
339     [Documentation]    Get Gateway mac and IP Address
340     ${output} =    Write Commands Until Prompt    neutron router-port-list ${router_Name}    30s
341     @{MacAddr-list} =    Get Regexp Matches    ${output}    ${MAC_REGEX}
342     @{IpAddr-list} =    Get Regexp Matches    ${output}    ${IP6_REGEX}
343     [Return]    ${MacAddr-list}    ${IpAddr-list}
344
345 Verify GWMAC Flow Entry On Flow Table
346     [Arguments]    ${cnIp}
347     [Documentation]    Verify the GWMAC Table, ARP Response table and Dispatcher table.
348     ${flow_output}=    Run Command On Remote System    ${cnIp}    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
349     ${group_output}=    Run Command On Remote System    ${cnIp}    sudo ovs-ofctl -O OpenFlow13 dump-groups br-int
350     Should Contain    ${flow_output}    table=${DISPATCHER_TABLE}
351     ${dispatcher_table} =    Get Lines Containing String    ${flow_output}    table=${DISPATCHER_TABLE}
352     Should Contain    ${dispatcher_table}    goto_table:${GWMAC_TABLE}
353     Should Not Contain    ${dispatcher_table}    goto_table:${ARP_RESPONSE_TABLE}
354     Should Contain    ${flow_output}    table=${GWMAC_TABLE}
355     ${gwmac_table} =    Get Lines Containing String    ${flow_output}    table=${GWMAC_TABLE}
356     #Verify GWMAC address present in table 19
357     : FOR    ${macAdd}    IN    @{GWMAC_ADDRS}
358     \    Should Contain    ${gwmac_table}    dl_dst=${macAdd} actions=goto_table:${L3_TABLE}
359     #verify Miss entry
360     Should Contain    ${gwmac_table}    actions=resubmit(,17)
361     #Verify ARP_CHECK_TABLE - 43
362     #arp request and response
363     ${arpchk_table} =    Get Lines Containing String    ${flow_output}    table=${ARP_CHECK_TABLE}
364     Should Match Regexp    ${arpchk_table}    ${ARP_RESPONSE_REGEX}
365     ${match} =    Should Match Regexp    ${arpchk_table}    ${ARP_REQUEST_REGEX}
366     ${groupID} =    Split String    ${match}    separator=:
367     Should Contain    ${flow_output}    table=${IPV6_TABLE}
368     ${icmp_ipv6_flows} =    Get Lines Containing String    ${flow_output}    icmp_type=135
369     : FOR    ${ip_addr}    IN    @{GWIP_ADDRS}
370     \    ${rule} =    Set Variable    icmp_type=135,icmp_code=0,nd_target=${ip_addr} actions=CONTROLLER:65535
371     \    Should Match Regexp    ${icmp_ipv6_flows}    ${rule}