2 Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
4 Resource DataModels.robot
6 Resource L2GatewayOperations.robot
7 Resource ../variables/Variables.robot
8 Variables ../variables/netvirt/Modules.py
12 [Arguments] ${force}=no ${source_pwd}=yes
13 [Documentation] Sourcing the Openstack PAsswords for neutron configurations
14 Run Keyword If '${source_pwd}' == 'yes' or '${force}' == 'yes' Write Commands Until Prompt cd ${DEVSTACK_DEPLOY_PATH}; source openrc admin admin
16 Get Tenant ID From Security Group
17 [Documentation] Returns tenant ID by reading it from existing default security-group.
18 ${devstack_conn_id}= Get ControlNode Connection
19 Switch Connection ${devstack_conn_id}
20 ${output}= Write Commands Until Prompt neutron security-group-show default | grep "| tenant_id" | awk '{print $4}'
24 Get Tenant ID From Network
25 [Arguments] ${network_uuid}
26 [Documentation] Returns tenant ID by reading it from existing network.
27 ${resp}= Get_From_Uri uri=${CONFIG_API}/neutron:neutron/networks/network/${network_uuid}/ accept=${ACCEPT_EMPTY} session=session
28 ${tenant_id}= Utils.Extract Value From Content ${resp} /network/0/tenant-id strip
32 [Arguments] ${network_name} ${additional_args}=${EMPTY} ${verbose}=TRUE
33 [Documentation] Create Network with neutron request.
34 ${devstack_conn_id}= Get ControlNode Connection
35 Switch Connection ${devstack_conn_id}
36 ${command} Set Variable If "${verbose}" == "TRUE" neutron -v net-create ${network_name} ${additional_args} neutron net-create ${network_name} ${additional_args} | grep -w id | awk '{print $4}'
37 ${output}= Write Commands Until Prompt ${command} 30s
42 [Documentation] List networks and return output with neutron client.
43 ${devstack_conn_id}= Get ControlNode Connection
44 Switch Connection ${devstack_conn_id}
45 ${output}= Write Commands Until Prompt neutron net-list 30s
51 [Documentation] List subnets and return output with neutron client.
52 ${devstack_conn_id}= Get ControlNode Connection
53 Switch Connection ${devstack_conn_id}
54 ${output}= Write Commands Until Prompt neutron subnet-list 30s
60 [Arguments] ${network_name}
61 [Documentation] Delete Network with neutron request.
62 ${devstack_conn_id}= Get ControlNode Connection
63 Switch Connection ${devstack_conn_id}
64 ${output}= Write Commands Until Prompt neutron -v net-delete ${network_name} 30s
67 Should Match Regexp ${output} Deleted network: ${network_name}|Deleted network\\(s\\): ${network_name}
70 [Arguments] ${network_name} ${subnet} ${range_ip} ${additional_args}=${EMPTY}
71 [Documentation] Create SubNet for the Network with neutron request.
72 ${devstack_conn_id}= Get ControlNode Connection
73 Switch Connection ${devstack_conn_id}
74 ${output}= Write Commands Until Prompt neutron -v subnet-create ${network_name} ${range_ip} --name ${subnet} ${additional_args} 30s
77 Should Contain ${output} Created a new subnet
80 [Arguments] ${network_name} ${port_name} ${sg}=default ${additional_args}=${EMPTY}
81 [Documentation] Create Port with neutron request.
82 ${devstack_conn_id}= Get ControlNode Connection
83 Switch Connection ${devstack_conn_id}
84 ${output}= Write Commands Until Prompt neutron -v port-create ${network_name} --name ${port_name} --security-group ${sg} ${additional_args} 30s
87 Should Contain ${output} Created a new port
90 [Arguments] ${port_name}
91 [Documentation] Delete Port with neutron request.
92 ${devstack_conn_id}= Get ControlNode Connection
93 Switch Connection ${devstack_conn_id}
94 ${output}= Write Commands Until Prompt neutron -v port-delete ${port_name} 30s
97 Should Match Regexp ${output} Deleted port: ${port_name}|Deleted port\\(s\\): ${port_name}
100 [Documentation] List ports and return output with neutron client.
101 ${devstack_conn_id}= Get ControlNode Connection
102 Switch Connection ${devstack_conn_id}
103 ${output}= Write Commands Until Prompt neutron port-list 30s
109 [Documentation] List VMs and return output with nova client.
110 ${devstack_conn_id}= Get ControlNode Connection
111 Switch Connection ${devstack_conn_id}
112 ${output}= Write Commands Until Prompt nova list 30s
117 Create And Associate Floating IPs
118 [Arguments] ${external_net} @{vm_list}
119 [Documentation] Create and associate floating IPs to VMs with nova request
120 ${devstack_conn_id}= Get ControlNode Connection
121 Switch Connection ${devstack_conn_id}
122 ${ip_list}= Create List @{EMPTY}
123 : FOR ${vm} IN @{vm_list}
124 \ ${output}= Write Commands Until Prompt neutron floatingip-create ${external_net} 30s
126 \ @{ip} Get Regexp Matches ${output} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}
127 \ ${ip_length} Get Length ${ip}
128 \ Run Keyword If ${ip_length}>0 Append To List ${ip_list} @{ip}[0]
129 \ ... ELSE Append To List ${ip_list} None
130 \ ${output}= Write Commands Until Prompt nova floating-ip-associate ${vm} @{ip}[0] 30s
135 [Documentation] Verifies the Gateway Ips with dump flow.
136 ${output}= Write Commands Until Prompt sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
138 : FOR ${GatewayIpElement} IN @{GATEWAY_IPS}
139 \ Should Contain ${output} ${GatewayIpElement}
142 [Documentation] Verifies the Dhcp Ips with dump flow.
143 ${output}= Write Commands Until Prompt sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
145 : FOR ${DhcpIpElement} IN @{DHCP_IPS}
146 \ Should Contain ${output} ${DhcpIpElement}
149 [Documentation] Verifies the Dhcp Ips with dump flow.
150 ${output}= Write Commands Until Prompt sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
152 : FOR ${DhcpIpElement} IN @{DHCP_IPS}
153 \ Should Not Contain ${output} ${DhcpIpElement}
156 [Arguments] ${subnet}
157 [Documentation] Delete SubNet for the Network with neutron request.
159 ${devstack_conn_id}= Get ControlNode Connection
160 Switch Connection ${devstack_conn_id}
161 ${output}= Write Commands Until Prompt neutron -v subnet-delete ${subnet}
164 Should Match Regexp ${output} Deleted subnet: ${subnet}|Deleted subnet\\(s\\): ${subnet}
166 Verify No Gateway Ips
167 [Documentation] Verifies the Gateway Ips removed with dump flow.
168 ${output}= Write Commands Until Prompt sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
170 : FOR ${GatewayIpElement} IN @{GATEWAY_IPS}
171 \ Should Not Contain ${output} ${GatewayIpElement}
174 [Arguments] ${vm_name}
175 [Documentation] Delete Vm instances using instance names.
176 ${devstack_conn_id}= Get ControlNode Connection
177 Switch Connection ${devstack_conn_id}
178 ${output}= Write Commands Until Prompt nova force-delete ${vm_name} 40s
182 [Arguments] ${network_name} ${devstack_conn_id}
183 [Documentation] Retrieve the net id for the given network name to create specific vm instance
184 Switch Connection ${devstack_conn_id}
185 ${output}= Write Commands Until Prompt neutron net-list | grep "${network_name}" | awk '{print $2}' 30s
187 ${splitted_output}= Split String ${output} ${EMPTY}
188 ${net_id}= Get from List ${splitted_output} 0
193 [Arguments] ${subnet_name} ${devstack_conn_id}
194 [Documentation] Retrieve the subnet id for the given subnet name
195 Switch Connection ${devstack_conn_id}
196 ${output}= Write Commands Until Prompt neutron subnet-list | grep "${subnet_name}" | awk '{print $2}' 30s
198 ${splitted_output}= Split String ${output} ${EMPTY}
199 ${subnet_id}= Get from List ${splitted_output} 0
201 [Return] ${subnet_id}
204 [Arguments] ${port_name} ${devstack_conn_id}
205 [Documentation] Retrieve the port id for the given port name to attach specific vm instance to a particular port
206 Switch Connection ${devstack_conn_id}
207 ${output}= Write Commands Until Prompt neutron port-list | grep "${port_name}" | awk '{print $2}' 30s
209 ${splitted_output}= Split String ${output} ${EMPTY}
210 ${port_id}= Get from List ${splitted_output} 0
215 [Arguments] ${router1} ${devstack_conn_id}
216 [Documentation] Retrieve the router id for the given router name
217 Switch Connection ${devstack_conn_id}
218 ${output}= Write Commands Until Prompt neutron router-list | grep "${router1}" | awk '{print $2}' 30s
220 ${splitted_output}= Split String ${output} ${EMPTY}
221 ${router_id}= Get from List ${splitted_output} 0
223 [Return] ${router_id}
226 [Arguments] ${net_name} ${vm_instance_names} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.nano ${sg}=default
227 [Documentation] Create X Vm Instance with the net id of the Netowrk.
228 ${devstack_conn_id}= Get ControlNode Connection
229 Switch Connection ${devstack_conn_id}
230 ${net_id}= Get Net Id ${net_name} ${devstack_conn_id}
231 : FOR ${VmElement} IN @{vm_instance_names}
232 \ ${output}= Write Commands Until Prompt nova boot --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${VmElement} --security-groups ${sg} 30s
235 Create Vm Instance With Port
236 [Arguments] ${port_name} ${vm_instance_name} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.nano ${sg}=default
237 [Documentation] Create One VM instance using given ${port_name} and for given ${compute_node}
238 ${devstack_conn_id}= Get ControlNode Connection
239 Switch Connection ${devstack_conn_id}
240 ${port_id}= Get Port Id ${port_name} ${devstack_conn_id}
241 ${output}= Write Commands Until Prompt nova boot --image ${image} --flavor ${flavor} --nic port-id=${port_id} ${vm_instance_name} --security-groups ${sg} 30s
244 Create Vm Instance With Ports
245 [Arguments] ${port_name} ${port2_name} ${vm_instance_name} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.nano ${sg}=default
246 [Documentation] Create One VM instance using given ${port_name} and for given ${compute_node}
247 ${devstack_conn_id}= Get ControlNode Connection
248 Switch Connection ${devstack_conn_id}
249 ${port_id}= Get Port Id ${port_name} ${devstack_conn_id}
250 ${port2_id}= Get Port Id ${port2_name} ${devstack_conn_id}
251 ${output}= Write Commands Until Prompt nova boot --image ${image} --flavor ${flavor} --nic port-id=${port_id} --nic port-id=${port2_id} ${vm_instance_name} --security-groups ${sg} 30s
254 Create Vm Instance With Port On Compute Node
255 [Arguments] ${port_name} ${vm_instance_name} ${compute_node} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.nano ${sg}=default
256 [Documentation] Create One VM instance using given ${port_name} and for given ${compute_node}
257 ${devstack_conn_id}= Get ControlNode Connection
258 Switch Connection ${devstack_conn_id}
259 ${port_id}= Get Port Id ${port_name} ${devstack_conn_id}
260 ${hostname_compute_node}= Run Command On Remote System ${compute_node} hostname
261 ${output}= Write Commands Until Prompt nova boot --image ${image} --flavor ${flavor} --nic port-id=${port_id} ${vm_instance_name} --security-groups ${sg} --availability-zone nova:${hostname_compute_node} 30s
265 [Arguments] ${vm_name}
266 [Documentation] Run these commands to check whether the created vm instance is active or not.
267 ${devstack_conn_id}= Get ControlNode Connection
268 Switch Connection ${devstack_conn_id}
269 ${output}= Write Commands Until Prompt nova show ${vm_name} | grep OS-EXT-STS:vm_state 30s
271 Should Contain ${output} active
273 Collect VM IP Addresses
274 [Arguments] ${fail_on_none} @{vm_list}
275 [Documentation] Using nova console-log on the provided ${vm_list} to search for the string "obtained" which
276 ... correlates to the instance receiving it's IP address via DHCP. Also retrieved is the ip of the nameserver
277 ... if available in the console-log output. The keyword will also return a list of the learned ips as it
278 ... finds them in the console log output, and will have "None" for Vms that no ip was found.
279 ${devstack_conn_id}= Get ControlNode Connection
280 Switch Connection ${devstack_conn_id}
281 ${ip_list} Create List @{EMPTY}
282 : FOR ${vm} IN @{vm_list}
283 \ ${vm_ip_line}= Write Commands Until Prompt nova console-log ${vm} | grep -i "obtained" 30s
285 \ @{vm_ip} Get Regexp Matches ${vm_ip_line} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}
286 \ ${vm_ip_length} Get Length ${vm_ip}
287 \ Run Keyword If ${vm_ip_length}>0 Append To List ${ip_list} @{vm_ip}[0]
288 \ ... ELSE Append To List ${ip_list} None
289 \ ${dhcp_ip_line}= Write Commands Until Prompt nova console-log ${vm} | grep "^nameserver" 30s
290 \ Log ${dhcp_ip_line}
291 \ ${dhcp_ip} Get Regexp Matches ${dhcp_ip_line} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}
292 \ ${dhcp_ip_length} Get Length ${dhcp_ip}
293 \ Run Keyword If ${dhcp_ip_length}<=0 Append To List ${dhcp_ip} None
295 ${dhcp_length} Get Length ${dhcp_ip}
296 Run Keyword If '${fail_on_none}' == 'true' Should Not Contain ${ip_list} None
297 Run Keyword If '${fail_on_none}' == 'true' Should Not Contain ${dhcp_ip} None
298 Should Be True ${dhcp_length} <= 1
299 Return From Keyword If ${dhcp_length}==0 ${ip_list} ${EMPTY}
300 [Return] ${ip_list} ${dhcp_ip}
303 [Arguments] ${vm_instance_names}
304 [Documentation] View Console log of the created vm instances using nova show.
305 : FOR ${VmElement} IN @{vm_instance_names}
306 \ ${output}= Write Commands Until Prompt nova show ${VmElement}
308 \ ${output}= Write Commands Until Prompt nova console-log ${VmElement}
311 Ping Vm From DHCP Namespace
312 [Arguments] ${net_name} ${vm_ip}
313 [Documentation] Reach all Vm Instance with the net id of the Netowrk.
315 ${devstack_conn_id}= Get ControlNode Connection
316 Switch Connection ${devstack_conn_id}
317 ${net_id}= Get Net Id ${net_name} ${devstack_conn_id}
319 ${output}= Write Commands Until Prompt sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s
322 Should Contain ${output} 64 bytes
324 Ping From DHCP Should Not Succeed
325 [Arguments] ${net_name} ${vm_ip}
326 [Documentation] Should Not Reach Vm Instance with the net id of the Netowrk.
328 ${devstack_conn_id}= Get ControlNode Connection
329 Switch Connection ${devstack_conn_id}
330 ${net_id}= Get Net Id ${net_name} ${devstack_conn_id}
332 ${output}= Write Commands Until Prompt sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s
335 Should Not Contain ${output} 64 bytes
337 Ping Vm From Control Node
338 [Arguments] ${vm_floating_ip} ${additional_args}=${EMPTY}
339 [Documentation] Ping VM floating IP from control node
340 Log ${vm_floating_ip}
341 ${devstack_conn_id}= Get ControlNode Connection
342 Switch Connection ${devstack_conn_id}
343 ${output}= Write Commands Until Prompt ping ${additional_args} -c 3 ${vm_floating_ip} 20s
346 Should Contain ${output} 64 bytes
349 [Arguments] ${dest_vm_ip}
350 [Documentation] Ping to the expected destination ip.
351 ${output}= Write Commands Until Expected Prompt ping -c 3 ${dest_vm_ip} ${OS_SYSTEM_PROMPT}
356 [Documentation] Ping to the expected destination ip.
357 ${output}= Write Commands Until Expected Prompt curl -i http://169.254.169.254 ${OS_SYSTEM_PROMPT}
358 Write Commands Until Prompt exit
359 Should Contain ${output} 200
362 [Documentation] Exit the vm instance.
363 ${output}= Write Commands Until Prompt exit
366 Check If Console Is VmInstance
367 [Arguments] ${console}=cirros
368 [Documentation] Check if the session has been able to login to the VM instance
369 ${output}= Write Commands Until Expected Prompt id ${OS_SYSTEM_PROMPT}
370 Should Contain ${output} ${console}
373 [Documentation] Check if the session has been able to login to the VM instance and exit the instance
374 ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance cirros
375 Run Keyword If ${rcode} Write Commands Until Prompt exit
378 [Arguments] ${ip_address} ${ttl}=64
379 [Documentation] Run Ping command on the IP available as argument
380 ${output}= Write Commands Until Expected Prompt ping -t ${ttl} -c 3 ${ip_address} ${OS_SYSTEM_PROMPT}
381 Should Contain ${output} 64 bytes
383 Check Metadata Access
384 [Documentation] Try curl on the Metadataurl and check if it is okay
385 ${output}= Write Commands Until Expected Prompt curl -i http://169.254.169.254 ${OS_SYSTEM_PROMPT}
386 Should Contain ${output} 200
388 Execute Command on VM Instance
389 [Arguments] ${net_name} ${vm_ip} ${cmd} ${user}=cirros ${password}=cubswin:)
390 [Documentation] Login to the vm instance using ssh in the network, executes a command inside the VM and returns the ouput.
391 ${devstack_conn_id} = Get ControlNode Connection
392 Switch Connection ${devstack_conn_id}
393 ${net_id} = Get Net Id ${net_name} ${devstack_conn_id}
395 ${output} = Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh ${user}@${vm_ip} -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null d:
397 ${output} = Write Commands Until Expected Prompt ${password} ${OS_SYSTEM_PROMPT}
399 ${rcode} = Run Keyword And Return Status Check If Console Is VmInstance
400 ${output} = Run Keyword If ${rcode} Write Commands Until Expected Prompt ${cmd} ${OS_SYSTEM_PROMPT}
401 [Teardown] Exit From Vm Console
404 Test Operations From Vm Instance
405 [Arguments] ${net_name} ${src_ip} ${dest_ips} ${user}=cirros ${password}=cubswin:) ${ttl}=64
406 [Documentation] Login to the vm instance using ssh in the network.
407 ${devstack_conn_id}= Get ControlNode Connection
408 Switch Connection ${devstack_conn_id}
410 ${net_id}= Get Net Id ${net_name} ${devstack_conn_id}
411 ${output}= Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no ${user}@${src_ip} -o UserKnownHostsFile=/dev/null d:
413 ${output}= Write Commands Until Expected Prompt ${password} ${OS_SYSTEM_PROMPT}
415 ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance
416 Run Keyword If ${rcode} Write Commands Until Expected Prompt ifconfig ${OS_SYSTEM_PROMPT}
417 Run Keyword If ${rcode} Write Commands Until Expected Prompt route ${OS_SYSTEM_PROMPT}
418 Run Keyword If ${rcode} Write Commands Until Expected Prompt arp -an ${OS_SYSTEM_PROMPT}
419 : FOR ${dest_ip} IN @{dest_ips}
421 \ ${string_empty}= Run Keyword And Return Status Should Be Empty ${dest_ip}
422 \ Run Keyword If ${string_empty} Continue For Loop
423 \ Run Keyword If ${rcode} Check Ping ${dest_ip} ttl=${ttl}
424 Run Keyword If ${rcode} Check Metadata Access
425 [Teardown] Exit From Vm Console
427 Install Netcat On Controller
428 [Documentation] Installs Netcat on the controller - this probably shouldn't be here
429 ${devstack_conn_id}= Get ControlNode Connection
430 Switch Connection ${devstack_conn_id}
431 ${output}= Write Commands Until Prompt sudo yum install -y nc
435 Test Netcat Operations From Vm Instance
436 [Arguments] ${net_name} ${vm_ip} ${dest_ip} ${additional_args}=${EMPTY} ${port}=12345 ${user}=cirros
437 ... ${password}=cubswin:)
438 [Documentation] Use Netcat to test TCP/UDP connections to the controller
439 ${client_data} Set Variable Test Client Data
440 ${server_data} Set Variable Test Server Data
441 ${devstack_conn_id}= Get ControlNode Connection
442 Switch Connection ${devstack_conn_id}
444 ${output}= Write Commands Until Prompt ( ( echo "${server_data}" | sudo timeout 60 nc -l ${additional_args} ${port} ) & )
446 ${output}= Write Commands Until Prompt sudo netstat -nlap | grep ${port}
448 ${nc_output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo echo "${client_data}" | nc -v -w 5 ${additional_args} ${dest_ip} ${port}
450 ${output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo route -n
452 ${output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo arp -an
454 Should Match Regexp ${nc_output} ${server_data}
457 [Arguments] ${list_of_external_dst_ips}
458 [Documentation] Check reachability with other network's instances.
459 ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance
460 : FOR ${dest_ip} IN @{list_of_external_dst_ips}
462 \ Check Ping ${dest_ip}
465 [Arguments] ${router_name}
466 [Documentation] Create Router and Add Interface to the subnets.
467 ${devstack_conn_id}= Get ControlNode Connection
468 Switch Connection ${devstack_conn_id}
469 ${output}= Write Commands Until Prompt neutron -v router-create ${router_name} 30s
471 Should Contain ${output} Created a new router
474 [Documentation] List Router and return output with neutron client.
475 ${devstack_conn_id}= Get ControlNode Connection
476 Switch Connection ${devstack_conn_id}
477 ${output}= Write Commands Until Prompt neutron router-list 30s
483 [Arguments] ${router_name} ${interface_name}
484 ${devstack_conn_id}= Get ControlNode Connection
485 Switch Connection ${devstack_conn_id}
486 ${output}= Write Commands Until Prompt neutron -v router-interface-add ${router_name} ${interface_name}
488 Should Contain ${output} Added interface
490 Show Router Interface
491 [Arguments] ${router_name}
492 [Documentation] List Router interface associated with given Router and return output with neutron client.
493 ${devstack_conn_id}= Get ControlNode Connection
494 Switch Connection ${devstack_conn_id}
495 ${output}= Write Commands Until Prompt neutron router-port-list ${router_name} -f csv 30s
501 [Arguments] ${router_name} ${network_name}
502 ${devstack_conn_id}= Get ControlNode Connection
503 Switch Connection ${devstack_conn_id}
504 ${output}= Write Commands Until Prompt neutron -v router-gateway-set ${router_name} ${network_name}
506 Should Contain ${output} Set gateway
509 [Arguments] ${router_name} ${interface_name}
510 [Documentation] Remove Interface to the subnets.
511 ${devstack_conn_id}= Get ControlNode Connection
512 Switch Connection ${devstack_conn_id}
513 ${output}= Write Commands Until Prompt neutron -v router-interface-delete ${router_name} ${interface_name}
515 Should Contain ${output} Removed interface from router
518 [Arguments] ${router_name} ${cmd}
519 [Documentation] Update the router with the command. Router name and command should be passed as argument.
520 ${devstack_conn_id} = Get ControlNode Connection
521 Switch Connection ${devstack_conn_id}
522 ${output} = Write Commands Until Prompt neutron router-update ${router_name} ${cmd} 30s
524 Should Contain ${output} Updated
527 [Arguments] ${router_name} ${options}
528 [Documentation] Show information of a given router. Router name and optional fields should be sent as arguments.
529 ${devstack_conn_id} = Get ControlNode Connection
530 Switch Connection ${devstack_conn_id}
531 ${output} = Write Commands Until Prompt neutron router-show ${router_name} ${options} 30s
536 [Arguments] ${router_name}
537 [Documentation] Delete Router and Interface to the subnets.
538 ${devstack_conn_id}= Get ControlNode Connection
539 Switch Connection ${devstack_conn_id}
540 ${output}= Write Commands Until Prompt neutron -v router-delete ${router_name} 60s
542 Should Match Regexp ${output} Deleted router: ${router_name}|Deleted router\\(s\\): ${router_name}
544 Get DumpFlows And Ovsconfig
545 [Arguments] ${openstack_node_ip}
546 [Documentation] Get the OvsConfig and Flow entries from OVS from the Openstack Node
547 Log ${openstack_node_ip}
548 SSHLibrary.Open Connection ${openstack_node_ip} prompt=${DEFAULT_LINUX_PROMPT}
549 Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
550 SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
551 Write Commands Until Expected Prompt ip -o link ${DEFAULT_LINUX_PROMPT_STRICT}
552 Write Commands Until Expected Prompt ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT}
553 Write Commands Until Expected Prompt ip route ${DEFAULT_LINUX_PROMPT_STRICT}
554 Write Commands Until Expected Prompt arp -an ${DEFAULT_LINUX_PROMPT_STRICT}
555 ${nslist}= Write Commands Until Expected Prompt ip netns list | awk '{print $1}' ${DEFAULT_LINUX_PROMPT_STRICT}
556 @{lines} Split To Lines ${nslist}
557 : FOR ${line} IN @{lines}
558 \ Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o link ${DEFAULT_LINUX_PROMPT_STRICT}
559 \ Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT}
560 \ Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT}
561 Write Commands Until Expected Prompt sudo ovs-vsctl show ${DEFAULT_LINUX_PROMPT_STRICT}
562 Write Commands Until Expected Prompt sudo ovs-vsctl list Open_vSwitch ${DEFAULT_LINUX_PROMPT_STRICT}
563 Write Commands Until Expected Prompt sudo ovs-ofctl show br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
564 Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
565 Write Commands Until Expected Prompt sudo ovs-ofctl dump-groups br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
566 Write Commands Until Expected Prompt sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
568 Get Karaf Log Type From Test Start
569 [Arguments] ${ip} ${test_name} ${type} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
570 ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
571 ${cmd} Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file} | grep '${type}'
572 ${output} Run Command On Controller ${ip} ${cmd} ${user} ${password} ${prompt}
575 Get Karaf Log Types From Test Start
576 [Arguments] ${ip} ${test_name} ${types} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
577 ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
578 : FOR ${type} IN @{types}
579 \ Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password}
580 \ ... ${prompt} ${log_file}
582 Get Karaf Log Events From Test Start
583 [Arguments] ${test_name} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
584 ${log_types} = Create List ERROR WARN Exception
585 Run Keyword If 0 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_IP} ${test_name} ${log_types}
586 Run Keyword If 1 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_2_IP} ${test_name} ${log_types}
587 Run Keyword If 2 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_3_IP} ${test_name} ${log_types}
589 Get ControlNode Connection
590 ${control_conn_id}= SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT_STRICT}
591 Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
592 SSHLibrary.Set Client Configuration timeout=30s
593 Source Password force=yes
594 [Return] ${control_conn_id}
597 [Documentation] Get the OvsConfig and Flow entries from all Openstack nodes
598 Run Keyword If 0 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_CONTROL_NODE_IP}
599 Run Keyword If 1 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_1_IP}
600 Run Keyword If 2 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_2_IP}
602 Get Test Teardown Debugs
603 [Arguments] ${test_name}=${TEST_NAME}
605 Run Keyword And Ignore Error Get Model Dump ${HA_PROXY_IP} ${netvirt_data_models}
606 Get Karaf Log Events From Test Start ${test_name}
608 Get Suite Teardown Debugs
610 Get Model Dump ${HA_PROXY_IP} ${netvirt_data_models}
613 [Arguments] @{vm_indices}
614 [Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node
615 ${devstack_conn_id}= Get ControlNode Connection
616 Switch Connection ${devstack_conn_id}
617 ${output}= Write Commands Until Prompt sudo ip netns list
619 : FOR ${index} IN @{vm_indices}
620 \ ${output}= Write Commands Until Prompt nova show ${index} 30s
628 Create Security Group
629 [Arguments] ${sg_name} ${desc}
630 ${devstack_conn_id}= Get ControlNode Connection
631 Switch Connection ${devstack_conn_id}
632 ${output}= Write Commands Until Prompt nova secgroup-create ${sg_name} ${desc} 40s
636 [Arguments] ${direction} ${protocol} ${min_port} ${max_port} ${remote_ip} ${sg_name}
637 ${devstack_conn_id}= Get ControlNode Connection
638 Switch Connection ${devstack_conn_id}
639 ${output}= Write Commands Until Prompt neutron security-group-rule-create --direction ${direction} --protocol ${protocol} --port-range-min ${min_port} --port-range-max ${max_port} --remote-ip-prefix ${remote_ip} ${sg_name}
642 Neutron Security Group Show
643 [Arguments] ${SecurityGroupRuleName} ${additional_args}=${EMPTY}
644 [Documentation] Displays the neutron security group configurations that belongs to a given neutron security group name
645 ${devstack_conn_id}= Get ControlNode Connection
646 Switch Connection ${devstack_conn_id}
647 ${cmd}= Set Variable neutron security-group-show ${SecurityGroupRuleName} ${additional_args}
649 ${output}= Write Commands Until Prompt ${cmd} 30s
655 [Arguments] ${PortName} ${additional_args}=${EMPTY}
656 [Documentation] Display the port configuration that belong to a given neutron port
657 ${devstack_conn_id}= Get ControlNode Connection
658 Switch Connection ${devstack_conn_id}
659 ${cmd}= Set Variable neutron port-show ${PortName} ${additional_args}
661 ${output}= Write Commands Until Prompt ${cmd} 30s
666 Neutron Security Group Create
667 [Arguments] ${SecurityGroupName} ${additional_args}=${EMPTY}
668 [Documentation] Create a security group with specified name ,description & protocol value according to security group template
669 ${devstack_conn_id}= Get ControlNode Connection
670 Switch Connection ${devstack_conn_id}
671 ${cmd}= Set Variable neutron security-group-create ${SecurityGroupName} ${additional_args}
673 ${output}= Write Commands Until Prompt ${cmd} 30s
675 Should Contain ${output} Created a new security_group
676 ${sgp_id}= Should Match Regexp ${output} [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
679 [Return] ${output} ${sgp_id}
681 Neutron Security Group Update
682 [Arguments] ${SecurityGroupName} ${additional_args}=${EMPTY}
683 [Documentation] Updating security groups
684 ${devstack_conn_id}= Get ControlNode Connection
685 Switch Connection ${devstack_conn_id}
686 ${cmd}= Set Variable neutron security-group-update ${SecurityGroupName} ${additional_args}
688 ${output}= Write Commands Until Prompt ${cmd} 30s
694 [Arguments] ${sg_name}
695 [Documentation] Delete Security group
696 ${devstack_conn_id}= Get ControlNode Connection
697 Switch Connection ${devstack_conn_id}
698 ${output}= Write Commands Until Prompt neutron security-group-delete ${sg_name} 40s
700 Should Match Regexp ${output} Deleted security_group: ${sg_name}|Deleted security_group\\(s\\): ${sg_name}
703 Neutron Security Group Rule Create
704 [Arguments] ${Security_group_name} &{Kwargs}
705 [Documentation] Creates neutron security rule with neutron request with or without optional params, here security group name is mandatory args, rule with optional params can be created by passing the optional args values ex: direction=${INGRESS_EGRESS}, Then these optional params are catenated with mandatory args, example of usage: "Neutron Security Group Rule Create ${SGP_SSH} direction=${RULE_PARAMS[0]} ethertype=${RULE_PARAMS[1]} ..."
706 ${devstack_conn_id}= Get ControlNode Connection
707 Switch Connection ${devstack_conn_id}
708 Run Keyword If ${Kwargs} Log ${Kwargs}
709 ${description} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} description default=${None}
710 ${direction} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} direction default=${None}
711 ${ethertype} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} ethertype default=${None}
712 ${port_range_max} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} port_range_max default=${None}
713 ${port_range_min} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} port_range_min default=${None}
714 ${protocol} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} protocol default=${None}
715 ${remote_group_id} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} remote_group_id default=${None}
716 ${remote_ip_prefix} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} remote_ip_prefix default=${None}
717 ${cmd}= Set Variable neutron security-group-rule-create ${Security_group_name}
718 ${cmd}= Run Keyword If '${description}'!='None' Catenate ${cmd} --description ${description}
719 ... ELSE Catenate ${cmd}
720 ${cmd}= Run Keyword If '${direction}'!='None' Catenate ${cmd} --direction ${direction}
721 ... ELSE Catenate ${cmd}
722 ${cmd}= Run Keyword If '${ethertype}'!='None' Catenate ${cmd} --ethertype ${ethertype}
723 ... ELSE Catenate ${cmd}
724 ${cmd}= Run Keyword If '${port_range_max}'!='None' Catenate ${cmd} --port_range_max ${port_range_max}
725 ... ELSE Catenate ${cmd}
726 ${cmd}= Run Keyword If '${port_range_min}'!='None' Catenate ${cmd} --port_range_min ${port_range_min}
727 ... ELSE Catenate ${cmd}
728 ${cmd}= Run Keyword If '${protocol}'!='None' Catenate ${cmd} --protocol ${protocol}
729 ... ELSE Catenate ${cmd}
730 ${cmd}= Run Keyword If '${remote_group_id}'!='None' Catenate ${cmd} --remote_group_id ${remote_group_id}
731 ... ELSE Catenate ${cmd}
732 ${cmd}= Run Keyword If '${remote_ip_prefix}'!='None' Catenate ${cmd} --remote_ip_prefix ${remote_ip_prefix}
733 ... ELSE Catenate ${cmd}
734 ${output}= Write Commands Until Prompt ${cmd} 30s
735 ${rule_id}= Should Match Regexp ${output} [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
737 Should Contain ${output} Created a new security_group_rule
739 [Return] ${output} ${rule_id}
741 Create Neutron Port With Additional Params
742 [Arguments] ${network_name} ${port_name} ${additional_args}=${EMPTY}
743 [Documentation] Create Port With given additional parameters
744 ${devstack_conn_id}= Get ControlNode Connection
745 Switch Connection ${devstack_conn_id}
746 ${cmd}= Set Variable neutron -v port-create ${network_name} --name ${port_name} ${additional_args}
748 ${OUTPUT}= Write Commands Until Prompt ${cmd} 30s
750 Should Contain ${output} Created a new port
751 ${port_id}= Should Match Regexp ${OUTPUT} [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
754 [Return] ${OUTPUT} ${port_id}
757 [Arguments] ${portName_list}
758 [Documentation] Retrieve the port MacAddr for the given list of port name and return the MAC address list.
759 ${devstack_conn_id}= Get ControlNode Connection
760 Switch Connection ${devstack_conn_id}
761 ${MacAddr-list} Create List
762 : FOR ${portName} IN @{portName_list}
763 \ ${macAddr}= OpenStackOperations.Get Port Mac ${portName} ${devstack_conn_id}
764 \ Append To List ${MacAddr-list} ${macAddr}
765 [Return] ${MacAddr-list}
768 [Arguments] ${port_name}
769 [Documentation] Keyword would return the IP of the ${port_name} received.
770 Switch Connection ${devstack_conn_id}
771 ${output}= Write Commands Until Prompt neutron port-list | grep "${port_name}" | awk '{print $11}' | awk -F "\\"" '{print $2}' 30s
773 ${splitted_output}= Split String ${output} ${EMPTY}
774 ${port_ip}= Get from List ${splitted_output} 0
779 [Arguments] ${port_name} ${conn_id}=${devstack_conn_id}
780 [Documentation] Keyword would return the MAC ID of the ${port_name} received.
781 Switch Connection ${conn_id}
782 ${output}= Write Commands Until Prompt neutron port-list | grep "${port_name}" | awk '{print $6}' 30s
784 ${splitted_output}= Split String ${output} ${EMPTY}
785 ${port_mac}= Get from List ${splitted_output} 0
790 [Arguments] ${bridge_name} ${intf_name} ${gw_name}
791 [Documentation] Keyword to create an L2 Gateway ${gw_name} for bridge ${bridge_name} connected to interface ${intf_name} (Using Neutron CLI).
792 Switch Connection ${devstack_conn_id}
793 ${l2gw_output}= Write Commands Until Prompt ${L2GW_CREATE} name=${bridge_name},interface_names=${intf_name} ${gw_name} 30s
795 [Return] ${l2gw_output}
797 Create L2Gateway Connection
798 [Arguments] ${gw_name} ${net_name}
799 [Documentation] Keyword would create a new L2 Gateway Connection for ${gw_name} to ${net_name} (Using Neutron CLI).
800 Switch Connection ${devstack_conn_id}
801 ${l2gw_output}= Write Commands Until Prompt ${L2GW_CONN_CREATE} ${gw_name} ${net_name} 30s
803 [Return] ${l2gw_output}
806 [Documentation] Keyword to return all the L2 Gateways available (Using Neutron CLI).
807 Switch Connection ${devstack_conn_id}
808 ${output}= Write Commands Until Prompt ${L2GW_GET_YAML} 30s
811 Get All L2Gateway Connection
812 [Documentation] Keyword to return all the L2 Gateway connections available (Using Neutron CLI).
813 Switch Connection ${devstack_conn_id}
814 ${output}= Write Commands Until Prompt ${L2GW_GET_CONN_YAML} 30s
819 [Documentation] Keyword to check if the ${gw_id} is available in the L2 Gateway list (Using Neutron CLI).
820 Switch Connection ${devstack_conn_id}
821 ${output}= Write Commands Until Prompt ${L2GW_SHOW} ${gw_id} 30s
826 [Arguments] ${l2gw_name}
827 [Documentation] Keyword to retrieve the L2 Gateway ID for the ${l2gw_name} (Using Neutron CLI).
828 Switch Connection ${devstack_conn_id}
829 ${output}= Write Commands Until Prompt ${L2GW_GET} | grep "${l2gw_name}" | awk '{print $2}' 30s
831 ${splitted_output}= Split String ${output} ${EMPTY}
832 ${l2gw_id}= Get from List ${splitted_output} 0
836 Get L2gw Connection Id
837 [Arguments] ${l2gw_name}
838 [Documentation] Keyword to retrieve the L2 Gateway Connection ID for the ${l2gw_name} (Using Neutron CLI).
839 Switch Connection ${devstack_conn_id}
840 ${l2gw_id}= OpenStackOperations.Get L2gw Id ${l2gw_name}
841 ${output}= Write Commands Until Prompt ${L2GW_GET_CONN} | grep "${l2gw_id}" | awk '{print $2}' 30s
843 ${splitted_output}= Split String ${output} ${EMPTY}
844 ${l2gw_conn_id}= Get from List ${splitted_output} 0
846 [Return] ${l2gw_conn_id}
848 Neutron Port List Rest
849 [Documentation] Keyword to get all ports details in Neutron (Using REST).
850 ${resp} = RequestsLibrary.Get Request session ${PORT_URL}
852 Should Be Equal As Strings ${resp.status_code} 200
853 [Return] ${resp.content}
855 Get Neutron Port Rest
856 [Arguments] ${port_id}
857 [Documentation] Keyword to get the specific port details in Neutron (Using REST).
858 ${resp} = RequestsLibrary.Get Request session ${CONFIG_API}/${GET_PORT_URL}/${port_id}
860 Should Be Equal As Strings ${resp.status_code} 200
861 [Return] ${resp.content}
864 [Arguments] ${port_id} ${json_data}
865 [Documentation] Keyword to update ${port_id} with json data received in ${json_data} (Using REST).
867 ${resp} = RequestsLibrary.Put Request session ${CONFIG_API}/${GET_PORT_URL}/${port_id} ${json_data}
869 Should Be Equal As Strings ${resp.status_code} 200
870 [Return] ${resp.content}
872 Create And Configure Security Group
873 [Arguments] ${sg-name}
874 Neutron Security Group Create ${sg-name}
875 Neutron Security Group Rule Create ${sg-name} direction=ingress port_range_max=65535 port_range_min=1 protocol=tcp remote_ip_prefix=0.0.0.0/0
876 Neutron Security Group Rule Create ${sg-name} direction=egress port_range_max=65535 port_range_min=1 protocol=tcp remote_ip_prefix=0.0.0.0/0
877 Neutron Security Group Rule Create ${sg-name} direction=ingress protocol=icmp remote_ip_prefix=0.0.0.0/0
878 Neutron Security Group Rule Create ${sg-name} direction=egress protocol=icmp remote_ip_prefix=0.0.0.0/0
879 Neutron Security Group Rule Create ${sg-name} direction=ingress port_range_max=65535 port_range_min=1 protocol=udp remote_ip_prefix=0.0.0.0/0
880 Neutron Security Group Rule Create ${sg-name} direction=egress port_range_max=65535 port_range_min=1 protocol=udp remote_ip_prefix=0.0.0.0/0
882 Create SFC Flow Classifier
883 [Arguments] ${name} ${src_ip} ${dest_ip} ${protocol} ${dest_port} ${neutron_src_port}
884 [Documentation] Create a flow classifier for SFC
885 ${devstack_conn_id}= Get ControlNode Connection
886 Switch Connection ${devstack_conn_id}
887 ${cmd}= Set Variable neutron flow-classifier-create --ethertype IPv4 --source-ip-prefix ${src_ip}/32 --destination-ip-prefix ${dest_ip}/32 --protocol ${protocol} --destination-port ${dest_port}:${dest_port} --logical-source-port ${neutron_src_port} ${name}
889 ${output}= Write Commands Until Prompt ${cmd} 30s
892 Should Contain ${output} Created a new flow_classifier
895 Delete SFC Flow Classifier
897 [Documentation] Delete a SFC flow classifier
898 ${devstack_conn_id}= Get ControlNode Connection
899 Switch Connection ${devstack_conn_id}
900 ${cmd}= Set Variable neutron flow-classifier-delete ${name}
902 ${output}= Write Commands Until Prompt ${cmd} 30s
905 Should Contain ${output} Deleted flow_classifier
909 [Arguments] ${name} ${port_in} ${port_out}
910 [Documentation] Creates a neutron port pair for SFC
911 ${devstack_conn_id}= Get ControlNode Connection
912 Switch Connection ${devstack_conn_id}
913 ${cmd}= Set Variable neutron port-pair-create --ingress=${port_in} --egress=${port_out} ${name}
915 ${output}= Write Commands Until Prompt ${cmd} 30s
918 Should Contain ${output} Created a new port_pair
923 [Documentation] Delete a SFC port pair
924 ${devstack_conn_id}= Get ControlNode Connection
925 Switch Connection ${devstack_conn_id}
926 ${cmd}= Set Variable neutron port-pair-delete ${name}
928 ${output}= Write Commands Until Prompt ${cmd} 30s
931 Should Contain ${output} Deleted port_pair
934 Create SFC Port Pair Group
935 [Arguments] ${name} ${port_pair}
936 [Documentation] Creates a port pair group with a single port pair for SFC
937 ${devstack_conn_id}= Get ControlNode Connection
938 Switch Connection ${devstack_conn_id}
939 ${cmd}= Set Variable neutron port-pair-group-create --port-pair ${port_pair} ${name}
941 ${output}= Write Commands Until Prompt ${cmd} 30s
944 Should Contain ${output} Created a new port_pair_group
947 Create SFC Port Pair Group With Two Pairs
948 [Arguments] ${name} ${port_pair1} ${port_pair2}
949 [Documentation] Creates a port pair group with two port pairs for SFC
950 ${devstack_conn_id}= Get ControlNode Connection
951 Switch Connection ${devstack_conn_id}
952 ${cmd}= Set Variable neutron port-pair-group-create --port-pair ${port_pair1} --port-pair ${port_pair2} ${name}
954 ${output}= Write Commands Until Prompt ${cmd} 30s
957 Should Contain ${output} Created a new port_pair_group
960 Delete SFC Port Pair Group
962 [Documentation] Delete a SFC port pair group
963 ${devstack_conn_id}= Get ControlNode Connection
964 Switch Connection ${devstack_conn_id}
965 ${cmd}= Set Variable neutron port-pair-group-delete ${name}
967 ${output}= Write Commands Until Prompt ${cmd} 30s
970 Should Contain ${output} Deleted port_pair_group
973 Create SFC Port Chain
974 [Arguments] ${name} ${pg1} ${pg2} ${fc}
975 [Documentation] Creates a port pair chain with two port groups and a singel classifier.
976 ${devstack_conn_id}= Get ControlNode Connection
977 Switch Connection ${devstack_conn_id}
978 ${cmd}= Set Variable neutron port-chain-create --port-pair-group ${pg1} --port-pair-group ${pg2} --flow-classifier ${fc} ${name}
980 ${output}= Write Commands Until Prompt ${cmd} 30s
983 Should Contain ${output} Created a new port_chain
986 Delete SFC Port Chain
988 [Documentation] Delete a SFC port chain
989 ${devstack_conn_id}= Get ControlNode Connection
990 Switch Connection ${devstack_conn_id}
991 ${cmd}= Set Variable neutron port-chain-delete ${name}
993 ${output}= Write Commands Until Prompt ${cmd} 30s
996 Should Contain ${output} Deleted port_chain