Use a black regex file for tempest test
[integration/test.git] / csit / suites / openstack / tempest / tempest.robot
1 *** Settings ***
2 Documentation     Test suite for running tempest tests. It is assumed that the test environment
3 ...               is already deployed and ready.
4 Suite Setup       Log In To Tempest Executor And Setup Test Environment
5 Suite Teardown    Clean Up After Running Tempest
6 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
7 Test Teardown     Run Keywords    Get Test Teardown Debugs
8 Test Template     DevstackUtils.Run Tempest Tests
9 Library           SSHLibrary
10 Resource          ../../../libraries/DevstackUtils.robot
11 Resource          ../../../libraries/OpenStackOperations.robot
12 Resource          ../../../libraries/SetupUtils.robot
13 Resource          ../../../libraries/Utils.robot
14 Variables         ../../../variables/Variables.py
15
16 *** Variables ***
17 ${blacklist_file}    /tmp/blacklist.txt
18 @{stable/mitaka_exclusion_regexes}    test_routers_negative.RoutersNegativeIpV6Test.test_router_set_gateway_used_ip_returns_409    test_routers_negative.RoutersNegativeTest.test_router_set_gateway_used_ip_returns_409
19 @{stable/newton_exclusion_regexes}    ${EMPTY}
20 ${tempest_config_file}    /opt/stack/tempest/etc/tempest.conf
21 ${external_net_name}    external-net
22 ${external_subnet_name}    external-subnet
23 ${external_gateway}    10.10.10.250
24 ${external_subnet}    10.10.10.0/24
25 ${network_vlan_id}    167
26
27 *** Test Cases ***
28 tempest.api.network
29     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
30
31 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_connectivity_between_vms_on_different_networks
32     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
33
34 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_hotplug_nic
35     [Tags]    skip_if_stable/mitaka
36     # Failing due to default security rules behavior missing in Mitaka
37     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
38
39 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_mtu_sized_frames
40     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
41
42 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops
43     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
44
45 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_preserve_preexisting_port
46     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
47
48 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_router_rescheduling
49     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
50
51 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_subnet_details
52     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
53
54 tempest.scenario.test_aggregates_basic_ops.TestAggregatesBasicOps.test_aggregate_basic_ops
55     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
56
57 tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_pause_unpause
58     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
59
60 tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_stop_start
61     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
62
63 tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_reboot
64     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
65
66 tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_rebuild
67     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
68
69 tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_suspend_resume
70     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
71
72 tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops
73     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
74
75 tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_port_security_macspoofing_port
76     [Tags]    skip_if_transparent    skip_if_stable/mitaka
77     # Failing due to default security rules behavior missing in Mitaka, and also in all transparent runs
78     ${TEST_NAME}    ${blacklist_file}    ${tempest_config_file}
79
80 *** Keywords ***
81 Log In To Tempest Executor And Setup Test Environment
82     [Documentation]    Initialize SetupUtils, open SSH connection to a devstack system and source the openstack
83     ...    credentials needed to run the tempest tests. The (sometimes empty) tempest blacklist file will be created
84     ...    and pushed to the tempest executor.
85     Create Blacklist File
86     SetupUtils.Setup_Utils_For_Setup_And_Teardown
87     # source_pwd is expected to exist in the below Create Network, Create Subnet keywords.    Might be a bug.
88     ${source_pwd}    Set Variable    yes
89     Set Suite Variable    ${source_pwd}
90     # Tempest tests need an existing external network in order to create routers.
91     Create Network    ${external_net_name} --router:external --provider:network_type=vlan --provider:physical_network=${PUBLIC_PHYSICAL_NETWORK} --provider:segmentation_id=${network_vlan_id}
92     Create Subnet    ${external_net_name}    ${external_subnet_name}    ${external_subnet}    --gateway ${external_gateway}
93     List Networks
94     ${control_node_conn_id}=    SSHLibrary.Open Connection    ${OS_CONTROL_NODE_IP}    prompt=${DEFAULT_LINUX_PROMPT_STRICT}
95     Utils.Flexible SSH Login    ${OS_USER}
96     Write Commands Until Prompt    source ${DEVSTACK_DEPLOY_PATH}/openrc admin admin
97     Write Commands Until Prompt    sudo rm -rf /opt/stack/tempest/.testrepository
98     ${net_id}=    Get Net Id    ${external_net_name}    ${control_node_conn_id}
99     Tempest Conf Add External Network    ${net_id}
100
101 Tempest Conf Add External Network
102     [Arguments]    ${external_network_id}
103     [Documentation]    Tempest will be run with a config file - this function will add the
104     ...    given external network ID to the configuration file.
105     Modify Config In File On Existing SSH Connection    ${tempest_config_file}    set    network    public_network_id    ${external_network_id}
106     Modify Config In File On Existing SSH Connection    ${tempest_config_file}    set    DEFAULT    debug    False
107     Modify Config In File On Existing SSH Connection    ${tempest_config_file}    set    DEFAULT    log_level    INFO
108     Write Commands Until Prompt    sudo cat ${tempest_config_file}
109     Write Commands Until Prompt    sudo chmod 777 ${tempest_config_file}
110
111 Modify Config In File On Existing SSH Connection
112     [Arguments]    ${config_file}    ${modifier}    ${config_section}    ${config_key}    ${config_value}=${EMPTY}
113     [Documentation]    uses crudini to populate oslo cofg file.
114     # this keyword is only one line so seems like extra overhead, but this may be a good candidate to move
115     # to a library at some point, when/if other suites need to use it, so wanted to make it generic.
116     Write Commands Until Prompt    sudo -E crudini --${modifier} ${config_file} ${config_section} ${config_key} ${config_value}
117
118 Clean Up After Running Tempest
119     [Documentation]    Clean up any extra leftovers that were created to allow tempest tests to run.
120     Delete Network    ${external_net_name}
121     List Networks
122     Close All Connections
123
124 Create Blacklist File
125     [Documentation]    For each exclusion regex in the required @{${OPENSTACK_BRANCH}_exclusion_regexes} list a new
126     ...    line will be created in the required ${blacklist_file} location. This file is pushed to the OS_CONTROL_NODE
127     ...    which is assumed to be the tempest executor.
128     Create File    ${blacklist_file}
129     : FOR    ${exclusion}    IN    @{${OPENSTACK_BRANCH}_exclusion_regexes}
130     \    Append To File    ${blacklist_file}    ${exclusion}\n
131     Log File    ${blacklist_file}
132     SSHKeywords.Copy File To Remote System    ${OS_CONTROL_NODE_IP}    ${blacklist_file}    ${blacklist_file}