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 Test Netcat Operations From Vm Instance
428 [Arguments] ${net_name} ${vm_ip} ${dest_ip} ${additional_args}=${EMPTY} ${port}=12345 ${user}=cirros
429 ... ${password}=cubswin:)
430 [Documentation] Use Netcat to test TCP/UDP connections to the controller
431 ${client_data} Set Variable Test Client Data
432 ${server_data} Set Variable Test Server Data
433 ${devstack_conn_id}= Get ControlNode Connection
434 Switch Connection ${devstack_conn_id}
436 ${output}= Write Commands Until Prompt ( ( echo "${server_data}" | sudo timeout 60 nc -l ${additional_args} ${port} ) & )
438 ${output}= Write Commands Until Prompt sudo netstat -nlap | grep ${port}
440 ${nc_output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo echo "${client_data}" | nc -v -w 5 ${additional_args} ${dest_ip} ${port}
442 ${output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo route -n
444 ${output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo arp -an
446 Should Match Regexp ${nc_output} ${server_data}
449 [Arguments] ${list_of_external_dst_ips}
450 [Documentation] Check reachability with other network's instances.
451 ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance
452 : FOR ${dest_ip} IN @{list_of_external_dst_ips}
454 \ Check Ping ${dest_ip}
457 [Arguments] ${router_name}
458 [Documentation] Create Router and Add Interface to the subnets.
459 ${devstack_conn_id}= Get ControlNode Connection
460 Switch Connection ${devstack_conn_id}
461 ${output}= Write Commands Until Prompt neutron -v router-create ${router_name} 30s
463 Should Contain ${output} Created a new router
466 [Documentation] List Router and return output with neutron client.
467 ${devstack_conn_id}= Get ControlNode Connection
468 Switch Connection ${devstack_conn_id}
469 ${output}= Write Commands Until Prompt neutron router-list 30s
475 [Arguments] ${router_name} ${interface_name}
476 ${devstack_conn_id}= Get ControlNode Connection
477 Switch Connection ${devstack_conn_id}
478 ${output}= Write Commands Until Prompt neutron -v router-interface-add ${router_name} ${interface_name}
480 Should Contain ${output} Added interface
482 Show Router Interface
483 [Arguments] ${router_name}
484 [Documentation] List Router interface associated with given Router and return output with neutron client.
485 ${devstack_conn_id}= Get ControlNode Connection
486 Switch Connection ${devstack_conn_id}
487 ${output}= Write Commands Until Prompt neutron router-port-list ${router_name} -f csv 30s
493 [Arguments] ${router_name} ${network_name}
494 ${devstack_conn_id}= Get ControlNode Connection
495 Switch Connection ${devstack_conn_id}
496 ${output}= Write Commands Until Prompt neutron -v router-gateway-set ${router_name} ${network_name}
498 Should Contain ${output} Set gateway
501 [Arguments] ${router_name} ${interface_name}
502 [Documentation] Remove Interface to the subnets.
503 ${devstack_conn_id}= Get ControlNode Connection
504 Switch Connection ${devstack_conn_id}
505 ${output}= Write Commands Until Prompt neutron -v router-interface-delete ${router_name} ${interface_name}
507 Should Contain ${output} Removed interface from router
510 [Arguments] ${router_name} ${cmd}
511 [Documentation] Update the router with the command. Router name and command should be passed as argument.
512 ${devstack_conn_id} = Get ControlNode Connection
513 Switch Connection ${devstack_conn_id}
514 ${output} = Write Commands Until Prompt neutron router-update ${router_name} ${cmd} 30s
516 Should Contain ${output} Updated
519 [Arguments] ${router_name} ${options}
520 [Documentation] Show information of a given router. Router name and optional fields should be sent as arguments.
521 ${devstack_conn_id} = Get ControlNode Connection
522 Switch Connection ${devstack_conn_id}
523 ${output} = Write Commands Until Prompt neutron router-show ${router_name} ${options} 30s
528 [Arguments] ${router_name}
529 [Documentation] Delete Router and Interface to the subnets.
530 ${devstack_conn_id}= Get ControlNode Connection
531 Switch Connection ${devstack_conn_id}
532 ${output}= Write Commands Until Prompt neutron -v router-delete ${router_name} 60s
534 Should Match Regexp ${output} Deleted router: ${router_name}|Deleted router\\(s\\): ${router_name}
536 Get DumpFlows And Ovsconfig
537 [Arguments] ${openstack_node_ip}
538 [Documentation] Get the OvsConfig and Flow entries from OVS from the Openstack Node
539 Log ${openstack_node_ip}
540 SSHLibrary.Open Connection ${openstack_node_ip} prompt=${DEFAULT_LINUX_PROMPT}
541 Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
542 SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
543 Write Commands Until Expected Prompt ip -o link ${DEFAULT_LINUX_PROMPT_STRICT}
544 Write Commands Until Expected Prompt ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT}
545 Write Commands Until Expected Prompt ip route ${DEFAULT_LINUX_PROMPT_STRICT}
546 Write Commands Until Expected Prompt arp -an ${DEFAULT_LINUX_PROMPT_STRICT}
547 ${nslist}= Write Commands Until Expected Prompt ip netns list | awk '{print $1}' ${DEFAULT_LINUX_PROMPT_STRICT}
548 @{lines} Split To Lines ${nslist}
549 : FOR ${line} IN @{lines}
550 \ Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o link ${DEFAULT_LINUX_PROMPT_STRICT}
551 \ Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT}
552 \ Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT}
553 Write Commands Until Expected Prompt sudo ovs-vsctl show ${DEFAULT_LINUX_PROMPT_STRICT}
554 Write Commands Until Expected Prompt sudo ovs-vsctl list Open_vSwitch ${DEFAULT_LINUX_PROMPT_STRICT}
555 Write Commands Until Expected Prompt sudo ovs-ofctl show br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
556 Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
557 Write Commands Until Expected Prompt sudo ovs-ofctl dump-groups br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
558 Write Commands Until Expected Prompt sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT}
560 Get Karaf Log Type From Test Start
561 [Arguments] ${ip} ${test_name} ${type} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
562 ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
563 ${cmd} Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file} | grep '${type}'
564 ${output} Run Command On Controller ${ip} ${cmd} ${user} ${password} ${prompt}
567 Get Karaf Log Types From Test Start
568 [Arguments] ${ip} ${test_name} ${types} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
569 ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
570 : FOR ${type} IN @{types}
571 \ Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password}
572 \ ... ${prompt} ${log_file}
574 Get Karaf Log Events From Test Start
575 [Arguments] ${test_name} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
576 ${log_types} = Create List ERROR WARN Exception
577 Run Keyword If 0 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_IP} ${test_name} ${log_types}
578 Run Keyword If 1 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_2_IP} ${test_name} ${log_types}
579 Run Keyword If 2 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_3_IP} ${test_name} ${log_types}
581 Get ControlNode Connection
582 ${control_conn_id}= SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT_STRICT}
583 Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
584 SSHLibrary.Set Client Configuration timeout=30s
585 Source Password force=yes
586 [Return] ${control_conn_id}
589 [Documentation] Get the OvsConfig and Flow entries from all Openstack nodes
590 Run Keyword If 0 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_CONTROL_NODE_IP}
591 Run Keyword If 1 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_1_IP}
592 Run Keyword If 2 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_2_IP}
594 Get Test Teardown Debugs
595 [Arguments] ${test_name}=${TEST_NAME}
597 Run Keyword And Ignore Error Get Model Dump ${HA_PROXY_IP} ${netvirt_data_models}
598 Get Karaf Log Events From Test Start ${test_name}
600 Get Suite Teardown Debugs
602 Get Model Dump ${HA_PROXY_IP} ${netvirt_data_models}
605 [Arguments] @{vm_indices}
606 [Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node
607 ${devstack_conn_id}= Get ControlNode Connection
608 Switch Connection ${devstack_conn_id}
609 ${output}= Write Commands Until Prompt sudo ip netns list
611 : FOR ${index} IN @{vm_indices}
612 \ ${output}= Write Commands Until Prompt nova show ${index} 30s
620 Create Security Group
621 [Arguments] ${sg_name} ${desc}
622 ${devstack_conn_id}= Get ControlNode Connection
623 Switch Connection ${devstack_conn_id}
624 ${output}= Write Commands Until Prompt nova secgroup-create ${sg_name} ${desc} 40s
628 [Arguments] ${direction} ${protocol} ${min_port} ${max_port} ${remote_ip} ${sg_name}
629 ${devstack_conn_id}= Get ControlNode Connection
630 Switch Connection ${devstack_conn_id}
631 ${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}
634 Neutron Security Group Show
635 [Arguments] ${SecurityGroupRuleName} ${additional_args}=${EMPTY}
636 [Documentation] Displays the neutron security group configurations that belongs to a given neutron security group name
637 ${devstack_conn_id}= Get ControlNode Connection
638 Switch Connection ${devstack_conn_id}
639 ${cmd}= Set Variable neutron security-group-show ${SecurityGroupRuleName} ${additional_args}
641 ${output}= Write Commands Until Prompt ${cmd} 30s
647 [Arguments] ${PortName} ${additional_args}=${EMPTY}
648 [Documentation] Display the port configuration that belong to a given neutron port
649 ${devstack_conn_id}= Get ControlNode Connection
650 Switch Connection ${devstack_conn_id}
651 ${cmd}= Set Variable neutron port-show ${PortName} ${additional_args}
653 ${output}= Write Commands Until Prompt ${cmd} 30s
658 Neutron Security Group Create
659 [Arguments] ${SecurityGroupName} ${additional_args}=${EMPTY}
660 [Documentation] Create a security group with specified name ,description & protocol value according to security group template
661 ${devstack_conn_id}= Get ControlNode Connection
662 Switch Connection ${devstack_conn_id}
663 ${cmd}= Set Variable neutron security-group-create ${SecurityGroupName} ${additional_args}
665 ${output}= Write Commands Until Prompt ${cmd} 30s
667 Should Contain ${output} Created a new security_group
668 ${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}
671 [Return] ${output} ${sgp_id}
673 Neutron Security Group Update
674 [Arguments] ${SecurityGroupName} ${additional_args}=${EMPTY}
675 [Documentation] Updating security groups
676 ${devstack_conn_id}= Get ControlNode Connection
677 Switch Connection ${devstack_conn_id}
678 ${cmd}= Set Variable neutron security-group-update ${SecurityGroupName} ${additional_args}
680 ${output}= Write Commands Until Prompt ${cmd} 30s
686 [Arguments] ${sg_name}
687 [Documentation] Delete Security group
688 ${devstack_conn_id}= Get ControlNode Connection
689 Switch Connection ${devstack_conn_id}
690 ${output}= Write Commands Until Prompt neutron security-group-delete ${sg_name} 40s
692 Should Match Regexp ${output} Deleted security_group: ${sg_name}|Deleted security_group\\(s\\): ${sg_name}
695 Neutron Security Group Rule Create
696 [Arguments] ${Security_group_name} &{Kwargs}
697 [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]} ..."
698 ${devstack_conn_id}= Get ControlNode Connection
699 Switch Connection ${devstack_conn_id}
700 Run Keyword If ${Kwargs} Log ${Kwargs}
701 ${description} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} description default=${None}
702 ${direction} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} direction default=${None}
703 ${ethertype} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} ethertype default=${None}
704 ${port_range_max} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} port_range_max default=${None}
705 ${port_range_min} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} port_range_min default=${None}
706 ${protocol} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} protocol default=${None}
707 ${remote_group_id} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} remote_group_id default=${None}
708 ${remote_ip_prefix} Run Keyword If ${Kwargs} Pop From Dictionary ${Kwargs} remote_ip_prefix default=${None}
709 ${cmd}= Set Variable neutron security-group-rule-create ${Security_group_name}
710 ${cmd}= Run Keyword If '${description}'!='None' Catenate ${cmd} --description ${description}
711 ... ELSE Catenate ${cmd}
712 ${cmd}= Run Keyword If '${direction}'!='None' Catenate ${cmd} --direction ${direction}
713 ... ELSE Catenate ${cmd}
714 ${cmd}= Run Keyword If '${ethertype}'!='None' Catenate ${cmd} --ethertype ${ethertype}
715 ... ELSE Catenate ${cmd}
716 ${cmd}= Run Keyword If '${port_range_max}'!='None' Catenate ${cmd} --port_range_max ${port_range_max}
717 ... ELSE Catenate ${cmd}
718 ${cmd}= Run Keyword If '${port_range_min}'!='None' Catenate ${cmd} --port_range_min ${port_range_min}
719 ... ELSE Catenate ${cmd}
720 ${cmd}= Run Keyword If '${protocol}'!='None' Catenate ${cmd} --protocol ${protocol}
721 ... ELSE Catenate ${cmd}
722 ${cmd}= Run Keyword If '${remote_group_id}'!='None' Catenate ${cmd} --remote_group_id ${remote_group_id}
723 ... ELSE Catenate ${cmd}
724 ${cmd}= Run Keyword If '${remote_ip_prefix}'!='None' Catenate ${cmd} --remote_ip_prefix ${remote_ip_prefix}
725 ... ELSE Catenate ${cmd}
726 ${output}= Write Commands Until Prompt ${cmd} 30s
727 ${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}
729 Should Contain ${output} Created a new security_group_rule
731 [Return] ${output} ${rule_id}
733 Create Neutron Port With Additional Params
734 [Arguments] ${network_name} ${port_name} ${additional_args}=${EMPTY}
735 [Documentation] Create Port With given additional parameters
736 ${devstack_conn_id}= Get ControlNode Connection
737 Switch Connection ${devstack_conn_id}
738 ${cmd}= Set Variable neutron -v port-create ${network_name} --name ${port_name} ${additional_args}
740 ${OUTPUT}= Write Commands Until Prompt ${cmd} 30s
742 Should Contain ${output} Created a new port
743 ${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}
746 [Return] ${OUTPUT} ${port_id}
749 [Arguments] ${portName_list}
750 [Documentation] Retrieve the port MacAddr for the given list of port name and return the MAC address list.
751 ${devstack_conn_id}= Get ControlNode Connection
752 Switch Connection ${devstack_conn_id}
753 ${MacAddr-list} Create List
754 : FOR ${portName} IN @{portName_list}
755 \ ${macAddr}= OpenStackOperations.Get Port Mac ${portName} ${devstack_conn_id}
756 \ Append To List ${MacAddr-list} ${macAddr}
757 [Return] ${MacAddr-list}
760 [Arguments] ${port_name}
761 [Documentation] Keyword would return the IP of the ${port_name} received.
762 Switch Connection ${devstack_conn_id}
763 ${output}= Write Commands Until Prompt neutron port-list | grep "${port_name}" | awk '{print $11}' | awk -F "\\"" '{print $2}' 30s
765 ${splitted_output}= Split String ${output} ${EMPTY}
766 ${port_ip}= Get from List ${splitted_output} 0
771 [Arguments] ${port_name} ${conn_id}=${devstack_conn_id}
772 [Documentation] Keyword would return the MAC ID of the ${port_name} received.
773 Switch Connection ${conn_id}
774 ${output}= Write Commands Until Prompt neutron port-list | grep "${port_name}" | awk '{print $6}' 30s
776 ${splitted_output}= Split String ${output} ${EMPTY}
777 ${port_mac}= Get from List ${splitted_output} 0
782 [Arguments] ${bridge_name} ${intf_name} ${gw_name}
783 [Documentation] Keyword to create an L2 Gateway ${gw_name} for bridge ${bridge_name} connected to interface ${intf_name} (Using Neutron CLI).
784 Switch Connection ${devstack_conn_id}
785 ${l2gw_output}= Write Commands Until Prompt ${L2GW_CREATE} name=${bridge_name},interface_names=${intf_name} ${gw_name} 30s
787 [Return] ${l2gw_output}
789 Create L2Gateway Connection
790 [Arguments] ${gw_name} ${net_name}
791 [Documentation] Keyword would create a new L2 Gateway Connection for ${gw_name} to ${net_name} (Using Neutron CLI).
792 Switch Connection ${devstack_conn_id}
793 ${l2gw_output}= Write Commands Until Prompt ${L2GW_CONN_CREATE} ${gw_name} ${net_name} 30s
795 [Return] ${l2gw_output}
798 [Documentation] Keyword to return all the L2 Gateways available (Using Neutron CLI).
799 Switch Connection ${devstack_conn_id}
800 ${output}= Write Commands Until Prompt ${L2GW_GET_YAML} 30s
803 Get All L2Gateway Connection
804 [Documentation] Keyword to return all the L2 Gateway connections available (Using Neutron CLI).
805 Switch Connection ${devstack_conn_id}
806 ${output}= Write Commands Until Prompt ${L2GW_GET_CONN_YAML} 30s
811 [Documentation] Keyword to check if the ${gw_id} is available in the L2 Gateway list (Using Neutron CLI).
812 Switch Connection ${devstack_conn_id}
813 ${output}= Write Commands Until Prompt ${L2GW_SHOW} ${gw_id} 30s
818 [Arguments] ${l2gw_name}
819 [Documentation] Keyword to retrieve the L2 Gateway ID for the ${l2gw_name} (Using Neutron CLI).
820 Switch Connection ${devstack_conn_id}
821 ${output}= Write Commands Until Prompt ${L2GW_GET} | grep "${l2gw_name}" | awk '{print $2}' 30s
823 ${splitted_output}= Split String ${output} ${EMPTY}
824 ${l2gw_id}= Get from List ${splitted_output} 0
828 Get L2gw Connection Id
829 [Arguments] ${l2gw_name}
830 [Documentation] Keyword to retrieve the L2 Gateway Connection ID for the ${l2gw_name} (Using Neutron CLI).
831 Switch Connection ${devstack_conn_id}
832 ${l2gw_id}= OpenStackOperations.Get L2gw Id ${l2gw_name}
833 ${output}= Write Commands Until Prompt ${L2GW_GET_CONN} | grep "${l2gw_id}" | awk '{print $2}' 30s
835 ${splitted_output}= Split String ${output} ${EMPTY}
836 ${l2gw_conn_id}= Get from List ${splitted_output} 0
838 [Return] ${l2gw_conn_id}
840 Neutron Port List Rest
841 [Documentation] Keyword to get all ports details in Neutron (Using REST).
842 ${resp} = RequestsLibrary.Get Request session ${PORT_URL}
844 Should Be Equal As Strings ${resp.status_code} 200
845 [Return] ${resp.content}
847 Get Neutron Port Rest
848 [Arguments] ${port_id}
849 [Documentation] Keyword to get the specific port details in Neutron (Using REST).
850 ${resp} = RequestsLibrary.Get Request session ${CONFIG_API}/${GET_PORT_URL}/${port_id}
852 Should Be Equal As Strings ${resp.status_code} 200
853 [Return] ${resp.content}
856 [Arguments] ${port_id} ${json_data}
857 [Documentation] Keyword to update ${port_id} with json data received in ${json_data} (Using REST).
859 ${resp} = RequestsLibrary.Put Request session ${CONFIG_API}/${GET_PORT_URL}/${port_id} ${json_data}
861 Should Be Equal As Strings ${resp.status_code} 200
862 [Return] ${resp.content}
864 Create And Configure Security Group
865 [Arguments] ${sg-name}
866 Neutron Security Group Create ${sg-name}
867 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
868 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
869 Neutron Security Group Rule Create ${sg-name} direction=ingress protocol=icmp remote_ip_prefix=0.0.0.0/0
870 Neutron Security Group Rule Create ${sg-name} direction=egress protocol=icmp remote_ip_prefix=0.0.0.0/0
871 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
872 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
874 Create SFC Flow Classifier
875 [Arguments] ${name} ${src_ip} ${dest_ip} ${protocol} ${dest_port} ${neutron_src_port}
876 [Documentation] Create a flow classifier for SFC
877 ${devstack_conn_id}= Get ControlNode Connection
878 Switch Connection ${devstack_conn_id}
879 ${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}
881 ${output}= Write Commands Until Prompt ${cmd} 30s
884 Should Contain ${output} Created a new flow_classifier
887 Delete SFC Flow Classifier
889 [Documentation] Delete a SFC flow classifier
890 ${devstack_conn_id}= Get ControlNode Connection
891 Switch Connection ${devstack_conn_id}
892 ${cmd}= Set Variable neutron flow-classifier-delete ${name}
894 ${output}= Write Commands Until Prompt ${cmd} 30s
897 Should Contain ${output} Deleted flow_classifier
901 [Arguments] ${name} ${port_in} ${port_out}
902 [Documentation] Creates a neutron port pair for SFC
903 ${devstack_conn_id}= Get ControlNode Connection
904 Switch Connection ${devstack_conn_id}
905 ${cmd}= Set Variable neutron port-pair-create --ingress=${port_in} --egress=${port_out} ${name}
907 ${output}= Write Commands Until Prompt ${cmd} 30s
910 Should Contain ${output} Created a new port_pair
915 [Documentation] Delete a SFC port pair
916 ${devstack_conn_id}= Get ControlNode Connection
917 Switch Connection ${devstack_conn_id}
918 ${cmd}= Set Variable neutron port-pair-delete ${name}
920 ${output}= Write Commands Until Prompt ${cmd} 30s
923 Should Contain ${output} Deleted port_pair
926 Create SFC Port Pair Group
927 [Arguments] ${name} ${port_pair}
928 [Documentation] Creates a port pair group with a single port pair for SFC
929 ${devstack_conn_id}= Get ControlNode Connection
930 Switch Connection ${devstack_conn_id}
931 ${cmd}= Set Variable neutron port-pair-group-create --port-pair ${port_pair} ${name}
933 ${output}= Write Commands Until Prompt ${cmd} 30s
936 Should Contain ${output} Created a new port_pair_group
939 Create SFC Port Pair Group With Two Pairs
940 [Arguments] ${name} ${port_pair1} ${port_pair2}
941 [Documentation] Creates a port pair group with two port pairs for SFC
942 ${devstack_conn_id}= Get ControlNode Connection
943 Switch Connection ${devstack_conn_id}
944 ${cmd}= Set Variable neutron port-pair-group-create --port-pair ${port_pair1} --port-pair ${port_pair2} ${name}
946 ${output}= Write Commands Until Prompt ${cmd} 30s
949 Should Contain ${output} Created a new port_pair_group
952 Delete SFC Port Pair Group
954 [Documentation] Delete a SFC port pair group
955 ${devstack_conn_id}= Get ControlNode Connection
956 Switch Connection ${devstack_conn_id}
957 ${cmd}= Set Variable neutron port-pair-group-delete ${name}
959 ${output}= Write Commands Until Prompt ${cmd} 30s
962 Should Contain ${output} Deleted port_pair_group
965 Create SFC Port Chain
966 [Arguments] ${name} ${pg1} ${pg2} ${fc}
967 [Documentation] Creates a port pair chain with two port groups and a singel classifier.
968 ${devstack_conn_id}= Get ControlNode Connection
969 Switch Connection ${devstack_conn_id}
970 ${cmd}= Set Variable neutron port-chain-create --port-pair-group ${pg1} --port-pair-group ${pg2} --flow-classifier ${fc} ${name}
972 ${output}= Write Commands Until Prompt ${cmd} 30s
975 Should Contain ${output} Created a new port_chain
978 Delete SFC Port Chain
980 [Documentation] Delete a SFC port chain
981 ${devstack_conn_id}= Get ControlNode Connection
982 Switch Connection ${devstack_conn_id}
983 ${cmd}= Set Variable neutron port-chain-delete ${name}
985 ${output}= Write Commands Until Prompt ${cmd} 30s
988 Should Contain ${output} Deleted port_chain
992 [Arguments] ${vm_name}
993 [Documentation] Reboot NOVA VM
994 ${devstack_conn_id}= Get ControlNode Connection
995 Switch Connection ${devstack_conn_id}
996 ${output}= Write Commands Until Prompt nova reboot --poll ${vm_name} 30s
998 Wait Until Keyword Succeeds 35s 10s Verify VM Is ACTIVE ${vm_name}
1001 Remove RSA Key From KnowHosts
1002 [Arguments] ${vm_ip}
1003 [Documentation] Remove RSA
1004 ${devstack_conn_id}= Get ControlNode Connection
1005 Switch Connection ${devstack_conn_id}
1006 ${output}= Write Commands Until Prompt sudo cat /root/.ssh/known_hosts 30s
1008 ${output}= Write Commands Until Prompt sudo ssh-keygen -f "/root/.ssh/known_hosts" -R ${vm_ip} 30s
1010 ${output}= Write Commands Until Prompt sudo cat "/root/.ssh/known_hosts" 30s