Add a test of bootchain stuff for updates

This adds a new test intended to just check boot chain things
for updates. It doesn't run any test modules besides the stock
update ones, but sets a variable, ADVISORY_BOOT_TEST, which
causes _advisory_update to do some additional stuff after
installing the updates but before rebooting: it forces regen
of the initramfs and bootloader config, and reinstalls the
bootloader on BIOS (not UEFI as it's not relevant). If the
following boot fails, we probably have a bug somewhere.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-10-04 15:19:43 -07:00
parent 1d6491d143
commit 0bf76db7d5
2 changed files with 69 additions and 0 deletions

View File

@ -354,6 +354,30 @@
}, },
test_suite => { name => "server_firewall_default" }, test_suite => { name => "server_firewall_default" },
}, },
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-server",
version => "*",
},
test_suite => { name => "advisory_boot" },
},
{
group_name => "Fedora Updates",
machine => { name => "uefi" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-server",
version => "*",
},
test_suite => { name => "advisory_boot" },
},
{ {
group_name => "Fedora PowerPC Updates", group_name => "Fedora PowerPC Updates",
machine => { name => "ppc64le" }, machine => { name => "ppc64le" },
@ -642,6 +666,18 @@
}, },
test_suite => { name => "server_firewall_default" }, test_suite => { name => "server_firewall_default" },
}, },
{
group_name => "Fedora PowerPC Updates",
machine => { name => "ppc64" },
prio => 40,
product => {
arch => "ppc64",
distri => "fedora",
flavor => "updates-server",
version => "*",
},
test_suite => { name => "advisory_boot" },
},
{ {
group_name => "Fedora AArch64 Updates", group_name => "Fedora AArch64 Updates",
machine => { name => "aarch64" }, machine => { name => "aarch64" },
@ -786,6 +822,18 @@
}, },
test_suite => { name => "server_firewall_default" }, test_suite => { name => "server_firewall_default" },
}, },
{
group_name => "Fedora AArch64 Updates",
machine => { name => "aarch64" },
prio => 40,
product => {
arch => "aarch64",
distri => "fedora",
flavor => "updates-server",
version => "*",
},
test_suite => { name => "advisory_boot" },
},
], ],
Products => [ Products => [
{ {
@ -891,4 +939,15 @@
version => "*", version => "*",
}, },
], ],
TestSuites => [
{
name => "advisory_boot",
settings => [
{ key => "USER_LOGIN", value => "false" },
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "BOOTFROM", value => "c" },
{ key => "ADVISORY_BOOT_TEST", value => "1" },
],
},
],
} }

View File

@ -9,6 +9,16 @@ sub run {
# update packages and run 'dnf update' # update packages and run 'dnf update'
$self->root_console(tty=>3); $self->root_console(tty=>3);
repo_setup; repo_setup;
if (get_var("ADVISORY_BOOT_TEST")) {
# to test boot stuff - in case the update touched grub2, or dracut,
# or anything adjacent - let's force-regenerate the initramfs and
# the bootloader config, and reinstall the bootloader on BIOS. This
# is kinda arch-dependent, but works for the three arches currently
# in openQA: x86_64, ppc64le, and aarch64.
assert_script_run "dracut -f";
assert_script_run 'grub2-mkconfig -o $(readlink -m /etc/grub2.cfg)';
assert_script_run "grub2-install /dev/vda" unless (get_var("UEFI"));
}
# reboot, in case any of the updates need a reboot to apply # reboot, in case any of the updates need a reboot to apply
script_run "reboot", 0; script_run "reboot", 0;
} }