Resource DataModels.robot
Resource DevstackUtils.robot
Resource L2GatewayOperations.robot
+Resource OVSDB.robot
Resource SetupUtils.robot
Resource SSHKeywords.robot
Resource Utils.robot
... the full listing is logged first, then followed by a grep | cut to focus on the actual hostname to return
${rc} ${output} Run And Return Rc And Output openstack hypervisor list
Log ${output}
- ${rc} ${hostname}= Run And Return Rc And Output openstack hypervisor list -f value | grep ${hypervisor_ip} | cut -d" " -f 2
+ ${rc} ${hostname}= Run And Return Rc And Output openstack hypervisor list -f value | grep "${hypervisor_ip} " | cut -d" " -f 2
Log ${hostname}
Should Be True '${rc}' == '0'
[Return] ${hostname}
[Return] @{vm_ips} ${ips_and_console_log[1]}
Collect VM IPv6 SLAAC Addresses
- [Arguments] ${fail_on_none} ${prefix} @{vm_list}
- [Documentation] Using the console-log on the provided ${vm_list} to search for the string "inet6" which
- ... correlates to the instance generated IPv6 address, based on the ${prefix} received from ODL (SLAAC mode).
- ${ip_list} Create List @{EMPTY}
+ [Arguments] ${fail_on_none} ${vm_list} ${network} ${subnet}
+ [Documentation] For each VM parse output of "openstack server show" to get its IPv6 address from Neutron DB.
+ ... Then try to connect to each VM by SSH and execute there "ip -6 a" command. This double-check allows to
+ ... obtain and compare IP info (Neutron DB vs dnsmasque/ODL DHCP) and to test L2 connectivity as well.
+ ... Returns an empty list if no IPv6 addresses found or if SSH connection fails.
+ ... Otherwise, returns a list of IPv6 addresses.
+ ${ipv6_list} Create List @{EMPTY}
: FOR ${vm} IN @{vm_list}
- \ Log ${vm}
- \ ${rc} ${vm_ip_line}= Run And Return Rc And Output openstack console log show ${vm} | grep -i "inet6"
- \ Log ${vm_ip_line}
- \ Log ${rc}
- \ @{vm_ip_list} Get Regexp Matches ${vm_ip_line} ${prefix}
- \ ${vm_ip_length} Get Length ${vm_ip_list}
- \ Run Keyword If ${vm_ip_length}>0 Append To List ${ip_list} @{vm_ip_list}[0]
- \ ... ELSE Append To List ${ip_list} None
- \ Log ${ip_list}
- Run Keyword If '${fail_on_none}' == 'true' Should Not Contain ${ip_list} None
- Log ${ip_list}
- [Return] ${ip_list}
+ \ ${rc} ${output}= Run And Return Rc And Output openstack server show ${vm} -f shell
+ \ Log ${output}
+ \ Should Be True '${rc}' == '0'
+ \ ${pattern}= Replace String ${subnet} ::/64 (:[a-f0-9]{,4}){,4}
+ \ @{vm_ipv6}= Get Regexp Matches ${output} ${pattern}
+ \ ${vm_ip_length} Get Length ${vm_ipv6}[0]
+ \ ${ipv6_data_from_vm}= Run Keyword If ${vm_ip_length}>0 Execute Command on VM Instance ${network} ${vm_ipv6[0]}
+ \ ... ip -6 a
+ \ @{ipv6}= Get Regexp Matches ${ipv6_data_from_vm} ${pattern}
+ \ ${ipv6_addr_list_length} Get Length @{ipv6}
+ \ Run Keyword If ${ipv6_addr_list_length}>0 Append To List ${ipv6_list} ${ipv6[0]}
+ \ ... ELSE Append To List ${ipv6_list} None
+ [Return] ${ipv6_list}
View Vm Console
[Arguments] ${vm_instance_names}
OpenStack Suite Setup
[Documentation] Wrapper teardown keyword that can be used in any suite running in an openstack environement
SetupUtils.Setup_Utils_For_Setup_And_Teardown
+ Run Keyword If "${PRE_CLEAN_OPENSTACK_ALL}"=="True" OpenStack Cleanup All
DevstackUtils.Devstack Suite Setup
+ Add OVS Logging On All OpenStack Nodes
OpenStack Suite Teardown
[Documentation] Wrapper teardown keyword that can be used in any suite running in an openstack environement
\ ${status} ${output} Run Keyword And Ignore Error Builtin.Should Contain ${CONTROLLERFEATURES} ${feature}
\ Return From Keyword If "${status}" == "PASS" True
[Return] False
+
+Add OVS Logging On All OpenStack Nodes
+ [Documentation] Add higher levels of OVS logging to all the OpenStack nodes
+ Run Keyword If 0 < ${NUM_OS_SYSTEM} OVSDB.Add OVS Logging ${OS_CNTL_CONN_ID}
+ Run Keyword If 1 < ${NUM_OS_SYSTEM} OVSDB.Add OVS Logging ${OS_CMP1_CONN_ID}
+ Run Keyword If 2 < ${NUM_OS_SYSTEM} OVSDB.Add OVS Logging ${OS_CMP2_CONN_ID}
+
+Reset OVS Logging On All OpenStack Nodes
+ [Documentation] Reset the OVS logging to all the OpenStack nodes
+ Run Keyword If 0 < ${NUM_OS_SYSTEM} OVSDB.Reset OVS Logging ${OS_CNTL_CONN_ID}
+ Run Keyword If 1 < ${NUM_OS_SYSTEM} OVSDB.Reset OVS Logging ${OS_CMP1_CONN_ID}
+ Run Keyword If 2 < ${NUM_OS_SYSTEM} OVSDB.Reset OVS Logging ${OS_CMP2_CONN_ID}