This combines three patches which re-organise the playbooks: - Ie71596b028b1765083818692c7485eaed2bd88a2 (cherry picked from commit6806e7c9c0) - I6aa877b10945a265d7484c9aacb3c232d82d8ebb (cherry picked from commit1b9035aa79) - Ibc8bb7df529b28c4edf04a7efb33ea7a3f69c47f (cherry picked from commitd036e44e53) The following changes have been made to reorganize the structure of this role's test playbooks, bringing them into line with other OpenStack-Ansible roles: - make run_tests.sh executable - move each playbook to an individual file - rename playbooks descriptively - define hosts and groups directly in the inventory file - include group vars required by containers - store extra variables in a single shared test-vars file - reduce lxc network dhcp network range to avoid conflicts with static container addresses - include callback plugin for human readable logging of test tasks - remove unused test-upgrade.yml Change-Id: I6aa877b10945a265d7484c9aacb3c232d82d8ebb (cherry picked from commit1b9035aa79)
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/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}
|
|
|
|
# prep the host
|
|
if [ "$(which apt-get)" ]; then
|
|
apt-get install -y build-essential python2.7 python-dev git-core libssl-dev libffi-dev
|
|
fi
|
|
|
|
# get pip, if necessary
|
|
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
|
|
tox -e ${tox_env}
|
|
elif [ "${tox_env}" == "ansible-functional" ]; then
|
|
if ${FUNCTIONAL_TEST}; then
|
|
tox -e ${tox_env}
|
|
fi
|
|
fi
|
|
done
|