]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: adds purge_cluster and purge_dmcrypt scenarios
authorAndrew Schoen <aschoen@redhat.com>
Thu, 26 Jan 2017 16:38:10 +0000 (10:38 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 27 Jan 2017 13:56:08 +0000 (07:56 -0600)
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 <aschoen@redhat.com>
(cherry picked from commit e05df64fd0f4e2558eaaeb029899cc3e995c7f32)

tox.ini

diff --git a/tox.ini b/tox.ini
index 4331b5c3e567e2d1c2a78f5bd6b2203314214d92..8aba9687ab8221ebd199746574de09adf84451b6 100644 (file)
--- 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