Fix featuresBoot parameter in nitrogen tests
[integration/test.git] / csit / libraries / DevstackUtils.robot
index 2913e6f302dba5a39abf86634a78f3bdb9b75a63..8f08bc55daab4b10dd98ef58b7c362dfe2f60f7b 100644 (file)
@@ -9,6 +9,7 @@ Library           RequestsLibrary
 Library           ./UtilLibrary.py
 Resource          KarafKeywords.robot
 Resource          OpenStackOperations.robot
+Resource          SSHKeywords.robot
 Variables         ../variables/Variables.py
 
 *** Variables ***
@@ -17,18 +18,21 @@ ${DEVSTACK_SYSTEM_PASSWORD}    \    # set to empty, but provide for others to ov
 
 *** Keywords ***
 Run Tempest Tests
-    [Arguments]    ${tempest_regex}    ${tempest_exclusion_regex}=""    ${tempest_conf}=""    ${tempest_directory}=/opt/stack/tempest    ${timeout}=600s
+    [Arguments]    ${tempest_regex}    ${exclusion_file}=/dev/null    ${tempest_conf}=""    ${tempest_directory}=/opt/stack/tempest    ${timeout}=600s
     [Documentation]    Execute the tempest tests.
     Return From Keyword If    "skip_if_${OPENSTACK_BRANCH}" in @{TEST_TAGS}
     Return From Keyword If    "skip_if_${SECURITY_GROUP_MODE}" in @{TEST_TAGS}
     ${devstack_conn_id}=    Get ControlNode Connection
     Switch Connection    ${devstack_conn_id}
+    # There seems to be a bug in the mitaka version of os-testr that does not allow --regex to work in conjunction
+    # with a blacklist-file. Upgrading with pip should resolve this. This can probably go away once mitaka is no
+    # longer tested in this environment. But, while it's being tested the mitaka devstack setup will be bringing
+    # in this broken os-testr, so we manually upgrade here.
+    Write Commands Until Prompt    sudo pip install os-testr --upgrade    timeout=120s
     Write Commands Until Prompt    source ${DEVSTACK_DEPLOY_PATH}/openrc admin admin
     Write Commands Until Prompt    cd ${tempest_directory}
     # From Ocata and moving forward, we can replace 'ostestr' with 'tempest run'
-    # Note: If black-regex cancels out the entire regex (white-regex), all tests are run
-    # --black-regex ${tempest_exclusion_regex} is removed for now since it only seems to work from newton
-    ${results}=    Write Commands Until Prompt    ostestr --regex ${tempest_regex}    timeout=${timeout}
+    ${results}=    Write Commands Until Prompt    ostestr --regex ${tempest_regex} -b ${exclusion_file}    timeout=${timeout}
     Log    ${results}
     # Save stdout to file
     Create File    tempest_output_${tempest_regex}.log    data=${results}
@@ -51,14 +55,15 @@ Devstack Suite Setup
     Set Suite Variable    ${devstack_conn_id}
     Set Suite Variable    ${source_pwd}
     Log    ${devstack_conn_id}
-    Utils.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
+    SSHKeywords.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
     SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
 
 Write Commands Until Prompt
     [Arguments]    ${cmd}    ${timeout}=${default_devstack_prompt_timeout}
     [Documentation]    quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable
+    Log    ${cmd}
     SSHLibrary.Set Client Configuration    timeout=${timeout}
     SSHLibrary.Read
-    SSHLibrary.Write    ${cmd}
+    SSHLibrary.Write    ${cmd};echo Command Returns $?
     ${output}=    SSHLibrary.Read Until Prompt
     [Return]    ${output}