Update testing bits for consistency
Change-Id: I70b28988332a8d2073afbd46960582a5780ae48c Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
03049027af
commit
d11071f283
|
@ -29,6 +29,7 @@ doc/build/
|
||||||
*.log
|
*.log
|
||||||
*.sql
|
*.sql
|
||||||
*.sqlite
|
*.sqlite
|
||||||
|
logs/*
|
||||||
|
|
||||||
# OS generated files #
|
# OS generated files #
|
||||||
######################
|
######################
|
||||||
|
@ -58,3 +59,13 @@ ChangeLog
|
||||||
|
|
||||||
# Files created by releasenotes build
|
# Files created by releasenotes build
|
||||||
releasenotes/build
|
releasenotes/build
|
||||||
|
|
||||||
|
# Test temp files
|
||||||
|
tests/plugins
|
||||||
|
tests/playbooks
|
||||||
|
tests/test.retry
|
||||||
|
|
||||||
|
# Vagrant artifacts
|
||||||
|
.vagrant
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,5 +18,16 @@ export ANSIBLE_LIBRARY=${HOME}/.ansible/plugins/library
|
||||||
# specified in ansible.cfg
|
# specified in ansible.cfg
|
||||||
export ANSIBLE_ROLES_PATH=${HOME}/.ansible/roles:$(pwd)/..
|
export ANSIBLE_ROLES_PATH=${HOME}/.ansible/roles:$(pwd)/..
|
||||||
|
|
||||||
|
export ANSIBLE_SSH_ARGS="-o ControlMaster=no \
|
||||||
|
-o UserKnownHostsFile=/dev/null \
|
||||||
|
-o StrictHostKeyChecking=no \
|
||||||
|
-o ServerAliveInterval=64 \
|
||||||
|
-o ServerAliveCountMax=1024 \
|
||||||
|
-o Compression=no \
|
||||||
|
-o TCPKeepAlive=yes \
|
||||||
|
-o VerifyHostKeyDNS=no \
|
||||||
|
-o ForwardX11=no \
|
||||||
|
-o ForwardAgent=yes"
|
||||||
|
|
||||||
echo "Run manual functional tests by executing the following:"
|
echo "Run manual functional tests by executing the following:"
|
||||||
echo "# ./.tox/functional/bin/ansible-playbook -i tests/inventory tests/test.yml -e \"rolename=$(pwd)\""
|
echo "# ./.tox/functional/bin/ansible-playbook -i tests/inventory tests/test.yml -e \"rolename=$(pwd)\""
|
||||||
|
|
10
run_tests.sh
10
run_tests.sh
|
@ -24,23 +24,23 @@ if [ ! "$(which pip)" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install bindep and tox
|
# Install bindep and tox
|
||||||
pip install bindep tox
|
sudo pip install bindep tox
|
||||||
|
|
||||||
# CentOS 7 requires two additional packages:
|
# CentOS 7 requires two additional packages:
|
||||||
# redhat-lsb-core - for bindep profile support
|
# redhat-lsb-core - for bindep profile support
|
||||||
# epel-release - required to install python-ndg_httpsclient/python2-pyasn1
|
# epel-release - required to install python-ndg_httpsclient/python2-pyasn1
|
||||||
if [ "$(which yum)" ]; then
|
if [ "$(which yum)" ]; then
|
||||||
yum -y install redhat-lsb-core epel-release
|
sudo yum -y install redhat-lsb-core epel-release
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install OS packages using bindep
|
# Install OS packages using bindep
|
||||||
if apt-get -v >/dev/null 2>&1 ; then
|
if apt-get -v >/dev/null 2>&1 ; then
|
||||||
apt-get update
|
sudo apt-get update
|
||||||
DEBIAN_FRONTEND=noninteractive \
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get -q --option "Dpkg::Options::=--force-confold" \
|
sudo apt-get -q --option "Dpkg::Options::=--force-confold" \
|
||||||
--assume-yes install `bindep -b -f bindep.txt test`
|
--assume-yes install `bindep -b -f bindep.txt test`
|
||||||
else
|
else
|
||||||
yum install -y `bindep -b -f bindep.txt test`
|
sudo yum install -y `bindep -b -f bindep.txt test`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# run through each tox env and execute the test
|
# run through each tox env and execute the test
|
||||||
|
|
|
@ -11,10 +11,10 @@ $ActionQueueSaveOnShutdown on
|
||||||
$ActionQueueType LinkedList
|
$ActionQueueType LinkedList
|
||||||
$ActionResumeRetryCount 250
|
$ActionResumeRetryCount 250
|
||||||
{% if rsyslog_client_tcp_reception == true %}
|
{% if rsyslog_client_tcp_reception == true %}
|
||||||
*.* @@{{ hostvars[server]['ansible_ssh_host'] }}:{{ rsyslog_client_tcp_port }};RFC3164fmt
|
*.* @@{{ hostvars[server]['ansible_host'] }}:{{ rsyslog_client_tcp_port }};RFC3164fmt
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rsyslog_client_udp_reception == true %}
|
{% if rsyslog_client_udp_reception == true %}
|
||||||
*.* @{{ hostvars[server]['ansible_ssh_host'] }}:{{ rsyslog_client_udp_port }};RFC3164fmt
|
*.* @{{ hostvars[server]['ansible_host'] }}:{{ rsyslog_client_udp_port }};RFC3164fmt
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[all]
|
[all]
|
||||||
localhost ansible_connection=local ansible_become=True
|
localhost ansible_connection=local ansible_become=True
|
||||||
test1 ansible_ssh_host=127.111.111.101 ansible_become=True
|
test1 ansible_host=127.111.111.101 ansible_become=True
|
||||||
test2 ansible_ssh_host=127.111.111.102 ansible_become=True
|
test2 ansible_host=127.111.111.102 ansible_become=True
|
||||||
|
|
||||||
[rsyslog_all]
|
[rsyslog_all]
|
||||||
test1
|
test1
|
||||||
|
|
33
tox.ini
33
tox.ini
|
@ -94,7 +94,7 @@ commands =
|
||||||
[testenv:ansible]
|
[testenv:ansible]
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
ansible==1.9.4
|
ansible==2.1.1
|
||||||
ansible-lint>=2.7.0,<3.0.0
|
ansible-lint>=2.7.0,<3.0.0
|
||||||
setenv =
|
setenv =
|
||||||
{[testenv]setenv}
|
{[testenv]setenv}
|
||||||
|
@ -113,10 +113,18 @@ setenv =
|
||||||
# This is required as the default is '/etc/ansible/roles' or a path
|
# This is required as the default is '/etc/ansible/roles' or a path
|
||||||
# specified in ansible.cfg
|
# specified in ansible.cfg
|
||||||
ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/..
|
ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/..
|
||||||
|
ANSIBLE_TRANSPORT = "ssh"
|
||||||
commands =
|
commands =
|
||||||
|
# NOTE(cloudnull): Galaxy INIT it running here because there are no role deps to create the skel
|
||||||
|
ansible-galaxy init {homedir}/.ansible/roles/rsyslog_client --force --offline
|
||||||
rm -rf {homedir}/.ansible/plugins
|
rm -rf {homedir}/.ansible/plugins
|
||||||
git clone https://git.openstack.org/openstack/openstack-ansible-plugins \
|
git clone https://git.openstack.org/openstack/openstack-ansible-plugins \
|
||||||
{homedir}/.ansible/plugins
|
{homedir}/.ansible/plugins
|
||||||
|
rm -rf {homedir}/.ansible/roles/rsyslog_client
|
||||||
|
bash -c "ln -s {toxinidir} {homedir}/.ansible/roles/rsyslog_client"
|
||||||
|
rm -rf {toxinidir}/tests/playbooks
|
||||||
|
git clone https://git.openstack.org/openstack/openstack-ansible-tests \
|
||||||
|
{toxinidir}/tests/playbooks
|
||||||
|
|
||||||
|
|
||||||
[testenv:ansible-syntax]
|
[testenv:ansible-syntax]
|
||||||
|
@ -141,6 +149,22 @@ commands =
|
||||||
ansible-lint {toxinidir}
|
ansible-lint {toxinidir}
|
||||||
|
|
||||||
|
|
||||||
|
[testenv:func_base]
|
||||||
|
# NOTE(odyssey4me): this target does not use constraints because
|
||||||
|
# it doesn't work in OpenStack-CI yet. Once that's fixed, we can
|
||||||
|
# drop the install_command.
|
||||||
|
install_command =
|
||||||
|
pip install -U --force-reinstall {opts} {packages}
|
||||||
|
|
||||||
|
|
||||||
|
[testenv:func_logs]
|
||||||
|
commands =
|
||||||
|
bash -c 'mkdir -p {toxinidir}/logs'
|
||||||
|
bash -c 'rsync --archive --verbose --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
|
||||||
|
bash -c 'find "{toxinidir}/logs/" -type f | sed "p;s|$|.txt|" | xargs -n2 mv'
|
||||||
|
bash -c 'command gzip --best --recursive "{toxinidir}/logs/"'
|
||||||
|
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
# Ignore_errors is set to true so that the logs are collected at the
|
# Ignore_errors is set to true so that the logs are collected at the
|
||||||
# end of the run. This will not produce a false positive. Any
|
# end of the run. This will not produce a false positive. Any
|
||||||
|
@ -151,7 +175,7 @@ ignore_errors = True
|
||||||
# it doesn't work in OpenStack-CI yet. Once that's fixed, we can
|
# it doesn't work in OpenStack-CI yet. Once that's fixed, we can
|
||||||
# drop the install_command.
|
# drop the install_command.
|
||||||
install_command =
|
install_command =
|
||||||
pip install -U --force-reinstall {opts} {packages}
|
{[testenv:func_base]install_command}
|
||||||
deps =
|
deps =
|
||||||
{[testenv:ansible]deps}
|
{[testenv:ansible]deps}
|
||||||
setenv =
|
setenv =
|
||||||
|
@ -162,10 +186,7 @@ commands =
|
||||||
-e "rolename={toxinidir}" \
|
-e "rolename={toxinidir}" \
|
||||||
-e "install_test_packages=True" \
|
-e "install_test_packages=True" \
|
||||||
{toxinidir}/tests/test.yml -vvvv
|
{toxinidir}/tests/test.yml -vvvv
|
||||||
bash -c 'mkdir -p {toxinidir}/logs'
|
{[testenv:func_logs]commands}
|
||||||
bash -c 'rsync --archive --verbose --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
|
|
||||||
bash -c 'find "{toxinidir}/logs/" -type f | sed "p;s|$|.txt|" | xargs -n2 mv'
|
|
||||||
bash -c 'command gzip --best --recursive "{toxinidir}/logs/"'
|
|
||||||
|
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
|
|
Loading…
Reference in New Issue