blob: cfa71e3a1c57534e060035c8e3fc3b8f19a97a06 [file] [log] [blame]
Alexa0053b92022-10-14 16:38:28 -05001#!/bin/bash
2tenv=mos
3. /opt/si-tests/.sivenv/bin/activate
4cd $MY_PROJFOLDER/tmp
5. $MY_PROJFOLDER/env.sh
6. $MY_PROJFOLDER/envs/${tenv}rc
7# Just in case
8unset TARGET_CLUSTER
9unset TARGET_NAMESPACE
Alex876e93a2022-12-21 12:02:13 -060010# Cleaning up
11echo "# Cleaning up '/artifacts/tmp/artifacts/'"
12[ -d "/artifacts/tmp/artifacts/" ] && rm -rf "/artifacts/tmp/artifacts/"
13[ -f "/artifacts/tmp/nosetests.xml" ] && rm "/artifacts/tmp/nosetests.xml"
14mkdir "/artifacts/tmp/artifacts/"
Alexa0053b92022-10-14 16:38:28 -050015
16#
17echo "# Creating schema"
18[ -f "/artifacts/tmp/artifacts/test_scheme.yaml" ] && rm -v $MY_PROJFOLDER/tmp/artifacts/test_scheme.yaml
19cat <<'EOF' >artifacts/test_scheme.yaml
20---
21smoke: true
22concurrency: 4
23blacklist-file: /etc/tempest/test-blacklist
24enabled: true
25fail_on_test: true
26type: tempest
27# regex: test
28EOF
29cat artifacts/test_scheme.yaml
30echo " "
Alex2c8b8802022-10-20 14:07:15 -050031env | grep TEMPEST_
32echo " "
Alexa0053b92022-10-14 16:38:28 -050033#
34echo "# Checking auto-allocation"
35cmd="openstack network auto allocated topology create --check-resources"
36kubectl -n qa-space exec toolset --stdin -- $cmd
37if [ $? -ne 0 ]; then
38 cmd="openstack network set --default --external ${TEMPEST_CUSTOM_PUBLIC_NET}"
39 echo "# Trying to set network: '${cmd}'"
40 kubectl -n qa-space exec toolset --stdin -- $cmd
41 echo "# Checking again"
42 cmd="openstack network auto allocated topology create --check-resources"
43 kubectl -n qa-space exec toolset --stdin -- $cmd
44 [ $? -ne 0 ] && printf "\n\n# WARNING: Check functional tests pod for errors on test init\n\n"
45fi
46
47# run tests
Alex2c8b8802022-10-20 14:07:15 -050048pytest -vv /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py
Alexa0053b92022-10-14 16:38:28 -050049deactivate
50
51# report
52if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then
53 echo "# Generating repors"
54 yes | rm $MY_PROJFOLDER/reports/${tenv}-func/*
55else
56 mkdir $MY_PROJFOLDER/reports/${tenv}-func
57fi
58cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/
59cd $MY_PROJFOLDER/reports/
60tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-smoke-latest.html $MY_PROJFOLDER/reports/${tenv}-func/
61cd $MY_PROJFOLDER