Commit Graph

3 Commits

Author SHA1 Message Date
Logan V 86a697cf4b Fix bashate xargs run
Bashate does not fail for "E004 File did not end with a newline"
properly unless the file is the last in the list when multiple
check files are provided (as we do with xargs). Since the file order
is random, if only 1 or 2 files are failing, this can cause very
random linter failures.

The solution is to use 'xargs -n1' to pass only 1 file to each
bashate process.

See also https://review.openstack.org/#/c/614542/

Change-Id: I2186795510c2327571e7631b45de8a112f4d4445
2019-03-13 12:09:39 -05:00
Jesse Pretorius 90d76c59f8 Implement centralised Ansible test scripts
This patch implements test scripts intended for use by all
OpenStack-Ansible role tests.

The intent is to simplify the role tox.ini configuration
and ensure that as many changes to role testing configuration
can be managed from the centralised tests repo instead of
individually in each repository.

This patch implements the scripts to centralise the
ansible-lint, ansible-syntax, and functional Ansible tests.

Functionality included:

- For a simple functional test, the defaults will be allow
  the execution of the test without any parameters set.
- For a scenario test the scripts allow the inventory,
  extra vars and any other CLI parameters for Ansible to be
  set via environment variables.
- Both check mode and an idempotence test.

In addition to this functionality, the bash scripts are all
set to fail on error to ensure that tox shows a failure.

Change-Id: I23c24146485da340d4f046f80e4814652e6e3876
2016-10-05 09:56:12 +01:00
Jesse Pretorius 9a09e9ff07 Implement centralised test scripts
This patch implements test scripts intended for use by all
OpenStack-Ansible role tests.

The intent is to simplify the role tox.ini configuration
and ensure that as many changes to role testing configuration
can be managed from the centralised tests repo instead of
individually in each repository.

The common tests repo target location when cloned is changed
from 'tests/playbooks' to 'tests/common' to better reflect
the content and purpose.

Change-Id: I1a93329ada24670c87588ce5a07f92c9bce4e50b
2016-09-23 16:04:36 +01:00