Files
vitrage/devstack/post_test_hook.sh
Chandan Kumar 027bc49a03 Removed Bundled intree vitrage-tempest-plugin from vitrage project
Depends-On: I5bafa207fdfdd07f3601e924764ee93c08512bf4
Change-Id: Iab7f60a8e8fb9443597cbe0067d9411d587002d3
2018-01-25 10:53:26 +02:00

49 lines
1.6 KiB
Bash

#!/usr/bin/env bash
# Copyright 2016 - Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
DEVSTACK_PATH="$BASE/new"
#Argument is received from Zuul
if [ "$1" = "api" ]; then
TESTS="topology|test_rca|test_alarms|test_resources|test_template|webhook"
elif [ "$1" = "datasources" ]; then
TESTS="datasources|test_events|notifiers|e2e|database"
else
TESTS="topology"
fi
if [ "$DEVSTACK_GATE_USE_PYTHON3" == "True" ]; then
export PYTHON=python3
fi
sudo cp -rf $DEVSTACK_PATH/tempest/etc/logging.conf.sample $DEVSTACK_PATH/tempest/etc/logging.conf
${PYTHON:-python} $DEVSTACK_PATH/vitrage-tempest-plugin/vitrage_tempest_tests/add_legacy_dir_templates.py
# restart due to configuration files changes
sudo systemctl restart devstack@vitrage-graph.service
# wait for 30 seconds (initialization might take time)
sleep 30
cd $DEVSTACK_PATH/tempest/
sudo -E testr init
echo "Listing existing Tempest tests"
sudo -E testr list-tests vitrage_tempest_tests | grep -E "$TESTS" | tee /tmp/vitrage_tempest_tests.list
echo "Testing $1: $TESTS..."
sudo -E testr run --subunit --load-list=/tmp/vitrage_tempest_tests.list | subunit-trace --fails