SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
Devstack Suite Setup
+ [Arguments] ${source_pwd}=no
[Documentation] Login to the Openstack Control Node to run tempest suite
- SSHLibrary.Open Connection ${DEVSTACK_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT}
+ ${devstack_conn_id}= SSHLibrary.Open Connection ${DEVSTACK_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT}
+ Set Suite Variable ${devstack_conn_id}
+ Set Suite Variable ${source_pwd}
+ Log ${devstack_conn_id}
Utils.Flexible SSH Login ${DEVSTACK_SYSTEM_USER} ${DEVSTACK_SYSTEM_PASSWORD}
SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
Run Keyword If ${CLEAN_DEVSTACK_HOST} Clean DevStack Host In Case It Is Not Sterile
Log ${output}
Should Contain ${output} 64 bytes
+Ping From DHCP Should Not Succeed
+ [Arguments] ${net_name} ${vm_ip}
+ [Documentation] Should Not Reach Vm Instance with the net id of the Netowrk.
+ Log ${vm_ip}
+ Switch Connection ${devstack_conn_id}
+ ${net_id}= Get Net Id ${net_name}
+ Log ${net_id}
+ ${output}= Write Commands Until Prompt sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s
+ Log ${output}
+ Should Not Contain ${output} 64 bytes
+
Ping From Instance
[Arguments] ${dest_vm}
[Documentation] Ping to the expected destination ip.
[Documentation] Create Router and Add Interface to the subnets.
Switch Connection ${devstack_conn_id}
Source Password
- ${output}= Write Commands Until Prompt neutron -v router-create ${router_name}
+ ${output}= Write Commands Until Prompt neutron -v router-create ${router_name} 30s
Should Contain ${output} Created a new router
Add Router Interface
[Documentation] Delete Vm instances using instance names.
Delete Vm Instance VmInstance1_l2_net_1
-Ping All Vm Instances
- [Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id l2_net_1
- : FOR ${VmIpElement} IN @{VM_IPS_NOT_DELETED}
- \ ${output}= Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
-
No Ping For Deleted Vm
[Documentation] Check non reachability of deleted vm instances by pinging to them.
- ${output}= Ping Vm From DHCP Namespace ${net_id} @{NET_1_VM_IPS}[0]
- Should Contain ${output} Destination Host Unreachable
+ ${output}= Ping From DHCP Should Not Succeed l2_network_1 @{NET_1_VM_IPS}[0]
Delete Vm Instances In network_1
[Documentation] Delete Vm instances using instance names in network_1.
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[2]
-Ping Vm Instance In l3_net_1 From l3_net_2
+Ping Vm Instance1 In l3_net_1 From l3_net_2
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[0]
-Ping Vm Instance In l3_net_1 From l3_net_2
+Ping Vm Instance2 In l3_net_1 From l3_net_2
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[1]
-Ping Vm Instance In l3_net_1 From l3_net_2
+Ping Vm Instance3 In l3_net_1 From l3_net_2
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[2]
@{SUBNETS_NAME} l2_subnet_1 l2_subnet_2
@{NET_1_VM_INSTANCES} MyFirstInstance_1 MySecondInstance_1 MyThirdInstance_1
@{NET_2_VM_INSTANCES} MyFirstInstance_2 MySecondInstance_2 MyThirdInstance_2
-@{NET_1_VM_IPS} 30.0.0.3 30.0.0.4 30.0.0.5
-@{NET_2_VM_IPS} 40.0.0.3 40.0.0.4 40.0.0.5
-@{VM_IPS_NOT_DELETED} 30.0.0.4
+@{NET_1_VM_IPS} 30.0.0.3 30.0.0.4 30.0.0.5
+@{NET_2_VM_IPS} 40.0.0.3 40.0.0.4 40.0.0.5
+@{VM_IPS_NOT_DELETED} 30.0.0.4 30.0.0.5
@{GATEWAY_IPS} 30.0.0.1 40.0.0.1
@{DHCP_IPS} 30.0.0.2 40.0.0.2
@{SUBNETS_RANGE} 30.0.0.0/24 40.0.0.0/24
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
+ [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}
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
+ [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}
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
+ [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}
Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
Log ${dst_ip_list}
Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
-Ping All Vm Instances
- [Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id l2_network_1
- : FOR ${VmIpElement} IN @{VM_IPS_NOT_DELETED}
- \ ${output}= Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
+Delete A Vm Instance
+ [Documentation] Delete Vm instances using instance names.
+ Delete Vm Instance MyFirstInstance_1
No Ping For Deleted Vm
[Documentation] Check non reachability of deleted vm instances by pinging to them.
- ${output}= Ping Vm From DHCP Namespace ${net_id} @{NET_1_VM_IPS}[0]
- Should Contain ${output} Destination Host Unreachable
+ ${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_1.
*** Variables ***
@{NETWORKS_NAME} net1_network net2_network
@{SUBNETS_NAME} subnet1 subnet2
-@{VM_INSTANCES_NAME} MyFirstInstance MySecondInstance
+@{NET_1_VM_INSTANCES} MyFirstInstance_1 MySecondInstance_1
+@{NET_2_VM_INSTANCES} MyFirstInstance_2 MySecondInstance_2
@{VM_IPS} 10.0.0.3 20.0.0.3
@{GATEWAY_IPS} 10.0.0.1 20.0.0.1
@{DHCP_IPS} 10.0.0.2 20.0.0.2
+@{SUBNETS_RANGE} 10.0.0.0/24 20.0.0.0/24
*** Test Cases ***
Run Devstack Gate Wrapper
Create Subnets For net1_network
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet net1_network subnet1 10.0.0.0/24
+ Create SubNet net1_network subnet1 @{SUBNETS_RANGE}[0]
Create Subnets For net2_network
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet net2_network subnet2 20.0.0.0/24
+ Create SubNet net2_network subnet2 @{SUBNETS_RANGE}[1]
List Ports
${output}= Write Commands Until Prompt neutron -v port-list
Create Vm Instances For net1_network
[Documentation] Create Vm instances using flavor and image names.
- ${net_id}= Get Net Id net1_network
- Create Vm Instances ${net_id} ${VM_INSTANCES_NAME}
+ Create Vm Instances net1_network ${NET_1_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_1_VM_INSTANCES}
Create Vm Instances For net2_network
[Documentation] Create Vm instances using flavor and image names.
- ${net_id}= Get Net Id net2_network
- Create Vm Instances ${net_id} ${VM_INSTANCES_NAME}
-
-Show Details of Created Vm Instance
- [Documentation] View Details of the created vm instances using nova show.
- : FOR ${VmElement} IN @{VM_INSTANCES_NAME}
- \ ${output}= Write Commands Until Prompt nova show ${VmElement}
- \ Log ${output}
+ Create Vm Instances net2_network ${NET_2_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
Verify Created Vm Instance In Dump Flow
[Documentation] Verify the existence of the created vm instance ips in the dump flow.
Run Keyword If "${ODL_VERSION}" == "lithium-latest" Run Keyword And Ignore Error Verify Dhcp Ips
... ELSE IF "${ODL_VERSION}" != "lithium-latest" Verify Dhcp Ips
-Delete Vm Instances
- [Documentation] Delete Vm instances using instance names.
- : FOR ${VmElement} IN @{VM_INSTANCES_NAME}
+Delete Vm Instances In net1_network
+ [Documentation] Delete Vm instances using instance names in net1_network.
+ : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
+ \ Delete Vm Instance ${VmElement}
+
+Delete Vm Instances In net2_network
+ [Documentation] Delete Vm instances using instance names in net2_network.
+ : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
Verify Deleted Vm Instance Removed In Dump Flow
Delete Router Interfaces
[Documentation] Remove Interface to the subnets.
- Remove Interface router_1
+ : FOR ${interface} IN @{SUBNETS_NAME}
+ \ Remove Interface router_1 ${interface}
Delete Routers
[Documentation] Delete Router and Interface to the subnets.
@{VM_IPS_NOT_DELETED} 30.0.0.4
@{GATEWAY_IPS} 30.0.0.1 40.0.0.1
@{DHCP_IPS} 30.0.0.2 40.0.0.2
+@{SUBNETS_RANGE} 30.0.0.0/24 40.0.0.0/24
*** Test Cases ***
Create Networks
Create Subnets For network_1
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet network_1 subnet_1 30.0.0.0/24
+ Create SubNet network_1 subnet_1 @{SUBNETS_RANGE}[0]
Create Subnets For network_2
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet network_2 subnet_2 40.0.0.0/24
+ Create SubNet network_2 subnet_2 @{SUBNETS_RANGE}[1]
Create Vm Instances For network_1
[Documentation] Create Four Vm instances using flavor and image names for a network.
- ${net_id}= Get Net Id network_1
- Create Vm Instances ${net_id} ${NET_1_VM_INSTANCES}
- View Vm Console ${NET_1_VM_INSTANCES}
+ Create Vm Instances network_1 ${NET_1_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_1_VM_INSTANCES}
Create Vm Instances For network_2
[Documentation] Create Four Vm instances using flavor and image names for a network.
- ${net_id}= Get Net Id network_2
- Set Suite Variable ${net_id}
- Create Vm Instances ${net_id} ${NET_2_VM_INSTANCES}
- View Vm Console ${NET_2_VM_INSTANCES}
+ Create Vm Instances network_2 ${NET_2_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
List Networks With Namespaces
${output}= Write Commands Until Prompt sudo ip netns list
Log ${output}
-Show Details of Created Vm Instance In network_1
- [Documentation] View Details of the created vm instances using nova show.
- : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
- \ ${output}= Write Commands Until Prompt nova show ${VmElement}
- \ Log ${output}
-
-Ping All Vm Instances In network_1
+Ping Vm Instance1 In network_1
[Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id network_1
- : FOR ${VmIpElement} IN @{NET_1_VM_IPS}
- \ ${output} Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
+ Ping Vm From DHCP Namespace network_1 @{NET_1_VM_IPS}[0]
-Show Details of Created Vm Instance In network_2
- [Documentation] View Details of the created vm instances using nova show.
- : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
- \ ${output}= Write Commands Until Prompt nova show ${VmElement}
- \ Log ${output}
-
-Ping All Vm Instances In network_2
+Ping Vm Instance2 In network_1
[Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id network_2
- : FOR ${VmIpElement} IN @{NET_2_VM_IPS}
- \ ${output} Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
-
-Add Key-Pair For Vm Instance
- [Documentation] Creates key pair to ssh to the vm instance.
- ${output}= Write Commands Until Prompt nova keypair-add test > test.pem
- Log ${output}
- ${output}= Write Commands Until Prompt chmod 600 test.pem
- Log ${output}
-
-List The Availalbe Key Pair List
- [Documentation] Check the existing key pairs available.
- ${output}= Write Commands Until Prompt nova keypair-list
- Log ${output}
-
-Login to Vm Instances In network_1 Using Ssh
- [Documentation] Logging to the vm instance using generated key pair.
- ${net_id}= Get Net Id network_1
- Ssh Vm Instance ${net_id} 30.0.0.3
-
-Ping Vm Instance From Instance In network_1
- [Documentation] Check reachability of vm instances by pinging.
- ${output}= Ping From Instance 30.0.0.4
- Should Contain ${output} 64 bytes
+ Ping Vm From DHCP Namespace network_1 @{NET_1_VM_IPS}[1]
-Ping Dhcp Server From Instance In network_1
- [Documentation] ping the dhcp server from instance.
- ${output}= Ping From Instance 30.0.0.2
- Should Contain ${output} 64 bytes
-
-Ping Metadata Server From Instance In network_1
- [Documentation] ping the metadata server from instance.
- Curl Metadata Server
-
-Close Vm Instance In network_1
- [Documentation] Close the connection with Vm Instance in a network.
- Close Vm Instance
-
-Login to Vm Instances In network_2 Using Ssh
- [Documentation] Logging to the vm instance using generated key pair.
- ${net_id}= Get Net Id network_2
- Ssh Vm Instance ${net_id} 40.0.0.3
-
-Ping Vm Instance From Instance In network_2
- [Documentation] Check reachability of vm instances by pinging.
- ${output}= Ping From Instance 40.0.0.4
- Should Contain ${output} 64 bytes
-
-Ping Dhcp Server From Instance In network_2
- [Documentation] ping the dhcp server from instance.
- ${output}= Ping From Instance 40.0.0.2
- Should Contain ${output} 64 bytes
-
-Ping Metadata Server From Instance In network_2
- [Documentation] ping the metadata server from instance.
- Curl Metadata Server
+Ping Vm Instance1 In network_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace network_2 @{NET_2_VM_IPS}[0]
-Close Vm Instance In network_2
- [Documentation] Close the connection with Vm Instance in a network.
- Close Vm Instance
+Ping Vm Instance2 In network_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace network_2 @{NET_2_VM_IPS}[1]
+
+Connectivity Tests From Vm Instance1 In network_1
+ [Documentation] Logging to the vm instance1
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_1
+ [Documentation] Logging to the vm instance2
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance1 In network_2
+ [Documentation] Logging to the vm instance1
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_2
+ [Documentation] Logging to the vm instance2
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
Delete Vm Instance
[Documentation] Delete Vm instances using instance names.
Delete Vm Instance MyFirstInstance_1
-Ping All Vm Instances
- [Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id network_1
- : FOR ${VmIpElement} IN @{VM_IPS_NOT_DELETED}
- \ ${output}= Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
-
No Ping For Deleted Vm
[Documentation] Check non reachability of deleted vm instances by pinging to them.
- ${output}= Ping Vm From DHCP Namespace ${net_id} 30.0.0.3
- Should Contain ${output} Destination Host Unreachable
+ ${output}= Ping Vm From DHCP Namespace ${net_id} @{NET_1_VM_IPS}[0]
Delete Vm Instances In network_1
[Documentation] Delete Vm instances using instance names in network_1.