Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable GFS2 support in blivet #418

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions library/blivet.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
fs_label:
description: fs_label
type: str
default: ''
fs_type:
description: fs_type
type: str
Expand Down Expand Up @@ -216,7 +215,6 @@
fs_label:
description: fs_label
type: str
default: ''
fs_type:
description: fs_type
type: str
Expand Down Expand Up @@ -412,6 +410,7 @@
if BLIVET_PACKAGE:
blivet_flags.debug = True
blivet_flags.allow_online_fs_resize = True
blivet_flags.gfs2 = True

Check warning on line 413 in library/blivet.py

View check run for this annotation

Codecov / codecov/patch

library/blivet.py#L413

Added line #L413 was not covered by tests
set_up_logging()
log = logging.getLogger(BLIVET_PACKAGE + ".ansible")

Expand Down Expand Up @@ -2090,7 +2089,7 @@
encryption_luks_version=dict(type='str'),
encryption_password=dict(type='str', no_log=True),
fs_create_options=dict(type='str'),
fs_label=dict(type='str', default=''),
fs_label=dict(type='str'),
fs_type=dict(type='str'),
mount_options=dict(type='str'),
mount_point=dict(type='str'),
Expand Down
7 changes: 6 additions & 1 deletion tests/test-verify-volume-fs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
should
('{{ storage_test_blkinfo.info[storage_test_volume._device].label }}',
'{{ storage_test_volume.fs_label }}')
when: _storage_test_volume_present | bool
when:
- _storage_test_volume_present | bool
# label for GFS2 is set manually with the extra `-t` fs_create_options
# so we can't verify it here because it was not set with fs_label so
# the label from blkinfo doesn't match the expected "empty" fs_label
- storage_test_volume.fs_type != "gfs2"
4 changes: 4 additions & 0 deletions tests/tests_lvm_pool_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
- name: lv1
size: "{{ volume1_size }}"
mount_point: "{{ mount_location1 }}"
fs_type: gfs2
fs_create_options: -j 2 -t rhel9-1node:myfs

- name: Verify role results
include_tasks: verify-role-results.yml
Expand All @@ -144,6 +146,8 @@
- name: lv1
size: "{{ volume1_size }}"
mount_point: "{{ mount_location1 }}"
fs_type: gfs2
fs_create_options: -j 2 -t rhel9-1node:myfs

- name: Verify role results
include_tasks: verify-role-results.yml
Expand Down
34 changes: 34 additions & 0 deletions tests/tests_volume_relabel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,40 @@
- name: Verify role results
include_tasks: verify-role-results.yml

- name: Relabel without explicitly setting the label
include_role:
name: linux-system-roles.storage
vars:
storage_volumes:
- name: test1
type: disk
mount_point: "{{ mount_location }}"
fs_type: ext4
disks: "{{ unused_disks }}"

- name: Check for default value
assert:
that: not blivet_output.changed
msg: "Volume relabeling doesn't preserve existing label."

- name: Verify role results
include_tasks: verify-role-results.yml

- name: Remove label
include_role:
name: linux-system-roles.storage
vars:
storage_volumes:
- name: test1
type: disk
mount_point: "{{ mount_location }}"
fs_type: ext4
disks: "{{ unused_disks }}"
fs_label: ""

- name: Verify role results
include_tasks: verify-role-results.yml

- name: Clean up
include_role:
name: linux-system-roles.storage
Expand Down
Loading