*** Settings ***
Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
Library SSHLibrary
+Resource Netvirt.robot
Resource Utils.robot
Variables ../variables/Variables.py
Write Commands Until Expected Prompt sudo ovs-ofctl dump-groups br-int -OOpenFlow13 ]>
Write Commands Until Expected Prompt sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13 ]>
+Get Karaf Log Type From Test Start
+ [Arguments] ${ip} ${test_name} ${type} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
+ ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
+ ${cmd} Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file} | grep '${type}'
+ ${output} Run Command On Controller ${ip} ${cmd} ${user} ${password} ${prompt}
+ Log ${output}
+
+Get Karaf Log Types From Test Start
+ [Arguments] ${ip} ${test_name} ${types} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT}
+ ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
+ : FOR ${type} IN @{types}
+ \ Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password}
+ \ ... ${prompt} ${log_file}
+
Get ControlNode Connection
${control_conn_id}= SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT_STRICT}
Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
Run Keyword If 1 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_1_IP}
Run Keyword If 2 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_2_IP}
+Get Test Teardown Debugs
+ [Arguments] ${test_name}=${TEST_NAME}
+ Get OvsDebugInfo
+ Get Model Dump ${ODL_SYSTEM_IP}
+ ${log_types} = Create List ERROR WARN Exception
+ Get Karaf Log Types From Test Start ${ODL_SYSTEM_IP} ${test_name} ${log_types}
+
Show Debugs
[Arguments] @{vm_indices}
[Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node
... AND DevstackUtils.Devstack Suite Setup
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Get OvsDebugInfo
+Test Teardown Get Test Teardown Debugs
Library OperatingSystem
Library RequestsLibrary
Resource ../../../libraries/Utils.robot
Suite Setup Devstack Suite Setup source_pwd=yes
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Run Keywords Get OvsDebugInfo
+Test Teardown Get Test Teardown Debugs
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
Append To List ${NET2_VM_IPS} ${NET2_DHCP_IP}
Set Suite Variable ${NET2_VM_IPS}
[Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
- ... AND Get OvsDebugInfo
+ ... AND Get Test Teardown Debugs
Bring Up ODL2
[Documentation] Bring up ODL2 again
Suite Setup Devstack Suite Setup source_pwd=yes
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Run Keywords Get OvsDebugInfo
+Test Teardown Get Test Teardown Debugs
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
Set Suite Variable ${NET2_L3_VM_IPS}
Set Suite Variable ${NET2_DHCP_IP}
[Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
- ... AND Get OvsDebugInfo
+ ... AND Get Test Teardown Debugs
Bring Up ODL2
[Documentation] Bring up ODL2 again
... AND DevstackUtils.Devstack Suite Setup
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Run Keywords Get OvsDebugInfo
-... AND Get Model Dump ${ODL_SYSTEM_IP}
+Test Teardown Get Test Teardown Debugs
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
Resource ../../../libraries/DevstackUtils.robot
-Resource ../../../libraries/Netvirt.robot
Resource ../../../libraries/OpenStackOperations.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/Utils.robot
Append To List ${NET2_VM_IPS} ${NET2_DHCP_IP}
Set Suite Variable ${NET2_VM_IPS}
[Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
- ... AND Get OvsDebugInfo
- ... AND Get Model Dump ${ODL_SYSTEM_IP}
+ ... AND Get Test Teardown Debugs
Ping Vm Instance1 In l2_network_1
[Documentation] Check reachability of vm instances by pinging to them.
: FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
[Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
- ... AND Get OvsDebugInfo
- ... AND Get Model Dump ${ODL_SYSTEM_IP}
+ ... AND Get Test Teardown Debugs
Delete Sub Networks In l2_network_1
[Documentation] Delete Sub Nets for the Networks with neutron request.
... AND DevstackUtils.Devstack Suite Setup
Suite Teardown Close All Connections
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Run Keywords Get OvsDebugInfo
-... AND Get Model Dump ${ODL_SYSTEM_IP}
+Test Teardown Get Test Teardown Debugs
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
Resource ../../../libraries/DevstackUtils.robot
-Resource ../../../libraries/Netvirt.robot
Resource ../../../libraries/OpenStackOperations.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/Utils.robot
Set Suite Variable ${NET2_L3_VM_IPS}
Set Suite Variable ${NET2_DHCP_IP}
[Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
- ... AND Get OvsDebugInfo
- ... AND Get Model Dump ${ODL_SYSTEM_IP}
+ ... AND Get Test Teardown Debugs
Create Routers
[Documentation] Create Router
: FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
[Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
- ... AND Get OvsDebugInfo
- ... AND Get Model Dump ${ODL_SYSTEM_IP}
+ ... AND Get Test Teardown Debugs
Delete Router Interfaces
[Documentation] Remove Interface to the subnets.
Documentation Test suite to check North-South connectivity in L3 using a router and an external network
Suite Setup Devstack Suite Setup source_pwd=yes
Suite Teardown Close All Connections
-Test Teardown Run Keywords Get OvsDebugInfo
-... AND Get Model Dump ${ODL_SYSTEM_IP}
+Test Teardown Get Test Teardown Debugs
Library SSHLibrary
Library OperatingSystem
Library RequestsLibrary
Resource ../../../libraries/DevstackUtils.robot
-Resource ../../../libraries/Netvirt.robot
Resource ../../../libraries/OpenStackOperations.robot
Resource ../../../libraries/Utils.robot
\ Wait Until Keyword Succeeds 15s 5s Verify VM Is ACTIVE ${vm}
Wait Until Keyword Succeeds 180s 10s Verify VMs Received DHCP Lease @{VM_INSTANCES}
[Teardown] Run Keywords Show Debugs ${VM_INSTANCES}
- ... AND Get OvsDebugInfo
- ... AND Get Model Dump ${ODL_SYSTEM_IP}
+ ... AND Get Test Teardown Debugs
Create And Associate Floating IPs for VMs
[Documentation] Create and associate a floating IP for the VM
${VM_FLOATING_IPS} OpenStackOperations.Create And Associate Floating IPs ${external_net_name} @{VM_INSTANCES}
Set Suite Variable ${VM_FLOATING_IPS}
[Teardown] Run Keywords Show Debugs ${VM_INSTANCES}
- ... AND Get OvsDebugInfo
- ... AND Get Model Dump ${ODL_SYSTEM_IP}
+ ... AND Get Test Teardown Debugs
Ping External Gateway From Control Node
[Documentation] Check reachability of external gateway by pinging it from the control node.
Suite Setup Log In To Tempest Executor And Setup Test Environment
Suite Teardown Clean Up After Running Tempest
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown Get OvsDebugInfo
+Test Teardown Run Keywords Get Test Teardown Debugs
Test Template DevstackUtils.Run Tempest Tests
Library SSHLibrary
Resource ../../../libraries/DevstackUtils.robot