1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-26 14:22:13 +00:00

[stable-12] Re-enable most filesystem tests (#12258) (#12261)

Re-enable most filesystem tests (#12258)

* Re-enable most filesystem tests.

* Fix conditionals (ansible-core 2.19).

* Fedora also needs gfs2-utils.

* fatresize seems to be broken on Ubuntu.

* Install util-linux-extra on Debian/Ubuntu.

* Fix conditionals.

* Temporarily disable bcachefs tests on Arch (and thus on all platforms).

(cherry picked from commit ed8afeb16b)
This commit is contained in:
Felix Fontein 2026-06-14 00:31:04 +02:00 committed by GitHub
parent e39ac81841
commit 0345ef2db6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 9 deletions

View file

@ -48,8 +48,11 @@
# bcachefs only on Alpine > 3.18 and Arch Linux for now
# other distributions have too old versions of bcachefs-tools and/or util-linux (blkid for UUID tests)
- 'ansible_facts.distribution == "Alpine" and ansible_facts.distribution_version is version("3.18", ">") and item.0.key == "bcachefs"'
- 'ansible_facts.distribution == "Archlinux" and item.0.key == "bcachefs"'
- 'not (ansible_facts.distribution not in ["Alpine", "Archlinux"] and item.0.key == "bcachefs")'
# TODO: bcachefs on Arch uses a different output format; instead of 'Size: 20.0 MiB' it now prints 'Size: 20.0M',
# which breaks Bcachefs.get_fs_size(). This seems to be related to the C -> Rust conversion of the CLI tools.
# It also seems that it is now impossible to know whether base 2 or 10 units are used... :(
- 'not (ansible_facts.distribution in ["Archlinux"] and item.0.key == "bcachefs")'
# f2fs-tools and reiserfs-utils packages not available with RHEL/CentOS on CI
- 'not (ansible_facts.distribution in ["CentOS", "RedHat"] and item.0.key in ["f2fs", "reiserfs"])'
- 'not (ansible_facts.os_family == "RedHat" and item.0.key == "btrfs")'

View file

@ -5,7 +5,7 @@
# Skip UUID reset tests for FreeBSD due to "xfs_admin: only 'rewrite' supported on V5 fs"
- when:
- new_uuid | default(False)
- (new_uuid | default(false)) is truthy
- not (ansible_facts.system == "FreeBSD" and fstype == "xfs")
block:
- name: "Create filesystem ({{ fstype }})"

View file

@ -9,7 +9,7 @@
# Skip UUID set at creation tests for FreeBSD due to "xfs_admin: only 'rewrite' supported on V5 fs"
- when:
- new_uuid | default(False)
- (new_uuid | default(false)) is truthy
- not (ansible_facts.system == "FreeBSD" and fstype == "xfs")
block:
- name: "Create filesystem ({{ fstype }}) with UUID"
@ -29,7 +29,7 @@
ansible.builtin.assert:
that: (random_uuid | replace('-','')) == ( uuid.stdout | replace('-',''))
- when: not (new_uuid | default(False))
- when: (new_uuid | default(false)) is not truthy
block:
- name: "Create filesystem ({{ fstype }}) without UUID support"
ignore_errors: true

View file

@ -5,7 +5,7 @@
# UUID set at creation with opts for XFS is not supported
- when:
- new_uuid | default(False)
- (new_uuid | default(false)) is truthy
- fstype != "xfs"
block:

View file

@ -21,8 +21,10 @@
when:
# bcachefs only on Alpine > 3.18 and Arch Linux for now
# other distributions have too old versions of bcachefs-tools and/or util-linux (blkid for UUID tests)
- ansible_facts.distribution == "Alpine" and ansible_facts.distribution_version is version("3.18", ">")
- ansible_facts.distribution == "Archlinux"
- >-
(ansible_facts.distribution == "Alpine" and ansible_facts.distribution_version is version("3.18", ">"))
or
ansible_facts.distribution == "Archlinux"
- name: "Install btrfs progs"
ansible.builtin.package:
@ -35,6 +37,15 @@
- not (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version is version('8', '>='))
- ansible_facts.os_family != 'Archlinux' # TODO
- name: "Install util-linux-extra"
ansible.builtin.package:
name: util-linux-extra
state: present
when:
- ansible_facts.os_family == 'Debian'
- not (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version is version('24.04', '<'))
- not (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_version is version('12', '<'))
- name: "Install btrfs tools (Ubuntu <= 16.04)"
ansible.builtin.package:
name: btrfs-tools
@ -159,4 +170,5 @@
# using the entire block device.
force_creation: "{{ e2fsprogs_version is version('1.43', '<') }}"
# Earlier versions have a segfault bug
resize_vfat: "{{ fatresize_version|default('0.0') is version('1.0.4', '>=') }}"
# Also there's an assertion bug on Ubuntu
resize_vfat: "{{ fatresize_version|default('0.0') is version('1.0.4', '>=') and ansible_facts.distribution != 'Ubuntu' }}"