[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}
BuiltIn.Wait Until Keyword Succeeds 30s 10s Wait For Routes To Propogate ${NETWORKS} ${SUBNET_CIDRS}
${prefix_net10} = Replace String @{SUBNET_CIDRS}[0] ::/64 (:[a-f0-9]{,4}){,4}
${status} ${message} Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 3x 60s OpenStackOperations.Collect VM IPv6 SLAAC Addresses
- ... true ${prefix_net10} @{NET_1_VMS}
+ ... fail_on_none=true vm_list=${NET_1_VMS} network=@{NETWORKS}[0] subnet=${prefix_net10}
${prefix_net20} = Replace String @{SUBNET_CIDRS}[1] ::/64 (:[a-f0-9]{,4}){,4}
${status} ${message} Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 3x 60s OpenStackOperations.Collect VM IPv6 SLAAC Addresses
- ... true ${prefix_net20} @{NET_2_VMS}
- ${VM_IP_NET10} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses false ${prefix_net10} @{NET_1_VMS}
- ${VM_IP_NET20} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses false ${prefix_net20} @{NET_2_VMS}
+ ... fail_on_none=true vm_list=${NET_2_VMS} network=@{NETWORKS}[1] subnet=${prefix_net20}
+ ${VM_IP_NET10} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses fail_on_none=false vm_list=${NET_1_VMS} network=@{NETWORKS}[0] subnet=${prefix_net10}
+ ${VM_IP_NET20} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses fail_on_none=false vm_list=${NET_2_VMS} network=@{NETWORKS}[1] subnet=${prefix_net20}
${VM_INSTANCES} = Collections.Combine Lists ${NET_1_VMS} ${NET_2_VMS}
${VM_IPS}= Collections.Combine Lists ${VM_IP_NET10} ${VM_IP_NET20}
${LOOP_COUNT} BuiltIn.Get Length ${NET_1_VMS}