]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: adds tests for zap --destroy and --osd-id 20203/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 31 Jan 2018 21:45:44 +0000 (15:45 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 31 Jan 2018 22:48:22 +0000 (16:48 -0600)
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 <aschoen@redhat.com>
src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/bluestore/create/test.yml [new symlink]
src/ceph-volume/ceph_volume/tests/functional/lvm/centos7/filestore/create/test.yml [new symlink]
src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_bluestore.yml [new file with mode: 0644]
src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_filestore.yml [new file with mode: 0644]
src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini
src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/bluestore/create/test.yml [new symlink]
src/ceph-volume/ceph_volume/tests/functional/lvm/xenial/filestore/create/test.yml [new symlink]

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 (symlink)
index 0000000..165d9da
--- /dev/null
@@ -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 (symlink)
index 0000000..1a8c37c
--- /dev/null
@@ -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 (file)
index 0000000..10bd14e
--- /dev/null
@@ -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 (file)
index 0000000..c1ade2f
--- /dev/null
@@ -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
index 1a606677bfbca9554293db4935a23bfc38a66efd..2ccc4aea88274d41d96371dee7d496cce729d7d4 100644 (file)
@@ -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 (symlink)
index 0000000..165d9da
--- /dev/null
@@ -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 (symlink)
index 0000000..1a8c37c
--- /dev/null
@@ -0,0 +1 @@
+../../../playbooks/test_filestore.yml
\ No newline at end of file