Files
openstack-ansible-os_cloudk…/run_tests.sh
Jimmy McCrory fdaaacaca8 Implement base configuration for OpenStack-CI
This patch includes the following changes to enable OpenStack-CI gate
testing and to allow the role to pass a basic convergence test:

 - Base configuration for OpenStack's CI Infrastructure.
 - Base documentation build configuration.
 - A Vagrantfile for local testing.
 - A base test configuration in order to execute the standard tests.
 - Added a CONTRIBUTING file.
 - Add reno scaffolding for release notes management.
 - Correcting name of handler to restart services in install tasks.
 - Define ``cloudkitty_galera_password`` and
   ``cloudkitty_user_password`` in test variables.
 - Define default ``debug`` and ``cloudkitty_service_region`` variables.

Change-Id: I7bcc8c589d506d8b71eb08fc87861a4c31a6e947
2016-07-01 09:35:24 -07:00

49 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# Copyright 2015, Rackspace US, Inc.
#
# 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.
set -euov
FUNCTIONAL_TEST=${FUNCTIONAL_TEST:-true}
# Prepare Ubuntu 14.04 and 16.04 hosts
if [ "$(which apt-get)" ]; then
apt-get install -y build-essential python2.7 python-dev git-core libssl-dev libffi-dev
fi
# Prepare CentOS and Red Hat Enterprise Linux 7 hosts
if [ "$(which yum)" ]; then
yum -y install libffi-devel openssl-devel git python-devel "@Development Tools"
fi
# Download and install pip
if [ ! "$(which pip)" ]; then
curl --silent --show-error --retry 5 \
https://bootstrap.pypa.io/get-pip.py | sudo python2.7
fi
# install tox
pip install tox
# run through each tox env and execute the test
for tox_env in $(awk -F= '/envlist/ {print $2}' tox.ini | sed 's/,/ /g'); do
if [ "${tox_env}" == "ansible-functional" ]; then
if ${FUNCTIONAL_TEST}; then
tox -e ${tox_env}
fi
else
tox -e ${tox_env}
fi
done