| Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | tenv=mos |
| Ievgeniia Zadorozhna | a4ba3e8 | 2025-12-12 16:34:05 +0100 | [diff] [blame^] | 3 | . /artifacts/env.sh |
| Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 4 | . $MY_PROJFOLDER/envs/${tenv}rc |
| 5 | ## |
| 6 | echo "### Checking openstack resources" |
| 7 | status=$(kubectl -n qa-space get pod | grep toolset | tr -s " " | cut -d' ' -f3) |
| 8 | if [ ${status} != "Running" ]; then |
| 9 | echo "# 'toolset' container is not Running" |
| 10 | exit 1 |
| 11 | fi |
| Ievgeniia Zadorozhna | 4d649fe | 2024-01-25 00:59:58 +0100 | [diff] [blame] | 12 | |
| 13 | echo "# Copying mos-kubeconfig.yaml and node.key from /artifacts/envs/" |
| 14 | kubectl cp /artifacts/envs/mos-kubeconfig.yaml qa-space/toolset:/opt/mos-spt/mos-kubeconfig.yaml |
| 15 | kubectl cp /artifacts/envs/node.key qa-space/toolset:/opt/mos-spt/node.key |
| 16 | |
| Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 17 | admin_uuid=$(kubectl exec toolset --stdin -n qa-space -- bash -c "openstack user show cvp.admin -c id -f value") |
| 18 | if [ ! -z ${TEMPEST_CUSTOM_PUBLIC_NET+x} ]; then |
| 19 | echo "# Copying global_config.yaml" |
| 20 | kubectl cp $MY_PROJFOLDER/yamls/global_config.yaml qa-space/toolset:/opt/mos-spt/global_config.yaml |
| Alex | c85212b | 2022-11-08 12:27:01 -0600 | [diff] [blame] | 21 | echo " " |
| 22 | echo "# Running spt checks" |
| Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 23 | echo " " |
| Alex | c85212b | 2022-11-08 12:27:01 -0600 | [diff] [blame] | 24 | kubectl exec toolset --stdin --tty -n qa-space -- bash -c "cd /opt/mos-spt; . .venv/bin/activate; pytest -rs -o log_cli=true --tb=short tests/" |
| Alex | 2c8b880 | 2022-10-20 14:07:15 -0500 | [diff] [blame] | 25 | else |
| 26 | echo "# Public network not set: TEMPEST_CUSTOM_PUBLIC_NET=${TEMPEST_CUSTOM_PUBLIC_NET}" |
| 27 | exit 1 |
| 28 | fi |
| Ievgeniia Zadorozhna | 4cd69a3 | 2024-08-01 17:01:23 +0200 | [diff] [blame] | 29 | |
| 30 | echo "# Copying SPT HTML test report" |
| 31 | mkdir -p /artifacts/reports/mos-spt |
| 32 | kubectl exec toolset --stdin --tty -n qa-space -- bash -c "mkdir -p /opt/mos-spt/html_reports && cp /opt/mos-spt/*.html /opt/mos-spt/html_reports" |
| Ievgeniia Zadorozhna | a4ba3e8 | 2025-12-12 16:34:05 +0100 | [diff] [blame^] | 33 | kubectl cp qa-space/toolset:/opt/mos-spt/html_reports/ /artifacts/reports/mos-spt/ |
| 34 | |
| 35 | # copy and rename the test report |
| 36 | latest_file=$(ls /artifacts/reports/mos-spt/ | sort | tail -n1) |
| 37 | new_name="${MY_CLIENTSHORTNAME}-${latest_file}" |
| 38 | cp "/artifacts/reports/mos-spt/$latest_file" "/artifacts/reports/$new_name" |
| 39 | echo "" |
| 40 | echo "The report is saved to /artifacts/reports/${new_name}" |