vitrage/devstack/post_test_hook.sh
Alexey Weyl c4598c73fa Neutron Network and Port Notifier support
Change-Id: I9e665896ab9e59bbcced256339cfbc3c677ff5da
2016-06-15 11:16:10 +03:00

50 lines
2.2 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 'cp -rf vitrage/devstack/files/tempest/tempest.conf /etc/tempest.conf')
(cd $DEVSTACK_PATH/; sudo sh -c 'cp -rf vitrage/vitrage_tempest_tests/tests/resources/static_physical/* /etc/vitrage/static_datasources/')
(cd $DEVSTACK_PATH/; sudo sh -c 'cp -rf vitrage/vitrage_tempest_tests/tests/resources/templates/api/* /etc/vitrage/templates/')
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')