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 |
| 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: true |
| 17 | concurrency: 4 |
| 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 | # |
| 27 | echo "# Checking auto-allocation" |
| 28 | cmd="openstack network auto allocated topology create --check-resources" |
| 29 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 30 | if [ $? -ne 0 ]; then |
| 31 | cmd="openstack network set --default --external ${TEMPEST_CUSTOM_PUBLIC_NET}" |
| 32 | echo "# Trying to set network: '${cmd}'" |
| 33 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 34 | echo "# Checking again" |
| 35 | cmd="openstack network auto allocated topology create --check-resources" |
| 36 | kubectl -n qa-space exec toolset --stdin -- $cmd |
| 37 | [ $? -ne 0 ] && printf "\n\n# WARNING: Check functional tests pod for errors on test init\n\n" |
| 38 | fi |
| 39 | |
| 40 | # run tests |
| 41 | pytest -v /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py |
| 42 | deactivate |
| 43 | |
| 44 | # report |
| 45 | if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then |
| 46 | echo "# Generating repors" |
| 47 | yes | rm $MY_PROJFOLDER/reports/${tenv}-func/* |
| 48 | else |
| 49 | mkdir $MY_PROJFOLDER/reports/${tenv}-func |
| 50 | fi |
| 51 | cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/ |
| 52 | cd $MY_PROJFOLDER/reports/ |
| 53 | tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-smoke-latest.html $MY_PROJFOLDER/reports/${tenv}-func/ |
| 54 | cd $MY_PROJFOLDER |