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

Add update tests to build and test a netinst image

This adds a test which builds a netinst image potentially with
the package(s) from the update, and uploads that image. It also
adds a test which runs a default install using that image. This
is intended to check whether the update breaks the creation or
use of install images; particularly this will let us test
anaconda etc. updates. We also update the minimal disk image
name, as we have to make it bigger to accommodate this test,
and making it bigger changes its name - the actual change to
the disk image itself is in createhdds. We also have to redo a
bunch of installer needles for F28 fonts, after I removed them
a month or so back...

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-08-31 13:34:12 -07:00
parent 510662c1ec
commit 12affb145f
35 changed files with 395 additions and 8 deletions

View File

@ -98,6 +98,11 @@ sub post_fail_hook {
# Sometimes useful for diagnosing FreeIPA issues
upload_logs "/etc/nsswitch.conf", failok=>1;
# for installer creation test
upload_logs "/root/imgbuild/pylorax.log", failok=>1;
upload_logs "/root/imgbuild/lorax.log", failok=>1;
upload_logs "/root/imgbuild/program.log", failok=>1;
}
# For update tests, let's do the update package info log stuff,

17
main.pm
View File

@ -272,8 +272,10 @@ sub load_postinstall_tests() {
# (intended for the updates testing workflow, so we install the updates
# to be tested). Don't do this for UPGRADE tests, as the update gets
# installed as part of the upgrade in that case and we don't need the
# extra reboot.
if (get_var("ADVISORY") && !get_var("UPGRADE")) {
# extra reboot. Don't do this for INSTALL test(s); these are checking
# that an installer image built from the update works and do not install
# the update themselves.
if (get_var("ADVISORY") && !get_var("UPGRADE") && !get_var("INSTALL")) {
autotest::loadtest "tests/_advisory_update.pm";
# now load the early boot tests again, as _advisory_update reboots
_load_early_postinstall_tests(2);
@ -315,8 +317,10 @@ sub load_postinstall_tests() {
}
# load the ADVISORY post-install test - this records which update
# packages were actually installed during the test
if (get_var("ADVISORY")) {
# packages were actually installed during the test. Don't do this
# for INSTALL test(s); these are checking that an installer image
# built from the update works and do not install the update themselves.
if (get_var("ADVISORY") && !get_var("INSTALL")) {
autotest::loadtest "tests/_advisory_post.pm";
}
@ -343,9 +347,10 @@ if (get_var("ENTRYPOINT")) {
elsif (get_var("UPGRADE")) {
load_upgrade_tests;
}
elsif (!get_var("START_AFTER_TEST") && !get_var("BOOTFROM")) {
elsif ((!get_var("START_AFTER_TEST") && !get_var("BOOTFROM")) || get_var("INSTALL")) {
# for now we can assume START_AFTER_TEST and BOOTFROM mean the
# test picks up after an install, so we skip to post-install
# test picks up after an install, so we skip to post-install,
# unless the override INSTALL var is set
load_install_tests;
}

View File

@ -0,0 +1,24 @@
{
"area": [
{
"ypos": 636,
"xpos": 704,
"type": "match",
"width": 314,
"height": 20
},
{
"ypos": 685,
"type": "match",
"xpos": 955,
"height": 14,
"width": 48
}
],
"properties": [],
"tags": [
"anaconda_install_done",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"type": "match",
"xpos": 886,
"height": 17,
"width": 118,
"ypos": 685
}
],
"properties": [],
"tags": [
"anaconda_install_finish_configuration",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"ypos": 161,
"xpos": 186,
"type": "match",
"width": 72,
"height": 57
}
],
"properties": [],
"tags": [
"anaconda_install_root_password",
"ENV-DISTRI-fedora"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View File

@ -0,0 +1,18 @@
{
"area": [
{
"xpos": 244,
"type": "match",
"width": 96,
"height": 15,
"ypos": 124
}
],
"properties": [],
"tags": [
"anaconda_install_root_password_screen",
"ENV-DISTRI-fedora",
"LANGUAGE-english",
"ENV-FLAVOR-server"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 630,
"type": "match",
"width": 19,
"height": 59,
"ypos": 154
}
],
"properties": [],
"tags": [
"ENV-DISTRI-fedora",
"anaconda_install_user_creation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 362,
"type": "match",
"width": 194,
"height": 21,
"ypos": 212
}
],
"properties": [],
"tags": [
"ENV-DISTRI-fedora",
"LANGUAGE-english",
"anaconda_install_user_creation_make_admin"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,25 @@
{
"area": [
{
"ypos": 153,
"height": 17,
"width": 69,
"type": "match",
"xpos": 272
},
{
"type": "match",
"xpos": 281,
"height": 17,
"width": 62,
"ypos": 278
}
],
"properties": [],
"tags": [
"anaconda_install_user_creation_screen",
"ENV-DISTRI-fedora",
"LANGUAGE-english",
"ENV-FLAVOR-server"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"ypos": 103,
"width": 87,
"height": 28,
"xpos": 357,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_select_install_lang",
"ENV-DISTRI-fedora"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 927,
"type": "match",
"width": 88,
"height": 24,
"ypos": 733
}
],
"properties": [],
"tags": [
"anaconda_select_install_lang_continue",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,18 @@
{
"area": [
{
"ypos": 200,
"type": "match",
"xpos": 603,
"height": 18,
"width": 165
}
],
"properties": [],
"tags": [
"anaconda_select_install_lang_selected",
"anaconda_select_install_lang_filtered",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"height": 17,
"width": 107,
"type": "match",
"xpos": 895,
"ypos": 707
}
],
"properties": [],
"tags": [
"anaconda_main_hub_begin_installation",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"ypos": 463,
"width": 66,
"height": 75,
"xpos": 189,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_main_hub_install_destination",
"anaconda_main_hub_install_destination_warning",
"ENV-DISTRI-fedora"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -0,0 +1,30 @@
{
"area": [
{
"ypos": 344,
"xpos": 190,
"type": "match",
"width": 63,
"height": 61
},
{
"xpos": 184,
"type": "match",
"width": 74,
"height": 56,
"ypos": 154
},
{
"ypos": 216,
"height": 70,
"width": 66,
"type": "match",
"xpos": 186
}
],
"properties": [],
"tags": [
"anaconda_main_hub",
"ENV-DISTRI-fedora"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"ypos": 469,
"width": 100,
"height": 17,
"xpos": 648,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-fedora",
"LANGUAGE-english",
"anaconda_rawhide_accept_fate"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"type": "match",
"xpos": 23,
"height": 22,
"width": 55,
"ypos": 50
}
],
"properties": [],
"tags": [
"anaconda_spoke_done",
"ENV-DISTRI-fedora",
"LANGUAGE-english"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -4963,7 +4963,7 @@
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "USER_LOGIN", value => "false" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_f%CURRREL%_minimal_2_%ARCH%.img" },
{ key => "HDD_1", value => "disk_f%CURRREL%_minimal_3_%ARCH%.img" },
{ key => "UPGRADE", value => "1" },
{ key => "TEST_TARGET", value => "COMPOSE" },
],
@ -5063,7 +5063,7 @@
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "USER_LOGIN", value => "false" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_f%PREVREL%_minimal_2_%ARCH%.img" },
{ key => "HDD_1", value => "disk_f%PREVREL%_minimal_3_%ARCH%.img" },
{ key => "UPGRADE", value => "1" },
{ key => "TEST_TARGET", value => "COMPOSE" },
],

View File

@ -366,6 +366,30 @@
},
test_suite => { name => "advisory_boot" },
},
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-installer",
version => "*",
},
test_suite => { name => "installer_build" },
},
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-installer",
version => "*",
},
test_suite => { name => "install_default_update" },
},
{
group_name => "Fedora PowerPC Updates",
machine => { name => "ppc64le" },
@ -881,6 +905,15 @@
],
version => "*",
},
{
arch => "x86_64",
distri => "fedora",
flavor => "updates-installer",
name => "",
settings => [
],
version => "*",
},
{
arch => "ppc64le",
distri => "fedora",
@ -937,5 +970,24 @@
{ key => "ADVISORY_BOOT_TEST", value => "1" },
],
},
{
name => "installer_build",
settings => [
{ key => "POSTINSTALL", value => "_installer_build" },
{ key => "USER_LOGIN", value => "false" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_f%VERSION%_minimal_3_%ARCH%.img" },
],
},
{
name => "install_default_update",
settings => [
{ key => "INSTALL", value => "1" },
{ key => "ISO", value => "%ADVISORY%-netinst-%ARCH%.iso" },
{ key => "PACKAGE_SET", value => "default" },
{ key => "+START_AFTER_TEST", value => "installer_build" },
],
},
],
}

43
tests/_installer_build.pm Normal file
View File

@ -0,0 +1,43 @@
use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
my $version = get_var("VERSION");
my $advisory = get_var("ADVISORY");
my $arch = get_var("ARCH");
# we need lorax from u-t for f28 atm it seems
my $loraxcmd = "dnf -y ";
$loraxcmd .= "--enablerepo=updates-testing " if (get_var("VERSION") eq "28");
$loraxcmd .= "install lorax";
assert_script_run $loraxcmd, 90;
# this 'temporary file cleanup' thing can actually wipe bits of
# the lorax install root while lorax is still running...
assert_script_run "systemctl stop systemd-tmpfiles-clean.timer";
# dracut-fips doesn't exist any more; this breaks f28 builds as
# it *did* exist when f28 came out, so lorax tries to use
# dracut-fips from the frozen release repo with newer lorax from
# the updates repo which obsoletes it, and gets confused
assert_script_run 'sed -i -e "s,dracut-fips,,g" /usr/share/lorax/templates.d/99-generic/runtime-install.tmpl';
assert_script_run "mkdir -p /root/imgbuild";
assert_script_run "pushd /root/imgbuild";
assert_script_run "setenforce Permissive";
my $cmd = "lorax -p Fedora -v ${version} -r ${version} --repo=/etc/yum.repos.d/fedora.repo";
unless (get_var("DEVELOPMENT")) {
$cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo";
}
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo ./results";
assert_script_run $cmd, 1500;
assert_script_run "mv results/images/boot.iso ./${advisory}-netinst-${arch}.iso";
upload_asset "./${advisory}-netinst-x86_64.iso";
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et: