Skip to content

Commit

Permalink
test: make comparison work with ansible 2.9/jinja 2.7
Browse files Browse the repository at this point in the history
The comparison was not working with ansible 2.9 and jinja 2.7.
Use a temporary variable for the actual value to compare.

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Dec 15, 2023
1 parent 7fc8d76 commit 63247ed
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test-verify-pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

- name: Verify that VG shared value checks out
assert:
that: (storage_test_pool.shared | bool) == ('1' in vgs_dump.stdout)
that: storage_test_pool.shared == actual
msg: >-
Shared VG presence ({{ storage_test_pool.shared }})
does not match its expected state ({{ '1' in vgs_dump.stdout }})
Shared VG presence expected state ({{ storage_test_pool.shared }})
does not match its actual state ({{ actual }})
when: storage_test_pool.type == 'lvm' and storage_test_pool.state == 'present'
vars:
actual: "{{ '1' in vgs_dump.stdout }}"

- name: Verify pool subset
include_tasks: "test-verify-pool-{{ storage_test_pool_subset }}.yml"
Expand Down
15 changes: 15 additions & 0 deletions tests/tests_lvm_pool_shared_nvme_generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# This file was generated by generate_tests.py
- name: Run test tests_lvm_pool_shared.yml for nvme
hosts: all
tags:
- tests::nvme
tasks:
- name: Set disk interface for test
set_fact:
storage_test_use_interface: "nvme"

- name: Import playbook
import_playbook: tests_lvm_pool_shared.yml
tags:
- tests::nvme
15 changes: 15 additions & 0 deletions tests/tests_lvm_pool_shared_scsi_generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# This file was generated by generate_tests.py
- name: Run test tests_lvm_pool_shared.yml for scsi
hosts: all
tags:
- tests::scsi
tasks:
- name: Set disk interface for test
set_fact:
storage_test_use_interface: "scsi"

- name: Import playbook
import_playbook: tests_lvm_pool_shared.yml
tags:
- tests::scsi

0 comments on commit 63247ed

Please sign in to comment.