Skip to content

Commit

Permalink
tests: Check version of Blivet when running Stratis tests
Browse files Browse the repository at this point in the history
Some Stratis features are not available with older versions of
Blivet.

Related: RHEL-31854
  • Loading branch information
vojtechtrefny committed Jun 3, 2024
1 parent 15a3c57 commit a24c05f
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions tests/tests_stratis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,34 @@
- name: Verify role results
include_tasks: verify-role-results.yml

# XXX blivet supporting this is not yet released
- name: Gather package facts
package_facts:

- name: Set blivet package name
set_fact:
blivet_pkg_name: "{{ ansible_facts.packages |
select('search', 'blivet') | select('search', 'python') | list }}"

- name: Set blivet package version
set_fact:
blivet_pkg_version: "{{
ansible_facts.packages[blivet_pkg_name[0]][0]['version'] +
'-' + ansible_facts.packages[blivet_pkg_name[0]][0]['release'] }}"

- name: Set distribution version
set_fact:
is_rhel9: "{{ (ansible_facts.distribution == 'CentOS' or
ansible_facts.distribution == 'RedHat') and
ansible_facts.distribution_major_version == '9' }}"
is_rhel10: "{{ (ansible_facts.distribution == 'CentOS' or
ansible_facts.distribution == 'RedHat') and
ansible_facts.distribution_major_version == '10' }}"
is_fedora: "{{ ansible_facts.distribution == 'Fedora' }}"

- name: Run test only if blivet supports this functionality
when: false
when: ((is_fedora and blivet_pkg_version is version("3.10.0-1", ">=")) or
(is_rhel10 and blivet_pkg_version is version("3.10.0-1", ">=")) or
(is_rhel9 and blivet_pkg_version is version("3.6.0-15", ">=")))
block:
- name: Create one Stratis pool on one disk
include_role:
Expand Down

0 comments on commit a24c05f

Please sign in to comment.