vitrage/devstack/post_test_hook.sh
Noam Bloom 38a40b3e2e Tempest Gate Fix
Removed the last line of 'unset DEVSTACK_PATH' since it looks like
 it messed Jenkins call regarding the success of the job. The above will
 always return return-code 0 meaning success and this hides the tempest
 run return-code of 1 if some test fails

Change-Id: If4591c9e0c70bfc73cf8024cf9da84b58e1f09a9
2016-05-29 10:33:37 +03:00

47 lines
1.9 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.
sudo chmod -R a+rw /opt/stack/
DEVSTACK_PATH="$BASE/new"
(cd $DEVSTACK_PATH/vitrage/; sudo virtualenv .venv)
. $DEVSTACK_PATH/vitrage/.venv/bin/activate
if [ "$1" = "api" ]; then
TESTS="topology"
elif [ "$1" = "datasources" ]; then
TESTS="datasources"
else
TESTS="topology"
fi
(cd $DEVSTACK_PATH/tempest/; sudo pip install -r requirements.txt -r test-requirements.txt)
(cd $DEVSTACK_PATH/tempest/; sudo oslo-config-generator --config-file etc/config-generator.tempest.conf --output-file etc/tempest.conf)
(cd $DEVSTACK_PATH/; sudo sh -c 'cat vitrage/devstack/files/tempest/tempest.conf >> tempest/etc/tempest.conf')
sudo cp $DEVSTACK_PATH/tempest/etc/logging.conf.sample $DEVSTACK_PATH/tempest/etc/logging.conf
(cd $DEVSTACK_PATH/vitrage/; sudo pip install -r requirements.txt -r test-requirements.txt)
(cd $DEVSTACK_PATH/vitrage/; sudo python setup.py install)
(cd $DEVSTACK_PATH/tempest/; sudo rm -rf .testrepository)
(cd $DEVSTACK_PATH/tempest/; sudo testr init)
echo "Listing existing Tempest tests"
(cd $DEVSTACK_PATH/tempest/; sudo sh -c 'testr list-tests vitrage_tempest_tests')
(cd $DEVSTACK_PATH/tempest/; sudo sh -c 'testr list-tests vitrage_tempest_tests | grep -E '$TESTS' > vitrage_tempest_tests.list')
echo "Testing $1: $TESTS..."
(cd $DEVSTACK_PATH/tempest/; sudo sh -c 'testr run --subunit --load-list=vitrage_tempest_tests.list | subunit-trace --fails')