From 8d38932c211c589b6171d9e17b100869c23890ac Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Wed, 31 Jan 2018 15:45:44 -0600 Subject: [PATCH] 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 --- .../lvm/centos7/bluestore/create/test.yml | 1 + .../lvm/centos7/filestore/create/test.yml | 1 + .../lvm/playbooks/test_bluestore.yml | 22 +++++++++++++++ .../lvm/playbooks/test_filestore.yml | 27 +++++++++++++++++++ .../ceph_volume/tests/functional/lvm/tox.ini | 6 +++++ .../lvm/xenial/bluestore/create/test.yml | 1 + .../lvm/xenial/filestore/create/test.yml | 1 + 7 files changed, 59 insertions(+) create mode 120000 src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/bluestore/create/test.yml create mode 120000 src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/filestore/create/test.yml create mode 100644 src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_bluestore.yml create mode 100644 src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_filestore.yml create mode 120000 src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/bluestore/create/test.yml create mode 120000 src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/filestore/create/test.yml 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 00000000000..165d9da291e --- /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 00000000000..1a8c37c1358 --- /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 00000000000..10bd14e59b3 --- /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 00000000000..c1ade2fbcd3 --- /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 1a606677bfb..2ccc4aea882 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 00000000000..165d9da291e --- /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 00000000000..1a8c37c1358 --- /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 -- 2.39.5