blob: a11dbe0592b0031b31c4fcf24e7788c2dc45af9a [file] [log] [blame]
Alex2c8b8802022-10-20 14:07:15 -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: false
17concurrency: 8
18blacklist-file: /etc/tempest/test-blacklist
19enabled: true
20fail_on_test: true
21type: tempest
22# regex: test
23EOF
24cat artifacts/test_scheme.yaml
25echo " "
26env | grep TEMPEST_
27echo " "
28#
29echo "# Checking auto-allocation"
30cmd="openstack network auto allocated topology create --check-resources"
31kubectl -n qa-space exec toolset --stdin -- $cmd
32if [ $? -ne 0 ]; then
33 cmd="openstack network set --default --external ${TEMPEST_CUSTOM_PUBLIC_NET}"
34 echo "# Trying to set network: '${cmd}'"
35 kubectl -n qa-space exec toolset --stdin -- $cmd
36 echo "# Checking again"
37 cmd="openstack network auto allocated topology create --check-resources"
38 kubectl -n qa-space exec toolset --stdin -- $cmd
39 [ $? -ne 0 ] && printf "\n\n# WARNING: Check functional tests pod for errors on test init\n\n"
40fi
41
42# run tests
43pytest -vv /opt/si-tests/si_tests/tests/lcm/test_run_tempest.py
44deactivate
45
46# report
47if [ -d $MY_PROJFOLDER/reports/${tenv}-func ]; then
48 echo "# Generating repors"
49 yes | rm $MY_PROJFOLDER/reports/${tenv}-func/*
50else
51 mkdir $MY_PROJFOLDER/reports/${tenv}-func
52fi
53cp ./artifacts/*.xml $MY_PROJFOLDER/reports/${tenv}-func/
54cd $MY_PROJFOLDER/reports/
55tparser -f r_xml -d -r $MY_CLIENTSHORTNAME-${tenv}-openstack-func-full-latest.html $MY_PROJFOLDER/reports/${tenv}-func/
56cd $MY_PROJFOLDER