blob: 165902f1f2627cd0abd6fded1ee4136ed975c4d9 [file] [log] [blame]
Alexa0053b92022-10-14 16:38:28 -05001#!/bin/bash
2tenv=mos
3. /opt/si-tests/.sivenv/bin/activate
4cd $MY_PROJFOLDER/tmp
5. $MY_PROJFOLDER/env.sh
6. $MY_PROJFOLDER/envs/${tenv}rc
Ievgeniia Zadorozhna826e6f82024-03-05 19:53:53 +01007
8if grep -q "public_subnet_uuid" "$MY_PROJFOLDER/yamls/tempest_custom.yaml"; then
9 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."
10 exit 1
11fi
12
Alexa0053b92022-10-14 16:38:28 -050013# Just in case
14unset TARGET_CLUSTER
15unset TARGET_NAMESPACE
Alex876e93a2022-12-21 12:02:13 -060016# Cleaning up
17echo "# Cleaning up '/artifacts/tmp/artifacts/'"
18[ -d "/artifacts/tmp/artifacts/" ] && rm -rf "/artifacts/tmp/artifacts/"
19[ -f "/artifacts/tmp/nosetests.xml" ] && rm "/artifacts/tmp/nosetests.xml"
20mkdir "/artifacts/tmp/artifacts/"
Alexa0053b92022-10-14 16:38:28 -050021
22#
23echo "# Creating schema"
24[ -f "/artifacts/tmp/artifacts/test_scheme.yaml" ] && rm -v $MY_PROJFOLDER/tmp/artifacts/test_scheme.yaml
25cat <<'EOF' >artifacts/test_scheme.yaml
26---
27smoke: true
28concurrency: 4
29blacklist-file: /etc/tempest/test-blacklist
30enabled: true
31fail_on_test: true
32type: tempest
33# regex: test
34EOF
35cat artifacts/test_scheme.yaml
36echo " "
Alex2c8b8802022-10-20 14:07:15 -050037env | grep TEMPEST_
38echo " "
Alexa0053b92022-10-14 16:38:28 -050039#
40echo "# Checking auto-allocation"
41cmd="openstack network auto allocated topology create --check-resources"
42kubectl -n qa-space exec toolset --stdin -- $cmd
43if [ $? -ne 0 ]; then
44 cmd="openstack network set --default --external ${TEMPEST_CUSTOM_PUBLIC_NET}"
45 echo "# Trying to set network: '${cmd}'"
46 kubectl -n qa-space exec toolset --stdin -- $cmd
47 echo "# Checking again"
48 cmd="openstack network auto allocated topology create --check-resources"
49 kubectl -n qa-space exec toolset --stdin -- $cmd
50 [ $? -ne 0 ] && printf "\n\n# WARNING: Check functional tests pod for errors on test init\n\n"
51fi
52
53# run tests
Alex2c8b8802022-10-20 14:07:15 -050054pytest -vv /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py
Alexa0053b92022-10-14 16:38:28 -050055deactivate
56
57# report
58if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then
59 echo "# Generating repors"
60 yes | rm $MY_PROJFOLDER/reports/${tenv}-func/*
61else
62 mkdir $MY_PROJFOLDER/reports/${tenv}-func
63fi
64cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/
65cd $MY_PROJFOLDER/reports/
66tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-smoke-latest.html $MY_PROJFOLDER/reports/${tenv}-func/
67cd $MY_PROJFOLDER