diff --git a/tests/apt_package_pinning-overrides.yml b/tests/apt_package_pinning-overrides.yml new file mode 100644 index 0000000..dbbb349 --- /dev/null +++ b/tests/apt_package_pinning-overrides.yml @@ -0,0 +1,23 @@ +--- +# 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. + +apt_package_pinning_file_name: test.pref +apt_pinned_packages: + - package: "test-package-version" + version: "9.9.9-version" + - package: "test-package-origin" + origin: "test-origin.org" + - package: "test-package-release.*" + release: "TestRelease" diff --git a/tests/test.yml b/tests/test.yml index d616401..f9161fe 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -18,11 +18,6 @@ connection: local roles: - role: "apt_package_pinning" - apt_package_pinning_file_name: test.pref - apt_pinned_packages: - - { package: "test-package-version", version: "9.9.9-version" } - - { package: "test-package-origin", origin: "test-origin.org" } - - { package: "test-package-release.*", release: "TestRelease" } post_tasks: - name: Open preference file slurp: diff --git a/tox.ini b/tox.ini index bfc1b12..ddedaef 100644 --- a/tox.ini +++ b/tox.ini @@ -25,6 +25,7 @@ whitelist_externals = setenv = PYTHONUNBUFFERED=1 ROLE_NAME=apt_package_pinning + TEST_IDEMPOTENCE=true VIRTUAL_ENV={envdir} WORKING_DIR={toxinidir} @@ -83,29 +84,22 @@ commands = deps = {[testenv]deps} -rhttp://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt -commands = - {[testenv:tests_clone]commands} - bash -c "{toxinidir}/tests/common/test-ansible-env-prep.sh" [testenv:ansible-syntax] deps = {[testenv:ansible]deps} commands = - {[testenv:ansible]commands} - ansible-playbook -i {toxinidir}/tests/inventory \ - --syntax-check \ - --list-tasks \ - {toxinidir}/tests/test.yml + {[testenv:tests_clone]commands} + bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh" [testenv:ansible-lint] deps = {[testenv:ansible]deps} commands = - {[testenv:ansible]commands} - ansible-lint {toxinidir} - + {[testenv:tests_clone]commands} + bash -c "{toxinidir}/tests/common/test-ansible-lint.sh" [testenv:func_base] @@ -116,17 +110,7 @@ install_command = pip install -U --force-reinstall {opts} {packages} -[testenv:func_logs] -commands = - bash -c "{toxinidir}/tests/common/test-log-collect.sh" - - [testenv:functional] -# 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 -# exception will be mark the run as failed and exit 1 after all of -# the commands have been iterated through. -ignore_errors = True # 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. @@ -135,16 +119,8 @@ install_command = deps = {[testenv:ansible]deps} commands = - {[testenv:ansible]commands} - ansible-playbook -i {toxinidir}/tests/inventory \ - {toxinidir}/tests/test.yml -vvvv - # Idempotency test - bash -c 'ansible-playbook -i {toxinidir}/tests/inventory \ - {toxinidir}/tests/test.yml \ - | grep -q "changed=0.*failed=0" \ - && (echo "Idempotence test: pass" && exit 0) \ - || (echo "Idempotence test: fail" && exit 1)' - {[testenv:func_logs]commands} + {[testenv:tests_clone]commands} + bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" [testenv:linters]