From 4e9ad19bb2941628274be7515f3fdbf7a69735a3 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 28 Sep 2016 13:19:28 +0100 Subject: [PATCH] Update README description of how to use the tests repo This updates the description of how to use the central tests repository. Change-Id: I730c2e5eeda4d57c5607c04439ae9ab2169472dc --- README.rst | 52 ++++++++++++++++---------------------------------- manual-test.rc | 2 +- 2 files changed, 17 insertions(+), 37 deletions(-) diff --git a/README.rst b/README.rst index f6187e77..17fb8d3b 100644 --- a/README.rst +++ b/README.rst @@ -6,54 +6,34 @@ consolidation of testing configuration and playbooks. This can be used to integrate new projects, and ensure that code duplication is minimized whilst allowing the addition of new testing scenarios with greater ease. -Roles Currently using the ``openstack-ansible-tests`` repository -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- openstack-ansible-galera_server -- openstack-ansible-tests -- openstack-ansible-os_rally -- openstack-ansible-memcached_server -- openstack-ansible-openstack_hosts -- openstack-ansible-repo_build -- openstack-ansible-repo_server -- openstack-ansible-lxc_container_create -- openstack-ansible-os_keystone -- openstack-ansible-os_aodh -- openstack-ansible-os_zaqar - -Variables are generic and based on inventory so variable overrides should be -able to be very minimal. - Role Integration ~~~~~~~~~~~~~~~~ -To enable the ``openstack-ansible-tests`` repository add the following to your -repositories tox.ini, at the bottom of the ``[testenv:ansible]]`` stanza, in the -``commands`` section. +To enable the ``openstack-ansible-tests`` repository, ensure that the +``tox.ini`` configuration in the role repository matches the `galera_client +repository tox.ini`_ with the exception of the value for ``ROLE_NAME``. +A more advanced configuration which implements multiple functional test +scenarios is available in the `neutron role tox.ini`_. + +To override variables you can create a ``test-vars.yml`` file inside the +role's tests folder. This variable file can be includes in the functional tox +target configuration in ``tox.ini`` as demonstrated in the following extract: .. code-block:: bash - rm -rf {toxinidir}/tests/playbooks - git clone https://git.openstack.org/openstack/openstack-ansible-tests \ - {toxinidir}/tests/playbooks - -To override variables you can create a role-overrides.yml file inside tests, -which you can include in your tox.ini. -You will have to set the rolename for the repository due to how the base -repository is cloned when gates run, the below example shows keystone's -settings: - -.. code-block:: bash - - -e @{toxinidir/tests/keystone-overrides.yml \ - -e "keystone_rolename={toxinidir}" \ + ansible-playbook -i {toxinidir}/tests/inventory \ + -e @{toxinidir}/tests/test-vars.yml \ + {toxinidir}/tests/test.yml -vvvv In your repositories ``tests/test.yml`` file, you can call any of the included playbooks, for example: .. code-block:: yaml - - include: playbooks/test-prepare-keys.yml + - include: common/test-prepare-keys.yml + +.. _galera_client repository tox.ini: https://github.com/openstack/openstack-ansible-galera_client/blob/master/tox.ini +.. _neutron role tox.ini: https://github.com/openstack/openstack-ansible-os_neutron/blob/master/tox.ini Network Settings ~~~~~~~~~~~~~~~~ diff --git a/manual-test.rc b/manual-test.rc index f7e77710..7016c453 100644 --- a/manual-test.rc +++ b/manual-test.rc @@ -30,4 +30,4 @@ export ANSIBLE_SSH_ARGS="-o ControlMaster=no \ -o ForwardAgent=yes" 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"