1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
3 # Copyright (c) 2019 Nokia. #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you maynot use this file except in compliance with the License. #
8 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ##############################################################################
22 Library OperatingSystem
28 ${REPORTDIR} ${LOG_PATH}/${SUITE_NAME.replace(' ','_')}
30 ${WORKDIR} ${TEMPDIR}/tempest-run/${WORKSPACE}
35 Create Directory ${WORKDIR}
36 ${result}= Run Process tempest init --name ${WORKSPACE} ${WORKDIR}
37 Should Be Equal As Integers ${result.rc} 0
40 Run Process tempest workspace remove --name ${WORKSPACE}
41 Remove Directory ${WORKDIR} recursive=True
43 Create Tempest Configuration File
44 ${env}= Get Deployment Credential Variables
45 ${result}= Run Process discover-tempest-config
47 ... --out ${WORKDIR}/etc/tempest.conf
48 ... DEFAULT.log_dir ${WORKDIR}/logs
49 ... DEFAULT.log_file tempest.log
50 ... oslo_concurrency.lock_path ${WORKDIR}/tempest_lock
51 ... auth.use_dynamic_credentials true
53 Should Be Equal As Integers ${result.rc} 0
55 Get Deployment Credential Variables
56 ${env}= Get Environment Variables
57 ${openrc}= Get File /root/openrc
58 ${str}= Get Lines Matching Regexp ${openrc} ^export .*
59 @{lines}= Split To Lines ${str}
60 :FOR ${line} IN @{lines}
61 \ ${str}= Remove String Using Regexp ${line} ^export${SPACE}
62 \ ${key} ${value} Split String ${str} separator==
63 \ Set To Dictionary ${env} ${key}=${value}
64 Should Not Be Empty ${env}
67 Run Tempest Refstack Tests
68 ${result}= Run Process tempest run
69 ... --workspace ${WORKSPACE}
70 ... --load-list ${CURDIR}/test_list.txt
71 ... --blacklist-file ${CURDIR}/blacklist.txt
73 ... stdout=${WORKDIR}/logs/tempest_run.log
75 Copy Files ${WORKDIR}/logs/* ${REPORTDIR}/
76 Copy Files ${WORKDIR}/etc/tempest.conf ${REPORTDIR}/
77 Run Process subunit2html ${WORKDIR}/.stestr/0 ${REPORTDIR}/tempest_report.html
78 Should Contain ${result.stdout} - Failed: 0