]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix idempotency checks for lvm batch tests
authorAndrew Schoen <aschoen@redhat.com>
Fri, 5 Oct 2018 15:39:54 +0000 (10:39 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 10 Oct 2018 19:30:28 +0000 (15:30 -0400)
The mixed type tests will change strategy after the idempotency test so
we need to handle that in test playbook.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
src/ceph-volume/ceph_volume/tests/functional/batch/playbooks/test.yml

index 1730049f466f7aaacba8c6b2ca019f9c5ac6eda3..c9375e2b7fb7ffa868fa1e4efe63ce1e6e039b49 100644 (file)
 
     - name: ensure batch create is idempotent
       command: "ceph-volume --cluster {{ cluster }} lvm batch --yes --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices | join(' ') }}"
+      register: batch_cmd
+      failed_when: false
       environment:
         CEPH_VOLUME_DEBUG: 1
 
+    - name: check batch idempotency
+      fail:
+        msg: "lvm batch failed idempotency check"
+      when:
+         - batch_cmd.rc != 0
+         - "'strategy changed' not in batch_cmd.stdout"
+
     - name: run batch --report to see if devices get filtered
       command: "ceph-volume --cluster {{ cluster }} lvm batch --report --format=json --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices | join(' ') }}"
       register: report_cmd
+      failed_when: false
       environment:
         CEPH_VOLUME_DEBUG: 1
 
-    - name: verify OSDs will not be created again
+    - name: check batch --report idempotency
       fail:
-        msg: "Devices were not filtered out after redeploy"
+        msg: "lvm batch --report failed idempotency check"
       when:
-        - (report_cmd.stdout | from_json).changed
+         - batch_cmd.rc != 0
+         - "'strategy changed' not in batch_cmd.stdout"