From: Andrew Schoen Date: Thu, 26 Jan 2017 16:38:10 +0000 (-0600) Subject: tests: adds purge_cluster and purge_dmcrypt scenarios X-Git-Tag: v2.1.5~2^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94fae06e637e42ee24e73e22ac727dadcc48df1e;p=ceph-ansible.git tests: adds purge_cluster and purge_dmcrypt scenarios This also removes the purge_cluster_collocated scenario as it's not needed now because of purge_cluster. Moving all the purge commands into its own section allows for ease of reuse when creating new purge scenarios. Signed-off-by: Andrew Schoen (cherry picked from commit e05df64fd0f4e2558eaaeb029899cc3e995c7f32) --- diff --git a/tox.ini b/tox.ini index 4331b5c3e..8aba9687a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,20 @@ [tox] -envlist = {ansible2.2}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster_collocated} +envlist = {ansible2.2}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster,purge_dmcrypt} skipsdist = True +# extra commands for purging clusters +# that purge the cluster and then set it up again to +# ensure that a purge can clear nodes well enough that they +# can be redployed to. +[purge] +commands= + cp {toxinidir}/infrastructure-playbooks/purge-cluster.yml {toxinidir}/purge-cluster.yml + ansible-playbook -vv -i {changedir}/hosts {toxinidir}/purge-cluster.yml --extra-vars="ireallymeanit=yes fetch_directory={changedir}/fetch" + # set up the cluster again + ansible-playbook -vv -i {changedir}/hosts {toxinidir}/site.yml.sample --extra-vars="fetch_directory={changedir}/fetch" + # test that the cluster can be redeployed in a healthy state + testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests + [testenv] whitelist_externals = vagrant @@ -33,8 +46,8 @@ changedir= centos7_cluster: {toxinidir}/tests/functional/centos/7/cluster # tests a 1 mon, 1 osd, 1 mds and 1 rgw centos7 cluster using docker docker_cluster: {toxinidir}/tests/functional/centos/7/docker-cluster - # creates a cluster, purges the cluster and then brings the cluster back up - purge_cluster_collocated: {toxinidir}/tests/functional/centos/7/journal-collocation + purge_cluster: {toxinidir}/tests/functional/centos/7/cluster + purge_dmcrypt: {toxinidir}/tests/functional/centos/7/dmcrypt-dedicated-journal commands= vagrant up --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} @@ -44,10 +57,7 @@ commands= testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests - purge_cluster_collocated: cp {toxinidir}/infrastructure-playbooks/purge-cluster.yml {toxinidir}/purge-cluster.yml - purge_cluster_collocated: ansible-playbook -vv -i {changedir}/hosts {toxinidir}/purge-cluster.yml --extra-vars="ireallymeanit=yes fetch_directory={changedir}/fetch" - # set up the cluster again - purge_cluster_collocated: ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars="fetch_directory={changedir}/fetch" - # test that the cluster can be redeployed in a healthy state - purge_cluster_collocated: testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests + purge_cluster: {[purge]commands} + purge_dmcrypt: {[purge]commands} + vagrant destroy --force