From ee00627b7a112eccdc61899b24a7fc82c2a5f1f5 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Thu, 2 Jun 2016 15:34:49 -0500 Subject: [PATCH] Add check/audit to gate testing Checking or auditing an existing environment is a first class feature in the security role, but we're not currently checking that feature in the gate. A few users of the role have come forward with some bugs around the check mode functionality and we should test this more regularly. This patch adds a quick audit check right before the functional test runs. This adds about 30-60 seconds onto the gate test, but it should help with catching these bugs. Change-Id: I5f4adc292f027b2eb7429be843c167d152c0169d --- tests/test_check.yml | 19 +++++++++++++++++++ tox.ini | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/test_check.yml diff --git a/tests/test_check.yml b/tests/test_check.yml new file mode 100644 index 00000000..2f3e8723 --- /dev/null +++ b/tests/test_check.yml @@ -0,0 +1,19 @@ +--- +# 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. + +- name: Playbook for role testing (check mode) + hosts: localhost + roles: + - role: "{{ rolename }}" diff --git a/tox.ini b/tox.ini index 164453e3..f0bdf4dc 100644 --- a/tox.ini +++ b/tox.ini @@ -88,6 +88,13 @@ commands = rm -rf {homedir}/.ansible git clone https://git.openstack.org/openstack/openstack-ansible-plugins \ {homedir}/.ansible/plugins + ansible-playbook --check \ + -i {toxinidir}/tests/inventory \ + --syntax-check \ + --list-tasks \ + -e "rolename={toxinidir}" \ + -t ssh \ + {toxinidir}/tests/test_check.yml ansible-playbook -i {toxinidir}/tests/inventory \ --syntax-check \ --list-tasks \ @@ -109,6 +116,11 @@ commands = rm -rf {homedir}/.ansible git clone https://git.openstack.org/openstack/openstack-ansible-plugins \ {homedir}/.ansible/plugins + ansible-playbook --check \ + -i {toxinidir}/tests/inventory \ + -e "rolename={toxinidir}" \ + --skip-tag V-38462,V-38574,V-38674 \ + {toxinidir}/tests/test_check.yml ansible-playbook -i {toxinidir}/tests/inventory \ -e "rolename={toxinidir}" \ --skip-tag V-38462 \