From 0bf76db7d59de934f32f7fec12796019fcca881f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 4 Oct 2018 15:19:43 -0700 Subject: [PATCH] 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 --- templates-updates | 59 +++++++++++++++++++++++++++++++++++++++ tests/_advisory_update.pm | 10 +++++++ 2 files changed, 69 insertions(+) diff --git a/templates-updates b/templates-updates index 621a295e..efb52e28 100755 --- a/templates-updates +++ b/templates-updates @@ -354,6 +354,30 @@ }, 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", machine => { name => "ppc64le" }, @@ -642,6 +666,18 @@ }, 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", machine => { name => "aarch64" }, @@ -786,6 +822,18 @@ }, 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 => [ { @@ -891,4 +939,15 @@ 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" }, + ], + }, + ], } diff --git a/tests/_advisory_update.pm b/tests/_advisory_update.pm index af2787fa..e2228af1 100644 --- a/tests/_advisory_update.pm +++ b/tests/_advisory_update.pm @@ -9,6 +9,16 @@ sub run { # update packages and run 'dnf update' $self->root_console(tty=>3); 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 script_run "reboot", 0; }