1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-14 20:07:38 +00:00

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).

* [TEMP] Generally disable gfs2 tests.
This commit is contained in:
Felix Fontein 2026-06-14 00:20:48 +02:00 committed by GitHub
parent 763ae7b1e1
commit ed8afeb16b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 11 deletions

View file

@ -29,7 +29,8 @@ tested_filesystems:
lvm: {fssize: 20, grow: true, new_uuid: 'something'}
swap: {fssize: 10, grow: false, new_uuid: null} # grow not implemented
ufs: {fssize: 10, grow: true, new_uuid: null}
gfs2: {fssize: 10, grow: false, new_uuid: null}
# TODO: tests seem to be generally broken
# gfs2: {fssize: 10, grow: false, new_uuid: null}
get_uuid_any: "blkid -c /dev/null -o value -s UUID {{ dev }}"

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
@ -92,7 +103,7 @@
ansible.builtin.package:
name: gfs2-utils
state: present
when: ansible_facts.os_family in ['Debian', 'Suse', 'Ubuntu']
when: ansible_facts.os_family in ['Debian', 'Suse', 'Ubuntu'] or ansible_facts.distribution in ['Fedora']
- name: "Install f2fs tools and get version"
when:
@ -165,4 +176,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' }}"