Skip to content

Commit dd2b575

Browse files
vojtechtrefnyrichm
authored andcommitted
tests: Check return code instead of ouput for does_library_support
There can be some noise in the output (like python deprecation warnings).
1 parent 9422b36 commit dd2b575

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/scripts/does_library_support.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ def is_supported(var):
5959
print("Usage: python %s <parameter>" % sys.argv[0])
6060
sys.exit(-1)
6161

62-
print(is_supported(sys.argv[1]))
62+
ret = is_supported(sys.argv[1])
63+
sys.exit(0) if ret else sys.exit(1)

tests/test-verify-pool-members.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@
7878
executable: "{{ ansible_python.executable }}"
7979
register: grow_supported
8080
changed_when: false
81+
failed_when: grow_supported.rc not in [0, 1]
8182

8283
- name: Verify that PVs fill the whole devices when they should
8384
include_tasks: verify-pool-member-pvsize.yml
8485
loop: "{{ _storage_test_pool_pvs | default([]) }}"
8586
loop_control:
8687
loop_var: st_pool_pv
8788
when:
88-
- grow_supported.stdout | trim == 'True'
89+
- grow_supported.rc == 0
8990
- storage_test_pool.type == "lvm"
9091
- storage_test_pool.grow_to_fill | bool
9192

0 commit comments

Comments
 (0)