blob: 3d044e57e62d9b9c6b3ec26d277f7df11592295a [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
7# Just in case
8unset TARGET_CLUSTER
9unset TARGET_NAMESPACE
10
11#
12echo "# Creating schema"
13[ -f "/artifacts/tmp/artifacts/test_scheme.yaml" ] && rm -v $MY_PROJFOLDER/tmp/artifacts/test_scheme.yaml
14cat <<'EOF' >artifacts/test_scheme.yaml
15---
16smoke: true
17concurrency: 4
18blacklist-file: /etc/tempest/test-blacklist
19enabled: true
20fail_on_test: true
21type: tempest
22# regex: test
23EOF
24cat artifacts/test_scheme.yaml
25echo " "
26#
27echo "# Checking auto-allocation"
28cmd="openstack network auto allocated topology create --check-resources"
29kubectl -n qa-space exec toolset --stdin -- $cmd
30if [ $? -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"
38fi
39
40# run tests
41pytest -v /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py
42deactivate
43
44# report
45if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then
46 echo "# Generating repors"
47 yes | rm $MY_PROJFOLDER/reports/${tenv}-func/*
48else
49 mkdir $MY_PROJFOLDER/reports/${tenv}-func
50fi
51cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/
52cd $MY_PROJFOLDER/reports/
53tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-smoke-latest.html $MY_PROJFOLDER/reports/${tenv}-func/
54cd $MY_PROJFOLDER