Navigation Menu

Skip to content

Commit

Permalink
ceph-volume: fix idempotency checks for lvm batch tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andrewschoen committed Oct 10, 2018
1 parent b3cf906 commit 1143482
Showing 1 changed file with 14 additions and 3 deletions.
Expand Up @@ -36,17 +36,28 @@

- 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"

0 comments on commit 1143482

Please sign in to comment.