Skip to content

Commit

Permalink
tests: Check return code instead of ouput for does_library_support
Browse files Browse the repository at this point in the history
There can be some noise in the output (like python deprecation
warnings).
  • Loading branch information
vojtechtrefny authored and richm committed Jan 21, 2025
1 parent 9422b36 commit dd2b575
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/scripts/does_library_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ def is_supported(var):
print("Usage: python %s <parameter>" % sys.argv[0])
sys.exit(-1)

print(is_supported(sys.argv[1]))
ret = is_supported(sys.argv[1])
sys.exit(0) if ret else sys.exit(1)
3 changes: 2 additions & 1 deletion tests/test-verify-pool-members.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@
executable: "{{ ansible_python.executable }}"
register: grow_supported
changed_when: false
failed_when: grow_supported.rc not in [0, 1]

- name: Verify that PVs fill the whole devices when they should
include_tasks: verify-pool-member-pvsize.yml
loop: "{{ _storage_test_pool_pvs | default([]) }}"
loop_control:
loop_var: st_pool_pv
when:
- grow_supported.stdout | trim == 'True'
- grow_supported.rc == 0
- storage_test_pool.type == "lvm"
- storage_test_pool.grow_to_fill | bool

Expand Down

0 comments on commit dd2b575

Please sign in to comment.