Skip to content

Commit

Permalink
test: fix undefined storage_safe_mode
Browse files Browse the repository at this point in the history
Tests are failing if storage_safe_mode is not defined in the test.
Ensure it has a default value `true`.
Also ensure that we can use a global `storage_pools` and
`storage_volumes`.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Jul 6, 2023
1 parent d6b7a98 commit 25b7687
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/verify-role-failed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
block:
- name: Store global variable value copy
set_fact:
storage_safe_mode_global: "{{ storage_safe_mode }}"
storage_safe_mode_global: "{{ storage_safe_mode | d(true) }}"
storage_pools_global: "{{ storage_pools | d([]) }}"
storage_volumes_global: "{{ storage_volumes | d([]) }}"

- name: Verify role raises correct error
include_role:
name: linux-system-roles.storage
vars:
storage_pools: "{{
__storage_failed_params.get('storage_pools', []) }}"
__storage_failed_params.get('storage_pools',
storage_pools_global) }}"
storage_volumes: "{{
__storage_failed_params.get('storage_volumes', []) }}"
__storage_failed_params.get('storage_volumes',
storage_volumes_global) }}"
storage_safe_mode: "{{
__storage_failed_params.get('storage_safe_mode',
storage_safe_mode_global) }}"
Expand Down

0 comments on commit 25b7687

Please sign in to comment.