Adding idempotency testing to the role func test

While not particularly important for this role,
this should establish a reusable pattern for adding
such testing to other roles.

Change-Id: Ia700cfd11c8f15e81f5f767dd723e5a323159919
This commit is contained in:
Travis Truman 2016-07-11 10:29:00 -04:00
parent 67f3cac059
commit 566c3ad207
1 changed files with 8 additions and 1 deletions

View File

@ -162,7 +162,14 @@ commands =
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
{toxinidir}/tests/test.yml -vvvv
# Idempotency test
bash -c 'ansible-playbook -i {toxinidir}/tests/inventory \
-e "rolename={toxinidir}" \
-e "install_test_packages=True" \
{toxinidir}/tests/test.yml \
| grep -q "changed=0.*failed=0" \
&& (echo "Idempotence test: pass" && exit 0) \
|| (echo "Idempotence test: fail" && exit 1)'
[testenv:linters]
deps =