From: Andrew Schoen Date: Wed, 31 Jan 2018 21:45:44 +0000 (-0600) Subject: ceph-volume: adds tests for zap --destroy and --osd-id X-Git-Tag: v12.2.3~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F20323%2Fhead;p=ceph.git ceph-volume: adds tests for zap --destroy and --osd-id These are not added for dmcrypt right now because there is a bug related to zapping encrypted disks that needs fixed first. Signed-off-by: Andrew Schoen (cherry picked from commit 8d38932c211c589b6171d9e17b100869c23890ac) --- diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/bluestore/create/test.yml b/src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/bluestore/create/test.yml new file mode 120000 index 000000000000..165d9da291e2 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/bluestore/create/test.yml @@ -0,0 +1 @@ +../../../playbooks/test_bluestore.yml \ No newline at end of file diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/filestore/create/test.yml b/src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/filestore/create/test.yml new file mode 120000 index 000000000000..1a8c37c13585 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/filestore/create/test.yml @@ -0,0 +1 @@ +../../../playbooks/test_filestore.yml \ No newline at end of file diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_bluestore.yml b/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_bluestore.yml new file mode 100644 index 000000000000..10bd14e59b3c --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_bluestore.yml @@ -0,0 +1,22 @@ + +- hosts: osds + become: yes + tasks: + + - name: stop ceph-osd@2 daemon + service: + name: ceph-osd@2 + state: stopped + + - name: destroy osd.2 + command: "ceph osd destroy osd.2 --yes-i-really-mean-it" + + - name: zap /dev/sdd1 + command: "ceph-volume lvm zap /dev/sdd1 --destroy" + environment: + CEPH_VOLUME_DEBUG: 1 + + - name: redeploy osd.2 using /dev/sdd1 + command: "ceph-volume lvm create --bluestore --data /dev/sdd1 --osd-id 2" + environment: + CEPH_VOLUME_DEBUG: 1 diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_filestore.yml b/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_filestore.yml new file mode 100644 index 000000000000..c1ade2fbcd34 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_filestore.yml @@ -0,0 +1,27 @@ + +- hosts: osds + become: yes + tasks: + + - name: stop ceph-osd@2 daemon + service: + name: ceph-osd@2 + state: stopped + + - name: destroy osd.2 + command: "ceph osd destroy osd.2 --yes-i-really-mean-it" + + - name: zap /dev/sdd1 + command: "ceph-volume lvm zap /dev/sdd1 --destroy" + environment: + CEPH_VOLUME_DEBUG: 1 + + - name: zap /dev/sdd2 + command: "ceph-volume lvm zap /dev/sdd2 --destroy" + environment: + CEPH_VOLUME_DEBUG: 1 + + - name: redeploy osd.2 using /dev/sdd1 + command: "ceph-volume lvm create --filestore --data /dev/sdd1 --journal /dev/sdd2 --osd-id 2" + environment: + CEPH_VOLUME_DEBUG: 1 diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini b/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini index 1a606677bfbc..2ccc4aea8827 100644 --- a/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini @@ -62,4 +62,10 @@ commands= # retest to ensure cluster came back up correctly after rebooting testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/tests + # destroy an OSD, zap it's device and recreate it using it's ID + create: ansible-playbook -vv -i {changedir}/hosts {changedir}/test.yml + + # retest to ensure cluster came back up correctly + create: testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/tests + vagrant destroy --force diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/bluestore/create/test.yml b/src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/bluestore/create/test.yml new file mode 120000 index 000000000000..165d9da291e2 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/bluestore/create/test.yml @@ -0,0 +1 @@ +../../../playbooks/test_bluestore.yml \ No newline at end of file diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/filestore/create/test.yml b/src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/filestore/create/test.yml new file mode 120000 index 000000000000..1a8c37c13585 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/filestore/create/test.yml @@ -0,0 +1 @@ +../../../playbooks/test_filestore.yml \ No newline at end of file