Skip to content

Commit

Permalink
tests: Enable LVM VDO tests on Fedora
Browse files Browse the repository at this point in the history
VDO is now available in Fedora and the kernel module (now named
"dm-vdo" instead of "kvdo") is now part of the upstream kernel.
  • Loading branch information
vojtechtrefny committed Nov 21, 2024
1 parent 1bc4cc8 commit 3a8e7a5
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions tests/tests_create_lvmvdo_then_remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,30 @@
ansible_facts.packages[blivet_pkg_name[0]][0]['version'] +
'-' + ansible_facts.packages[blivet_pkg_name[0]][0]['release'] }}"

- name: Set libblockdev package version
set_fact:
libblockdev_pkg_version: "{{
ansible_facts.packages['libblockdev'][0]['version'] +
'-' + ansible_facts.packages['libblockdev'][0]['release'] }}"

- name: Check if kvdo is loadable
shell: |
set -euo pipefail
modprobe --dry-run kvdo
command: modprobe --dry-run kvdo
ignore_errors: true # noqa ignore-errors
changed_when: false
register: __storage_kvdo_loadable

- name: Check if dm-vdo is loadable
command: modprobe --dry-run dm-vdo
ignore_errors: true # noqa ignore-errors
changed_when: false
register: __storage_dmvdo_loadable

- name: Run tests if VDO is available
when:
- blivet_pkg_version is version("3.2.2-10", ">=")
- ansible_facts["distribution"] != "Fedora"
- __storage_kvdo_loadable is success
- ansible_facts["distribution"] != "Fedora" or
libblockdev_pkg_version is version("3.1.1-2", ">=")
- __storage_kvdo_loadable is success or __storage_dmvdo_loadable is success
block:
- name: Get unused disks
include_tasks: get_unused_disk.yml
Expand Down

0 comments on commit 3a8e7a5

Please sign in to comment.