diff --git a/.gitignore b/.gitignore index 9dcfc78a..37fed46e 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,6 @@ releasenotes/build # Vagrant testing artifacts .vagrant + +# Test playbooks brought in by tox +tests/playbooks diff --git a/tests/group_vars/all.yml b/tests/group_vars/all.yml new file mode 100644 index 00000000..141c2d76 --- /dev/null +++ b/tests/group_vars/all.yml @@ -0,0 +1,17 @@ +--- +# Copyright 2016, 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. + +global_environment_variables: + PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/tests/test.yml b/tests/test.yml index cbffbbbd..99cb8ad4 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -13,21 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +- include: "playbooks/test-install-openstack-hosts.yml" + - name: Playbook for role testing hosts: localhost connection: local gather_facts: true - pre_tasks: - - name: First ensure apt cache is always refreshed - apt: - update_cache: yes - when: - - ansible_pkg_mgr == 'apt' - roles: - - role: "{{ rolename | basename }}" - global_environment_variables: - PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - post_tasks: + tasks: - name: Open modules file slurp: src: /etc/modules diff --git a/tox.ini b/tox.ini index 5cb7b46e..733e4f4c 100644 --- a/tox.ini +++ b/tox.ini @@ -120,7 +120,11 @@ commands = ansible-galaxy install \ --role-file={toxinidir}/tests/ansible-role-requirements.yml \ --force - + rm -rf {homedir}/.ansible/roles/openstack_hosts + bash -c "ln -s {toxinidir} {homedir}/.ansible/roles/openstack_hosts" + rm -rf {toxinidir}/tests/playbooks + git clone https://git.openstack.org/openstack/openstack-ansible-tests \ + {toxinidir}/tests/playbooks [testenv:ansible-syntax] deps =