Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | tenv=mos |
| 3 | . /opt/si-tests/.sivenv/bin/activate |
| 4 | cd $MY_PROJFOLDER/tmp |
| 5 | . $MY_PROJFOLDER/env.sh |
| 6 | . $MY_PROJFOLDER/envs/${tenv}rc |
| 7 | # Just in case |
| 8 | unset TARGET_CLUSTER |
| 9 | unset TARGET_NAMESPACE |
Alex | 876e93a | 2022-12-21 12:02:13 -0600 | [diff] [blame] | 10 | # Cleaning up |
| 11 | echo "# 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" |
| 14 | mkdir "/artifacts/tmp/artifacts/" |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 15 | |
| 16 | # |
| 17 | echo "# Creating schema" |
| 18 | [ -f "/artifacts/tmp/artifacts/test_scheme.yaml" ] && rm -v $MY_PROJFOLDER/tmp/artifacts/test_scheme.yaml |
| 19 | cat <<'EOF' >artifacts/test_scheme.yaml |
| 20 | --- |
| 21 | smoke: true |
| 22 | concurrency: 4 |
| 23 | blacklist-file: /etc/tempest/test-blacklist |
| 24 | enabled: true |
| 25 | fail_on_test: true |
| 26 | type: tempest |
| 27 | # regex: test |
| 28 | EOF |
| 29 | cat artifacts/test_scheme.yaml |
| 30 | echo " " |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 31 | env | grep TEMPEST_ |
| 32 | echo " " |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 33 | # |
| 34 | echo "# Checking auto-allocation" |
| 35 | cmd="openstack network auto allocated topology create --check-resources" |
| 36 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 37 | if [ $? -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" |
| 45 | fi |
| 46 | |
| 47 | # run tests |
Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 48 | pytest -vv /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py |
Alex | a0053b9 | 2022-10-14 16:38:28 -0500 | [diff] [blame] | 49 | deactivate |
| 50 | |
| 51 | # report |
| 52 | if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then |
| 53 | echo "# Generating repors" |
| 54 | yes | rm $MY_PROJFOLDER/reports/${tenv}-func/* |
| 55 | else |
| 56 | mkdir $MY_PROJFOLDER/reports/${tenv}-func |
| 57 | fi |
| 58 | cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/ |
| 59 | cd $MY_PROJFOLDER/reports/ |
| 60 | tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-smoke-latest.html $MY_PROJFOLDER/reports/${tenv}-func/ |
| 61 | cd $MY_PROJFOLDER |