Alex | 2c8b880 | 2022-10-20 14:07:15 -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 |
| 10 | |
| 11 | # |
| 12 | echo "# Creating schema" |
| 13 | [ -f "/artifacts/tmp/artifacts/test_scheme.yaml" ] && rm -v $MY_PROJFOLDER/tmp/artifacts/test_scheme.yaml |
| 14 | cat <<'EOF' >artifacts/test_scheme.yaml |
| 15 | --- |
| 16 | smoke: false |
| 17 | concurrency: 8 |
| 18 | blacklist-file: /etc/tempest/test-blacklist |
| 19 | enabled: true |
| 20 | fail_on_test: true |
| 21 | type: tempest |
| 22 | # regex: test |
| 23 | EOF |
| 24 | cat artifacts/test_scheme.yaml |
| 25 | echo " " |
| 26 | env | grep TEMPEST_ |
| 27 | echo " " |
| 28 | # |
| 29 | echo "# Checking auto-allocation" |
| 30 | cmd="openstack network auto allocated topology create --check-resources" |
| 31 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 32 | if [ $? -ne 0 ]; then |
| 33 | cmd="openstack network set --default --external ${TEMPEST_CUSTOM_PUBLIC_NET}" |
| 34 | echo "# Trying to set network: '${cmd}'" |
| 35 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 36 | echo "# Checking again" |
| 37 | cmd="openstack network auto allocated topology create --check-resources" |
| 38 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 39 | [ $? -ne 0 ] && printf "\n\n# WARNING: Check functional tests pod for errors on test init\n\n" |
| 40 | fi |
| 41 | |
| 42 | # run tests |
| 43 | pytest -vv /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py |
| 44 | deactivate |
| 45 | |
| 46 | # report |
| 47 | if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then |
| 48 | echo "# Generating repors" |
| 49 | yes | rm $MY_PROJFOLDER/reports/${tenv}-func/* |
| 50 | else |
| 51 | mkdir $MY_PROJFOLDER/reports/${tenv}-func |
| 52 | fi |
| 53 | cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/ |
| 54 | cd $MY_PROJFOLDER/reports/ |
| 55 | tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-full-latest.html $MY_PROJFOLDER/reports/${tenv}-func/ |
| 56 | cd $MY_PROJFOLDER |