*** Settings ***
Documentation Test suite to verify packet flows between vm instances.
-Suite Setup Devstack Suite Setup Tests source_pwd=yes
+Suite Setup Devstack Suite Setup source_pwd=yes
Suite Teardown Close All Connections
-Test Teardown Run Keywords Show Debugs ${NET_1_VM_IPS}
-... AND Show Debugs ${NET_2_VM_IPS}
-... AND Get OvsDebugInfo
+Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown Get Test Teardown Debugs
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
Resource ../../../libraries/OVSDB.robot
Resource ../../../libraries/ClusterOvsdb.robot
Resource ../../../libraries/ClusterManagement.robot
+Resource ../../../libraries/SetupUtils.robot
Variables ../../../variables/Variables.py
*** Variables ***
@{SUBNETS_NAME} l2_sub_net_1 l2_sub_net_2
@{NET_1_VM_INSTANCES} VmInstance1_l2_net_1 VmInstance2_net_1 VmInstance3_net_1
@{NET_2_VM_INSTANCES} VmInstance1_l2_net_2 VmInstance2_net_2 VmInstance3_net_2
-@{NET_1_VM_IPS} 70.0.0.3 70.0.0.4 70.0.0.5
-@{NET_2_VM_IPS} 80.0.0.3 80.0.0.4 80.0.0.5
@{VM_IPS_NOT_DELETED} 70.0.0.4
-@{GATEWAY_IPS} 70.0.0.1 80.0.0.1
-@{DHCP_IPS} 70.0.0.2 80.0.0.2
@{cluster_down_list} ${1} ${2}
@{SUBNETS_RANGE} 70.0.0.0/24 80.0.0.0/24
+${SECURITY_GROUP} sg-clustering
*** Test Cases ***
Create All Controller Sessions
[Documentation] Create sessions for all three contorllers.
ClusterManagement.ClusterManagement Setup
-Check OVS Manager Connection Status
- [Documentation] This will verify if the OVS manager is connected
- ${output}= Wait Until Keyword Succeeds 5s 1s Ovsdb.Verify OVS Reports Connected ${OS_CONTROL_NODE_IP}
- Log ${output}
- Set Suite Variable ${status} is_connected: true
- ${dictionary}= Create Dictionary ${status}=9
- Utils.Check Item Occurrence ${output} ${dictionary}
-
Create Networks
[Documentation] Create Network with neutron request.
: FOR ${NetworkElement} IN @{NETWORKS_NAME}
[Documentation] Create Sub Nets for the Networks with neutron request.
OpenStackOperations.Create SubNet l2_net_2 l2_sub_net_2 @{SUBNETS_RANGE}[1]
+Add Ssh Allow Rule
+ [Documentation] Allow all TCP/UDP/ICMP packets for this suite
+ OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
+
Create Bridge Manually and Verify Before Fail
[Documentation] Create bridge with OVS command and verify it gets applied from all instances.
ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP}
[Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP} ${new_cluster_list}
-Create Vm Instances For l2_net_1
- [Documentation] Create Vm instances using flavor and image names for a network.
- Log ${devstack_conn_id}
- OpenStackOperations.Create Vm Instances l2_net_1 ${NET_1_VM_INSTANCES} sg=csit
-
Bring Up ODL1
[Documentation] Bring up ODL1 again
ClusterManagement.Start Single Member 1
Create Vm Instances For l2_net_2
[Documentation] Create Vm instances using flavor and image names for a network.
- OpenStackOperations.Create Vm Instances l2_net_2 ${NET_2_VM_INSTANCES} sg=csit
+ OpenStackOperations.Create Vm Instances l2_net_2 ${NET_2_VM_INSTANCES} sg=${SECURITY_GROUP}
+
+Create Vm Instances For l2_net_1
+ [Documentation] Create Vm instances using flavor and image names for a network.
+ Log ${devstack_conn_id}
+ OpenStackOperations.Create Vm Instances l2_net_1 ${NET_1_VM_INSTANCES} sg=${SECURITY_GROUP}
+
+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
+ @{NET1_VM_IPS} ${NET1_DHCP_IP} = Get VM IPs @{NET_1_VM_INSTANCES}
+ @{NET2_VM_IPS} ${NET2_DHCP_IP} = Get VM IPs @{NET_2_VM_INSTANCES}
+ Set Suite Variable @{NET1_VM_IPS}
+ Set Suite Variable @{NET2_VM_IPS}
+ Should Not Contain ${NET1_VM_IPS} None
+ Should Not Contain ${NET2_VM_IPS} None
+ Should Not Contain ${NET1_DHCP_IP} None
+ Should Not Contain ${NET2_DHCP_IP} None
+ [Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
+ ... AND Get Test Teardown Debugs
Bring Up ODL2
[Documentation] Bring up ODL2 again
Connectivity Tests From Vm Instance1 In l2_net_1
[Documentation] Logging to the vm instance using generated key pair.
- ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
- Log ${dst_ip_list}
- Get OvsDebugInfo
- OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
+ OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[0] ${NET_1_VM_IPS}
Connectivity Tests From Vm Instance2 In l2_net_1
[Documentation] Logging to the vm instance using generated key pair.
- ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
- Log ${dst_ip_list}
- Get OvsDebugInfo
- OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
+ OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[1] ${NET_1_VM_IPS}
Connectivity Tests From Vm Instance3 In l2_net_1
[Documentation] Logging to the vm instance using generated key pair.
- ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
- Log ${dst_ip_list}
- Get OvsDebugInfo
- OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
+ OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[2] ${NET_1_VM_IPS}
Bring Up ODL3
[Documentation] Bring up ODL3 again
Connectivity Tests From Vm Instance1 In l2_net_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
- OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
+ OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[0] ${NET_2_VM_IPS}
Connectivity Tests From Vm Instance2 In l2_net_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
- OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
+ OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[1] ${NET_2_VM_IPS}
Connectivity Tests From Vm Instance3 In l2_net_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
- OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
+ OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[2] ${NET_2_VM_IPS}
Bring Up ODL1 and ODL2
[Documentation] Bring up ODL1 and ODL2 again.
No Ping For Deleted Vm
[Documentation] Check non reachability of deleted vm instances by pinging to them.
- ${output}= OpenStackOperations.Ping From DHCP Should Not Succeed l2_network_1 @{NET_1_VM_IPS}[0]
+ ${output}= OpenStackOperations.Ping From DHCP Should Not Succeed l2_net_1 @{NET_1_VM_IPS}[0]
Delete Vm Instances In network_1
[Documentation] Delete Vm instances using instance names in network_1.
[Documentation] Delete Networks with neutron request.
: FOR ${NetworkElement} IN @{NETWORKS_NAME}
\ OpenStackOperations.Delete Network ${NetworkElement}
+
+Verify Flows Cleanup
+ [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
+ Verify Flows Are Cleaned Up On All OpenStack Nodes