@@ -23,6 +23,8 @@ declare -A config_directories=(
23
23
[" openstack" ]=" $HOME /src/openstack-config"
24
24
)
25
25
26
+ tempest_dir=" $HOME /tempest-artifacts"
27
+
26
28
function activate_virt_env () {
27
29
set +u
28
30
source $$ {virtual_environments[$1 ]}
@@ -138,11 +140,36 @@ set +x
138
140
export KAYOBE_AUTOMATION_SSH_PRIVATE_KEY=$( cat ~ /.ssh/id_rsa)
139
141
set -x
140
142
143
+ if [[ -d $tempest_dir ]]; then
144
+ tempest_backup=$$ {tempest_dir}.$( date --iso-8601=minutes)
145
+ echo " Found previous Tempest test results"
146
+ echo " Moving to $tempest_backup "
147
+ mv $tempest_dir $tempest_backup
148
+ fi
149
+
141
150
# Run tempest
142
- sudo -E docker run --detach --rm --network host -v $$ {config_directories[kayobe]}:/stack/kayobe-automation-env/src/kayobe-config -v ~ /tempest-artifacts :/stack/tempest-artifacts -e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY kayobe:latest /stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/tempest.sh -e ansible_user=stack
151
+ sudo -E docker run --name kayobe_tempest -- detach --rm --network host -v $$ {config_directories[kayobe]}:/stack/kayobe-automation-env/src/kayobe-config -v $tempest_dir :/stack/tempest-artifacts -e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY kayobe:latest /stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/tempest.sh -e ansible_user=stack
143
152
144
153
# During the initial deployment the seed node must receive the `gwee/rally` image before we can follow the logs.
145
154
# Therefore, we must wait a reasonable amount time before attempting to do so.
146
155
sleep 360
147
156
148
- ssh -oStrictHostKeyChecking=no ${ ssh_user } @${ seed_addr } ' sudo docker logs --follow tempest'
157
+ if ! ssh -oStrictHostKeyChecking=no ${ ssh_user } @${ seed_addr } ' sudo docker logs --follow tempest' ; then
158
+ echo " Failed to follow Tempest container logs after waiting 360 seconds"
159
+ echo " Ignoring - this may or may not indicate an error"
160
+ fi
161
+
162
+ # Wait for Kayobe Tempest pipeline to complete to ensure artifacts exist.
163
+ sudo docker container wait kayobe_tempest
164
+
165
+ if [[ ! -f $tempest_dir /failed-tests ]]; then
166
+ echo " Unable to find Tempest test results in $tempest_dir /failed-tests"
167
+ exit 1
168
+ fi
169
+
170
+ if [[ $( wc -l < $tempest_dir /failed-tests) -ne 0 ]]; then
171
+ echo " Some Tempest tests failed"
172
+ exit 1
173
+ fi
174
+
175
+ echo " Tempest testing successful"
0 commit comments