Skip to content

Commit 952df5c

Browse files
committed
Run StackHPC OpenStack tests after deployment
1 parent 95f15f4 commit 952df5c

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

templates/deploy-openstack.tpl

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ declare -A config_directories=(
2424
)
2525

2626
tempest_dir="$HOME/tempest-artifacts"
27+
sot_results_dir="$HOME/sot-results"
2728
lock_path=/tmp/deploy-openstack.lock
2829
rc_path=/tmp/deploy-openstack.rc
2930

@@ -194,17 +195,42 @@ fi
194195
# Wait for Kayobe Tempest pipeline to complete to ensure artifacts exist.
195196
sudo docker container wait kayobe_tempest
196197

197-
if [[ ! -f $tempest_dir/failed-tests ]]; then
198-
echo "Unable to find Tempest test results in $tempest_dir/failed-tests"
199-
exit 1
198+
activate_virt_env "kayobe"
199+
activate_kayobe_env
200+
201+
if [[ -d $sot_results_dir ]]; then
202+
sot_results_backup=$${sot_results_dir}.$(date --iso-8601=minutes)
203+
echo "Found previous StackHPC OpenStack test results"
204+
echo "Moving to $sot_results_backup"
205+
mv $sot_results_dir $sot_results_backup
200206
fi
201207

202-
if [[ $(wc -l < $tempest_dir/failed-tests) -ne 0 ]]; then
208+
# Run StackHPC OpenStack tests
209+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/stackhpc-openstack-tests.yml
210+
211+
rc=0
212+
echo "Tempest test results are available in $tempest_dir"
213+
if [[ ! -f $tempest_dir/failed-tests ]]; then
214+
echo "Unable to find Tempest test results in $tempest_dir/failed-tests"
215+
rc=1
216+
elif [[ $(wc -l < $tempest_dir/failed-tests) -ne 0 ]]; then
203217
echo "Some Tempest tests failed"
204-
exit 1
218+
rc=1
219+
else
220+
echo "Tempest testing successful"
205221
fi
206222

207-
echo "Tempest testing successful"
223+
echo "StackHPC OpenStack test results are available in $sot_results_dir"
224+
if [[ ! -f $sot_results_dir/failed-tests ]]; then
225+
echo "Unable to find StackHPC OpenStack test results in $sot_results_dir/failed-tests"
226+
rc=1
227+
elif [[ $(wc -l < $sot_results_dir/failed-tests) -ne 0 ]]; then
228+
echo "Some StackHPC OpenStack tests failed"
229+
rc=1
230+
else
231+
echo "StackHPC OpenStack testing successful"
232+
fi
208233

209234
# Report success.
210-
echo 0 >$rc_path
235+
echo "Writing result to $rc_path"
236+
echo $rc >$rc_path

0 commit comments

Comments
 (0)