blob: 1119b2810c418a83fad3f26bd470ccc3f38befc9 [file] [log] [blame]
Alexa0053b92022-10-14 16:38:28 -05001#!/bin/bash
pkazlenka4690e832024-10-24 13:28:37 +02002
3. "$(dirname "$0")/functions.sh"
Alexa0053b92022-10-14 16:38:28 -05004tenv=mos
5. /opt/si-tests/.sivenv/bin/activate
6cd $MY_PROJFOLDER/tmp
7. $MY_PROJFOLDER/env.sh
8. $MY_PROJFOLDER/envs/${tenv}rc
Ievgeniia Zadorozhna826e6f82024-03-05 19:53:53 +01009
10if grep -q "public_subnet_uuid" "$MY_PROJFOLDER/yamls/tempest_custom.yaml"; then
11 echo "The ${MY_PROJFOLDER}/yamls/tempest_custom.yaml file is not updated, it has the placeholders. Please run '. $MY_PROJFOLDER/env.sh && . $MY_PROJFOLDER/envs/mosrc && bash $MY_PROJFOLDER/scripts/update-openstack-resources.sh' before running tempest."
12 exit 1
13fi
14
Alexa0053b92022-10-14 16:38:28 -050015# Just in case
16unset TARGET_CLUSTER
17unset TARGET_NAMESPACE
Alex876e93a2022-12-21 12:02:13 -060018# Cleaning up
19echo "# Cleaning up '/artifacts/tmp/artifacts/'"
20[ -d "/artifacts/tmp/artifacts/" ] && rm -rf "/artifacts/tmp/artifacts/"
21[ -f "/artifacts/tmp/nosetests.xml" ] && rm "/artifacts/tmp/nosetests.xml"
22mkdir "/artifacts/tmp/artifacts/"
Alexa0053b92022-10-14 16:38:28 -050023
24#
25echo "# Creating schema"
26[ -f "/artifacts/tmp/artifacts/test_scheme.yaml" ] && rm -v $MY_PROJFOLDER/tmp/artifacts/test_scheme.yaml
27cat <<'EOF' >artifacts/test_scheme.yaml
28---
29smoke: true
30concurrency: 4
31blacklist-file: /etc/tempest/test-blacklist
32enabled: true
33fail_on_test: true
34type: tempest
35# regex: test
36EOF
37cat artifacts/test_scheme.yaml
38echo " "
Alex2c8b8802022-10-20 14:07:15 -050039env | grep TEMPEST_
40echo " "
Alexa0053b92022-10-14 16:38:28 -050041#
42echo "# Checking auto-allocation"
43cmd="openstack network auto allocated topology create --check-resources"
44kubectl -n qa-space exec toolset --stdin -- $cmd
45if [ $? -ne 0 ]; then
46 cmd="openstack network set --default --external ${TEMPEST_CUSTOM_PUBLIC_NET}"
47 echo "# Trying to set network: '${cmd}'"
48 kubectl -n qa-space exec toolset --stdin -- $cmd
49 echo "# Checking again"
50 cmd="openstack network auto allocated topology create --check-resources"
51 kubectl -n qa-space exec toolset --stdin -- $cmd
52 [ $? -ne 0 ] && printf "\n\n# WARNING: Check functional tests pod for errors on test init\n\n"
53fi
54
55# run tests
Alex2c8b8802022-10-20 14:07:15 -050056pytest -vv /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py
Alexa0053b92022-10-14 16:38:28 -050057deactivate
58
59# report
60if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then
61 echo "# Generating repors"
62 yes | rm $MY_PROJFOLDER/reports/${tenv}-func/*
63else
64 mkdir $MY_PROJFOLDER/reports/${tenv}-func
65fi
66cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/
67cd $MY_PROJFOLDER/reports/
pkazlenka4690e832024-10-24 13:28:37 +020068fname="$MY_CLIENTSHORTNAME-${tenv}-openstack-func-smoke-$(get_timestamp).html"
69tparser -f r_xml -d -r "${fname}" $MY_PROJFOLDER/reports/${tenv}-func/
70update_latest_report_to "${fname}"
Alexa0053b92022-10-14 16:38:28 -050071cd $MY_PROJFOLDER