mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-11-22 05:01:25 +00:00
Add a new testcase to test creation of LVM with ext4 using Blivet.
This PR adds a test that uses the Blivet interface to create an LVM layout with ext4 filesystem as well as a postinstall test that checks that the LVM layout has been created correctly.
This commit is contained in:
parent
a868b1241a
commit
866a8efa72
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"area": [
|
||||||
|
{
|
||||||
|
"height": 26,
|
||||||
|
"ypos": 145,
|
||||||
|
"xpos": 397,
|
||||||
|
"width": 64,
|
||||||
|
"type": "match"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": [],
|
||||||
|
"tags": [
|
||||||
|
"anaconda_blivet_part_devicetype_lvm"
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"properties": [],
|
||||||
|
"tags": [
|
||||||
|
"anaconda_blivet_part_devicetype_lvm"
|
||||||
|
],
|
||||||
|
"area": [
|
||||||
|
{
|
||||||
|
"xpos": 415,
|
||||||
|
"ypos": 149,
|
||||||
|
"width": 84,
|
||||||
|
"height": 18,
|
||||||
|
"type": "match"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
@ -956,6 +956,19 @@
|
|||||||
"ROOT_PASSWORD": "weakpassword"
|
"ROOT_PASSWORD": "weakpassword"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"install_blivet_lvm_ext4": {
|
||||||
|
"profiles": {
|
||||||
|
"fedora-Server-dvd-iso-aarch64-*-aarch64": 40,
|
||||||
|
"fedora-Server-dvd-iso-ppc64le-*-ppc64le": 40,
|
||||||
|
"fedora-Server-dvd-iso-x86_64-*-64bit": 40,
|
||||||
|
"fedora-Server-dvd-iso-x86_64-*-uefi": 41
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"PARTITIONING": "custom_blivet_lvm_ext4",
|
||||||
|
"POSTINSTALL": "disk_custom_lvm_ext4_postinstall",
|
||||||
|
"ROOT_PASSWORD": "weakpassword"
|
||||||
|
}
|
||||||
|
},
|
||||||
"install_blivet_standard_partition_ext4": {
|
"install_blivet_standard_partition_ext4": {
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"fedora-Server-dvd-iso-aarch64-*-aarch64": 40,
|
"fedora-Server-dvd-iso-aarch64-*-aarch64": 40,
|
||||||
@ -1249,7 +1262,7 @@
|
|||||||
"fedora-Server-dvd-iso-x86_64-*-uefi": 41
|
"fedora-Server-dvd-iso-x86_64-*-uefi": 41
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"PARTITIONING": "custom_lvm",
|
"PARTITIONING": "custom_lvm_ext4",
|
||||||
"ROOT_PASSWORD": "weakpassword",
|
"ROOT_PASSWORD": "weakpassword",
|
||||||
"STORE_HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2"
|
"STORE_HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2"
|
||||||
}
|
}
|
||||||
|
43
tests/disk_custom_blivet_lvm_ext4.pm
Normal file
43
tests/disk_custom_blivet_lvm_ext4.pm
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
use base "anacondatest";
|
||||||
|
use strict;
|
||||||
|
use testapi;
|
||||||
|
use anaconda;
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
my $self = shift;
|
||||||
|
# Go to INSTALLATION DESTINATION and ensure the disk is selected.
|
||||||
|
# Because PARTITIONING starts with 'custom_blivet', this will select blivet-gui.
|
||||||
|
select_disks();
|
||||||
|
assert_and_click "anaconda_spoke_done";
|
||||||
|
|
||||||
|
if (get_var("UEFI")) {
|
||||||
|
# if we're running on UEFI, we need esp
|
||||||
|
custom_blivet_add_partition(size => 512, mountpoint => '/boot/efi', filesystem => 'efi_filesystem');
|
||||||
|
}
|
||||||
|
if (get_var("OFW")) {
|
||||||
|
custom_blivet_add_partition(size => 4, filesystem => 'ppc_prep_boot');
|
||||||
|
}
|
||||||
|
|
||||||
|
custom_blivet_add_partition(size => 512, mountpoint => '/boot', filesystem => 'ext4');
|
||||||
|
# add new LVM device
|
||||||
|
custom_blivet_add_partition(devicetype => 'lvm');
|
||||||
|
# select newly created LVM device for adding new partition
|
||||||
|
assert_and_click "anaconda_blivet_volumes_icon";
|
||||||
|
# add lvm partition with ext4 and mount is as /
|
||||||
|
custom_blivet_add_partition(devicetype => 'lvm', filesystem => 'ext4', mountpoint => '/');
|
||||||
|
|
||||||
|
assert_and_click "anaconda_spoke_done";
|
||||||
|
assert_and_click "anaconda_part_accept_changes";
|
||||||
|
|
||||||
|
# Anaconda hub
|
||||||
|
assert_screen "anaconda_main_hub", 300; #
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub test_flags {
|
||||||
|
return { fatal => 1 };
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
# vim: set sw=4 et:
|
@ -16,8 +16,8 @@ sub run {
|
|||||||
# Do 'automatic' partition creation
|
# Do 'automatic' partition creation
|
||||||
assert_and_click "anaconda_part_automatic";
|
assert_and_click "anaconda_part_automatic";
|
||||||
# Change file system to ext4 on root and boot partitions.
|
# Change file system to ext4 on root and boot partitions.
|
||||||
custom_change_fs("ext4", "root");
|
|
||||||
custom_change_fs("ext4", "boot");
|
custom_change_fs("ext4", "boot");
|
||||||
|
custom_change_fs("ext4", "root");
|
||||||
# Confirm changes
|
# Confirm changes
|
||||||
assert_and_click "anaconda_spoke_done";
|
assert_and_click "anaconda_spoke_done";
|
||||||
assert_and_click "anaconda_part_accept_changes";
|
assert_and_click "anaconda_part_accept_changes";
|
32
tests/disk_custom_lvm_ext4_postinstall.pm
Normal file
32
tests/disk_custom_lvm_ext4_postinstall.pm
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
use base "installedtest";
|
||||||
|
use strict;
|
||||||
|
use testapi;
|
||||||
|
|
||||||
|
sub run {
|
||||||
|
assert_screen "root_console";
|
||||||
|
my $devboot = 'vda1';
|
||||||
|
|
||||||
|
if (get_var('OFW') || get_var('UEFI')) {
|
||||||
|
$devboot = 'vda2';
|
||||||
|
}
|
||||||
|
# check that lvm is present:
|
||||||
|
validate_script_output "lvdisplay | grep 'LV Status'", sub { $_ =~ m/available/ };
|
||||||
|
|
||||||
|
# Check for standard LVM attributes, w - writable, i-inherited, a-active, o-open
|
||||||
|
validate_script_output "lvs -o lv_attr", sub { $_ =~ m/wi-ao/ };
|
||||||
|
|
||||||
|
# Check that the partitions are ext4.
|
||||||
|
validate_script_output "mount | grep /dev/$devboot", sub { $_ =~ m/on \/boot type ext4/ };
|
||||||
|
|
||||||
|
# There should be one partition in the LVM.
|
||||||
|
validate_script_output "mount | grep /dev/mapper", sub { $_ =~ m/on \/ type ext4/ };
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub test_flags {
|
||||||
|
return { fatal => 1 };
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
# vim: set sw=4 et:
|
Loading…
Reference in New Issue
Block a user