write tempest output to file to use as job artifact
[integration/test.git] / csit / libraries / DevstackUtils.robot
index 62ef262093b4a93361681991b8eda1cb5180c596..8b495c7d9e27c196585629cd54ecc048fc94202a 100644 (file)
@@ -24,14 +24,23 @@ ${CLEAN_DEVSTACK_HOST}    False
 *** Keywords ***
 Run Tempest Tests
     [Arguments]    ${tempest_regex}    ${timeout}=600s
+    [Documentation]  Execute the tempest tests
     Write Commands Until Prompt    cd /opt/stack/new/tempest
     Write Commands Until Prompt    sudo rm -rf /opt/stack/new/tempest/.testrepository
     Write Commands Until Prompt    sudo testr init
     ${results}=    Write Commands Until Prompt    sudo -E testr run ${tempest_regex} --subunit | subunit-trace --no-failure-debug -f    timeout=${timeout}
+    Create File    ${WORKSPACE}/tempest_output.log    data=${results}
     Should Contain    ${results}    Failed: 0
     # TODO: also need to verify some non-zero pass count as well as other results are ok (e.g. skipped, etc)
 
+Devstack Suite Setup Tests
+    [Documentation]  Login to  the Openstack Control Node to run tempest suite
+    SSHLibrary.Open Connection    ${OS_CONTROL_NODE_IP}    prompt=${DEFAULT_LINUX_PROMPT}
+    Utils.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
+    SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
+
 Devstack Suite Setup
+    [Documentation]  Login to  the Openstack Control Node to run tempest suite
     SSHLibrary.Open Connection    ${DEVSTACK_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}
     Utils.Flexible SSH Login    ${DEVSTACK_SYSTEM_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
     SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
@@ -95,6 +104,7 @@ Write Commands Until Prompt
     [Return]    ${output}
 
 Get Networking ODL Version Of Release
+    [Documentation]   Get version of ODL to be installed
     [Arguments]    ${version}
     # once Beryllium SR1 goes out, we can change beryllium-latest to use 0.4.2
     Return From Keyword If    "${version}" == "beryllium-latest"    beryllium-snapshot-0.4.2
@@ -110,6 +120,7 @@ Get Networking ODL Version Of Release
     Return From Keyword If    "${version}" == "helium"    helium
 
 Show Devstack Debugs
+    [Documentation]   Collect the devstack logs to debug in case of failure
     Write Commands Until Prompt    gunzip /opt/stack/logs/devstacklog.txt.gz
     Write Commands Until Prompt    tail -n2000 /opt/stack/logs/devstacklog.txt    timeout=600s
     Write Commands Until Prompt    grep 'distribution-karaf.*zip' /opt/stack/logs/devstacklog.txt