blob: 30052aeb7c598217ec3ec8b85b3d27509e65c62b [file] [log] [blame]
Alex2c8b8802022-10-20 14:07:15 -05001#!/bin/bash
2tenv=mos
Ievgeniia Zadorozhnaa4ba3e82025-12-12 16:34:05 +01003. /artifacts/env.sh
Alex2c8b8802022-10-20 14:07:15 -05004. $MY_PROJFOLDER/envs/${tenv}rc
5##
6echo "### Checking openstack resources"
7status=$(kubectl -n qa-space get pod | grep toolset | tr -s " " | cut -d' ' -f3)
8if [ ${status} != "Running" ]; then
9 echo "# 'toolset' container is not Running"
10 exit 1
11fi
Ievgeniia Zadorozhna4d649fe2024-01-25 00:59:58 +010012
13echo "# Copying mos-kubeconfig.yaml and node.key from /artifacts/envs/"
14kubectl cp /artifacts/envs/mos-kubeconfig.yaml qa-space/toolset:/opt/mos-spt/mos-kubeconfig.yaml
15kubectl cp /artifacts/envs/node.key qa-space/toolset:/opt/mos-spt/node.key
16
Alex2c8b8802022-10-20 14:07:15 -050017admin_uuid=$(kubectl exec toolset --stdin -n qa-space -- bash -c "openstack user show cvp.admin -c id -f value")
18if [ ! -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
Alexc85212b2022-11-08 12:27:01 -060021 echo " "
22 echo "# Running spt checks"
Alex2c8b8802022-10-20 14:07:15 -050023 echo " "
Alexc85212b2022-11-08 12:27:01 -060024 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/"
Alex2c8b8802022-10-20 14:07:15 -050025else
26 echo "# Public network not set: TEMPEST_CUSTOM_PUBLIC_NET=${TEMPEST_CUSTOM_PUBLIC_NET}"
27 exit 1
28fi
Ievgeniia Zadorozhna4cd69a32024-08-01 17:01:23 +020029
30echo "# Copying SPT HTML test report"
31mkdir -p /artifacts/reports/mos-spt
32kubectl 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 Zadorozhnaa4ba3e82025-12-12 16:34:05 +010033kubectl cp qa-space/toolset:/opt/mos-spt/html_reports/ /artifacts/reports/mos-spt/
34
35# copy and rename the test report
36latest_file=$(ls /artifacts/reports/mos-spt/ | sort | tail -n1)
37new_name="${MY_CLIENTSHORTNAME}-${latest_file}"
38cp "/artifacts/reports/mos-spt/$latest_file" "/artifacts/reports/$new_name"
39echo ""
40echo "The report is saved to /artifacts/reports/${new_name}"