: FOR ${VmElement} IN @{vm_instance_names}
\ ${output}= Write Commands Until Prompt nova boot --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${VmElement} --security-groups ${sg} 30s
\ Log ${output}
- \ Wait Until Keyword Succeeds 25s 5s Verify VM Is ACTIVE ${VmElement}
Create Vm Instance With Port On Compute Node
[Arguments] ${port_name} ${vm_instance_name} ${compute_node} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.nano ${sg}=default
Verify VM Is ACTIVE
[Arguments] ${vm_name}
[Documentation] Run these commands to check whether the created vm instance is active or not.
+ ${devstack_conn_id}= Get ControlNode Connection
+ Switch Connection ${devstack_conn_id}
${output}= Write Commands Until Prompt nova show ${vm_name} | grep OS-EXT-STS:vm_state 30s
Log ${output}
Should Contain ${output} active
+Verify VMs Received DHCP Lease
+ [Arguments] @{vm_list}
+ [Documentation] Using nova console-log on the provided ${vm_name} to search for the string "obtained" which
+ ... correlates to the instance receiving it's IP address via DHCP. This should provide a good indication
+ ... that the instance is fully up and ready.
+ ${devstack_conn_id}= Get ControlNode Connection
+ Switch Connection ${devstack_conn_id}
+ : FOR ${vm} IN @{vm_list}
+ \ ${output}= Write Commands Until Prompt nova console-log ${vm} | grep -i "obtained" 30s
+ \ Log ${output}
+ \ Should Contain ${output} obtained
+
View Vm Console
[Arguments] ${vm_instance_names}
[Documentation] View Console log of the created vm instances using nova show.
... AND DevstackUtils.Devstack Suite Setup Tests
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
-... AND Show Debugs ${NET_2_VM_INSTANCES}
-... AND Get OvsDebugInfo
+Test Teardown Get OvsDebugInfo
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
[Documentation] Create Four Vm instances using flavor and image names for a network.
Create Vm Instances l2_network_2 ${NET_2_VM_INSTANCES} sg=csit
+Check Vm Instances Have Ip Address
+ [Documentation] Test case to verify that all created VMs are ready and have received their ip addresses.
+ ... We are polling first and longest on the last VM created assuming that if it's received it's address
+ ... already the other instances should have theirs already or at least shortly thereafter.
+ # first, ensure all VMs are in ACTIVE state. if not, we can just fail the test case and not waste time polling
+ # for dhcp addresses
+ : FOR ${vm} IN @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
+ \ Wait Until Keyword Succeeds 15s 5s Verify VM Is ACTIVE ${vm}
+ Wait Until Keyword Succeeds 180s 10s Verify VMs Received DHCP Lease @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
+ [Teardown] Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
+ ... AND Show Debugs ${NET_2_VM_INSTANCES}
+ ... AND Get OvsDebugInfo
+
Ping Vm Instance1 In l2_network_1
[Documentation] Check reachability of vm instances by pinging to them.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace l2_network_1 @{NET_1_VM_IPS}[0]
Ping Vm Instance2 In l2_network_1
[Documentation] Check reachability of vm instances by pinging to them.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace l2_network_1 @{NET_1_VM_IPS}[1]
Ping Vm Instance3 In l2_network_1
[Documentation] Check reachability of vm instances by pinging to them.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace l2_network_1 @{NET_1_VM_IPS}[2]
Ping Vm Instance1 In l2_network_2
[Documentation] Check reachability of vm instances by pinging to them.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace l2_network_2 @{NET_2_VM_IPS}[0]
Ping Vm Instance2 In l2_network_2
[Documentation] Check reachability of vm instances by pinging to them.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace l2_network_2 @{NET_2_VM_IPS}[1]
Ping Vm Instance3 In l2_network_2
[Documentation] Check reachability of vm instances by pinging to them.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace l2_network_2 @{NET_2_VM_IPS}[2]
Connectivity Tests From Vm Instance1 In l2_network_1
[Documentation] Logging to the vm instance1
${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
Log ${dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
Connectivity Tests From Vm Instance2 In l2_network_1
[Documentation] Logging to the vm instance2
${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
Log ${dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
Connectivity Tests From Vm Instance3 In l2_network_1
[Documentation] Logging to the vm instance2
${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
Log ${dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
Connectivity Tests From Vm Instance1 In l2_network_2
[Documentation] Logging to the vm instance using generated key pair.
${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
Log ${dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
Connectivity Tests From Vm Instance2 In l2_network_2
[Documentation] Logging to the vm instance using generated key pair.
${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
Log ${dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
Connectivity Tests From Vm Instance3 In l2_network_2
[Documentation] Logging to the vm instance using generated key pair.
${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
Log ${dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
Delete A Vm Instance
No Ping For Deleted Vm
[Documentation] Check non reachability of deleted vm instances by pinging to them.
- Get OvsDebugInfo
${output}= Ping From DHCP Should Not Succeed l2_network_1 @{NET_1_VM_IPS}[0]
Delete Vm Instances In l2_network_1
[Documentation] Delete Vm instances using instance names in l2_network_2.
: FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
+ [Teardown] Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
+ ... AND Show Debugs ${NET_2_VM_INSTANCES}
+ ... AND Get OvsDebugInfo
Delete Sub Networks In l2_network_1
[Documentation] Delete Sub Nets for the Networks with neutron request.
... AND DevstackUtils.Devstack Suite Setup Tests
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
-... AND Show Debugs ${NET_2_VM_INSTANCES}
-... AND Get OvsDebugInfo
+Test Teardown Get OvsDebugInfo
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
[Documentation] Create Four Vm instances using flavor and image names for a network.
Create Vm Instances network_2 ${NET_2_VM_INSTANCES} sg=csit
+Check Vm Instances Have Ip Address
+ [Documentation] Test case to verify that all created VMs are ready and have received their ip addresses.
+ ... We are polling first and longest on the last VM created assuming that if it's received it's address
+ ... already the other instances should have theirs already or at least shortly thereafter.
+ # first, ensure all VMs are in ACTIVE state. if not, we can just fail the test case and not waste time polling
+ # for dhcp addresses
+ : FOR ${vm} IN @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
+ \ Wait Until Keyword Succeeds 15s 5s Verify VM Is ACTIVE ${vm}
+ Wait Until Keyword Succeeds 180s 10s Verify VMs Received DHCP Lease @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
+ [Teardown] Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
+ ... AND Show Debugs ${NET_2_VM_INSTANCES}
+ ... AND Get OvsDebugInfo
+
Create Routers
[Documentation] Create Router
Create Router router_1
Ping Vm Instance1 In network_2 From network_1
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[0]
Ping Vm Instance2 In network_2 From network_1
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[1]
Ping Vm Instance3 In network_2 From network_1
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[2]
Ping Vm Instance1 In network_1 From network_2
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[0]
Ping Vm Instance2 In network_1 From network_2
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[1]
Ping Vm Instance3 In network_1 From network_2
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- Get OvsDebugInfo
Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[2]
Connectivity Tests From Vm Instance1 In network_1
Log ${dst_ip_list}
${other_dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
Log ${other_dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Connectivity Tests From Vm Instance2 In network_1
Log ${dst_ip_list}
${other_dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
Log ${other_dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Connectivity Tests From Vm Instance3 In network_1
Log ${dst_ip_list}
${other_dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
Log ${other_dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Connectivity Tests From Vm Instance1 In network_2
Log ${dst_ip_list}
${other_dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
Log ${other_dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Connectivity Tests From Vm Instance2 In network_2
Log ${dst_ip_list}
${other_dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
Log ${other_dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Connectivity Tests From Vm Instance3 In network_2
Log ${dst_ip_list}
${other_dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
Log ${other_dst_ip_list}
- Get OvsDebugInfo
Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Delete Vm Instances In network_1
[Documentation] Delete Vm instances using instance names in network_2.
: FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
+ [Teardown] Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
+ ... AND Show Debugs ${NET_2_VM_INSTANCES}
+ ... AND Get OvsDebugInfo
Delete Router Interfaces
[Documentation] Remove Interface to the subnets.