1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-29 09:03:08 +00:00

Add custom partitioning tests for blivet

Differential Revision: https://phab.qa.fedoraproject.org/D1188
This commit is contained in:
Jan Sedlák 2017-04-24 14:23:35 +02:00
parent 22e210aa21
commit 140c5f0a42
47 changed files with 688 additions and 3 deletions

View File

@ -8,7 +8,7 @@ use Exporter;
use testapi; use testapi;
use utils; use utils;
our @EXPORT = qw/select_disks custom_scheme_select custom_change_type custom_change_fs custom_change_device custom_delete_part get_full_repo get_mirrorlist_url/; our @EXPORT = qw/select_disks custom_scheme_select custom_blivet_add_partition custom_change_type custom_change_fs custom_change_device custom_delete_part get_full_repo get_mirrorlist_url/;
sub select_disks { sub select_disks {
# Handles disk selection. Has one optional argument - number of # Handles disk selection. Has one optional argument - number of
@ -79,8 +79,11 @@ sub select_disks {
assert_and_click "anaconda_spoke_done"; assert_and_click "anaconda_spoke_done";
} }
# If this is a custom partitioning test, select custom partitioning. # If this is a custom partitioning test, select custom partitioning. For testing blivet-gui,
if (get_var('PARTITIONING') =~ /^custom_/) { # name of test module should start with custom_blivet_, otherwise it should start with custom_.
if (get_var('PARTITIONING') =~ /^custom_blivet_/) {
assert_and_click "anaconda_manual_blivet_partitioning";
} elsif (get_var('PARTITIONING') =~ /^custom_/) {
assert_and_click "anaconda_manual_partitioning"; assert_and_click "anaconda_manual_partitioning";
} }
} }
@ -99,6 +102,71 @@ sub custom_scheme_select {
assert_and_click "anaconda_part_scheme_$scheme"; assert_and_click "anaconda_part_scheme_$scheme";
} }
sub custom_blivet_add_partition {
# Used to add partition on blivet-gui partitioning screen
# in Anaconda. Should be called when blivet-gui is displayed and free space is selected.
# You can pass device type for partition (needle tagged anaconda_blivet_devicetype_$devicetype should exist),
# whether partitions should be of RAID1 (devicetype is then automatically handled) - you then
# need to have two disks added, size of that partition in MBs, desired filesystem of that partition
# (anaconda_blivet_part_fs_$filesystem should exist) and mountpoint of that partition (e. g. string "/boot").
my %args = (
devicetype => "",
raid1 => 0,
size => 0,
filesystem => "",
mountpoint => "",
@_
);
$args{devicetype} = "raid" if $args{raid1};
assert_and_click "anaconda_blivet_part_add";
mouse_set(10, 10);
if ($args{devicetype}) {
assert_and_click "anaconda_blivet_part_devicetype";
mouse_set(10, 10);
assert_and_click "anaconda_blivet_part_devicetype_$args{devicetype}";
}
if ($args{raid1}) {
# for RAID1, two disks should be selected
send_key "tab";
send_key "down";
send_key "spc";
assert_screen "anaconda_blivet_vdb_selected";
assert_and_click "anaconda_blivet_raidlevel_select";
mouse_set(10, 10);
assert_and_click "anaconda_blivet_raidlevel_raid1";
}
if ($args{size}) {
type_safely "\t\t";
# if we clicked on "raidlevel" before, we need to type only two tabs,
# otherwise size input box is still one tab away
if (!$args{raid1}) {
send_key "tab";
}
# size input can contain whole set of different values, so we can't match it with needle
type_safely $args{size} . "\n";
}
# if no filesystem was specified or filesystem is already selected, do nothing
if ($args{filesystem} && !check_screen("anaconda_blivet_part_fs_$args{filesystem}_selected", 5)) {
assert_and_click "anaconda_blivet_part_fs";
# Move the mouse away from the menu
mouse_set(10, 10);
assert_and_click "anaconda_blivet_part_fs_$args{filesystem}";
}
if ($args{mountpoint}) {
assert_and_click "anaconda_blivet_mountpoint";
type_safely $args{mountpoint} . "\n";
}
assert_and_click "anaconda_blivet_btn_ok";
# select "free space" in blivet-gui if it exists, so we could run this function again to add another partition
if (check_screen("anaconda_blivet_free_space", 5)) {
assert_and_click "anaconda_blivet_free_space";
}
}
sub custom_change_type { sub custom_change_type {
# Used to set different device types for specified partition (e.g. # Used to set different device types for specified partition (e.g.
# RAID). Should be called when custom partitioning spoke is # RAID). Should be called when custom partitioning spoke is

View File

@ -0,0 +1,15 @@
{
"tags": [
"anaconda_blivet_btn_ok"
],
"properties": [],
"area": [
{
"xpos": 710,
"ypos": 582,
"width": 71,
"height": 26,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,16 @@
{
"tags": [
"LANGUAGE-english",
"anaconda_blivet_free_space"
],
"properties": [],
"area": [
{
"xpos": 247,
"ypos": 336,
"width": 64,
"height": 16,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 39,
"ypos": 186,
"width": 36,
"height": 35,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_blivet_lvm_drive"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -0,0 +1,16 @@
{
"tags": [
"LANGUAGE-english",
"anaconda_blivet_mountpoint"
],
"area": [
{
"width": 215,
"type": "match",
"ypos": 485,
"xpos": 333,
"height": 24
}
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"height": 20,
"xpos": 282,
"type": "match",
"ypos": 658,
"width": 206
}
],
"tags": [
"LANGUAGE-english",
"anaconda_blivet_mountpoint"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 232,
"ypos": 253,
"width": 26,
"height": 27,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_blivet_part_add"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 26,
"width": 164,
"xpos": 330,
"type": "match",
"ypos": 170
}
],
"properties": [],
"tags": [
"anaconda_blivet_part_devicetype"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 414,
"ypos": 199,
"width": 42,
"height": 26,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_blivet_part_devicetype_lvm"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"anaconda_blivet_part_devicetype"
],
"area": [
{
"ypos": 158,
"width": 210,
"height": 15,
"type": "match",
"xpos": 335
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,15 @@
{
"tags": [
"anaconda_blivet_part_devicetype_lvmthin"
],
"area": [
{
"xpos": 454,
"ypos": 186,
"width": 56,
"height": 19,
"type": "match"
}
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 91,
"ypos": 262,
"xpos": 415,
"type": "match",
"height": 18
}
],
"tags": [
"anaconda_blivet_part_devicetype_raid"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 342,
"ypos": 397,
"width": 167,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"LANGUAGE-english",
"anaconda_blivet_part_fs",
"anaconda_blivet_part_fs_xfs_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 413,
"ypos": 371,
"width": 55,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_blivet_part_fs_ext3"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 414,
"ypos": 456,
"width": 69,
"height": 26,
"type": "match"
}
],
"tags": [
"anaconda_blivet_part_fs_swap"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"area": [
{
"xpos": 414,
"ypos": 515,
"width": 83,
"height": 23,
"type": "match"
}
],
"tags": [
"anaconda_blivet_part_fs_xfs"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 363,
"ypos": 173,
"width": 53,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_blivet_raidlevel_raid1"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 322,
"height": 24,
"width": 99,
"type": "match",
"ypos": 200
}
],
"properties": [],
"tags": [
"anaconda_blivet_raidlevel_select"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,15 @@
{
"tags": [
"anaconda_blivet_thinpool_part"
],
"area": [
{
"xpos": 317,
"ypos": 338,
"width": 70,
"height": 12,
"type": "match"
}
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"area": [
{
"xpos": 368,
"ypos": 166,
"width": 51,
"height": 14,
"type": "match"
}
],
"tags": [
"anaconda_blivet_vdb_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 430,
"ypos": 489,
"width": 120,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"LANGUAGE-english",
"anaconda_manual_blivet_partitioning"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

147
templates
View File

@ -897,6 +897,61 @@
}, },
test_suite => { name => "install_iscsi" }, test_suite => { name => "install_iscsi" },
}, },
{
machine => { name => "64bit" },
prio => 90,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_ext3" },
},
{
machine => { name => "64bit" },
prio => 90,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_no_swap" },
},
{
machine => { name => "64bit" },
prio => 90,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_xfs" },
},
{
machine => { name => "64bit" },
prio => 90,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_software_raid" },
},
{
machine => { name => "64bit" },
prio => 90,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_lvmthin" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 50, prio => 50,
@ -1414,6 +1469,61 @@
}, },
test_suite => { name => "install_lvmthin" }, test_suite => { name => "install_lvmthin" },
}, },
{
machine => { name => "64bit" },
prio => 93,
product => {
arch => "i386",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_ext3" },
},
{
machine => { name => "64bit" },
prio => 93,
product => {
arch => "i386",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_no_swap" },
},
{
machine => { name => "64bit" },
prio => 93,
product => {
arch => "i386",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_xfs" },
},
{
machine => { name => "64bit" },
prio => 93,
product => {
arch => "i386",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_software_raid" },
},
{
machine => { name => "64bit" },
prio => 93,
product => {
arch => "i386",
distri => "fedora",
flavor => "universal",
version => "*",
},
test_suite => { name => "install_blivet_lvmthin" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 82, prio => 82,
@ -1876,6 +1986,43 @@
{ key => "ROOT_PASSWORD", value => "weakpassword" }, { key => "ROOT_PASSWORD", value => "weakpassword" },
], ],
}, },
{
name => "install_blivet_ext3",
settings => [
{ key => "PARTITIONING", value => "custom_blivet_ext3" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
],
},
{
name => "install_blivet_no_swap",
settings => [
{ key => "PARTITIONING", value => "custom_blivet_no_swap" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
],
},
{
name => "install_blivet_xfs",
settings => [
{ key => "PARTITIONING", value => "custom_blivet_xfs" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
],
},
{
name => "install_blivet_software_raid",
settings => [
{ key => "PARTITIONING", value => "custom_blivet_software_raid" },
{ key => "POSTINSTALL", value => "disk_custom_software_raid_postinstall" },
{ key => "NUMDISKS", value => "2" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
],
},
{
name => "install_blivet_lvmthin",
settings => [
{ key => "PARTITIONING", value => "custom_blivet_lvmthin" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
],
},
{ {
name => "install_kickstart_hdd", name => "install_kickstart_hdd",
settings => [ settings => [

View File

@ -0,0 +1,31 @@
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";
custom_blivet_add_partition(size => 512, mountpoint => '/boot');
custom_blivet_add_partition(size => 2048, filesystem => 'swap');
custom_blivet_add_partition(filesystem => 'ext3', 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:

View File

@ -0,0 +1,39 @@
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";
custom_blivet_add_partition(size => 512, mountpoint => '/boot');
# add new LVM device
custom_blivet_add_partition(devicetype => 'lvm');
# select newly created LVM device for adding new partition
assert_and_click "anaconda_blivet_lvm_drive";
custom_blivet_add_partition(size => 2048, filesystem => 'swap');
# add lvmthinpool
custom_blivet_add_partition(devicetype => 'lvmthin');
# select lvmthinpool for adding new partitions
assert_and_click "anaconda_blivet_thinpool_part";
custom_blivet_add_partition(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:

View File

@ -0,0 +1,32 @@
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";
custom_blivet_add_partition(size => 512, mountpoint => '/boot');
custom_blivet_add_partition(mountpoint => '/');
assert_and_click "anaconda_spoke_done";
# click "done" second time, because it warns us about missing swap partition
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:

View File

@ -0,0 +1,31 @@
use base "anacondatest";
use strict;
use testapi;
use anaconda;
sub run {
my $self = shift;
# Go to INSTALLATION DESTINATION and ensure two disks are selected.
# Because PARTITIONING starts with 'custom_blivet', this will select blivet-gui.
select_disks(disks=>2);
assert_and_click "anaconda_spoke_done";
custom_blivet_add_partition(size => 512, mountpoint => '/boot');
custom_blivet_add_partition(size => 2048, filesystem => 'swap');
custom_blivet_add_partition(raid1 => 1, 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:

View File

@ -0,0 +1,31 @@
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";
custom_blivet_add_partition(size => 512, mountpoint => '/boot');
custom_blivet_add_partition(size => 2048, filesystem => 'swap');
custom_blivet_add_partition(filesystem => 'xfs', 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: