diff --git a/VARIABLES.md b/VARIABLES.md index 8ce54873..49f30429 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -69,6 +69,7 @@ it also means that `B` conflicts `A` even if not shown in the table). | `USER_LOGIN` | string | not set | should be used with `USER_PASSWORD` | when set, user login is set to this value | | `USER_PASSWORD` | string | not set | should be used with `USER_LOGIN` | when set, user password is set to this value | | `BOOT_UPDATES_IMG_URL` | boolean | `false`/not set | set to indicate that path to updates.img was appended to kernel line | +| `UEFI` | boolean | `false`/not set | nothing | whether to use UEFI, this variable isn't usually set in test suites but in machine definition | Run variables ------------- diff --git a/main.pm b/main.pm index 3bad6325..df15e6cc 100644 --- a/main.pm +++ b/main.pm @@ -161,6 +161,10 @@ else $storagepost = $loc if (-e $loc); } autotest::loadtest $storagepost if ($storagepost); + + if (get_var("UEFI")) { + autotest::loadtest get_var('CASEDIR')."/tests/uefi_postinstall.pm"; + } } diff --git a/needles/bootloader_uefi.json b/needles/bootloader_uefi.json new file mode 100644 index 00000000..359e4115 --- /dev/null +++ b/needles/bootloader_uefi.json @@ -0,0 +1,21 @@ +{ + "tags": [ + "ENV-DESKTOP-gnome", + "ENV-DISTRI-fedora", + "ENV-FLAVOR-server_boot", + "ENV-FLAVOR-workstation_live", + "ENV-LANGUAGE-ALL", + "ENV-UEFI-1", + "bootloader_uefi" + ], + "area": [ + { + "width": 140, + "height": 14, + "xpos": 126, + "type": "match", + "ypos": 140 + } + ], + "properties": [] +} diff --git a/needles/bootloader_uefi.png b/needles/bootloader_uefi.png new file mode 100644 index 00000000..e0e61b3a Binary files /dev/null and b/needles/bootloader_uefi.png differ diff --git a/templates b/templates index 3513b10b..91a95678 100755 --- a/templates +++ b/templates @@ -16,6 +16,16 @@ }, test_suite => { name => "default_install" }, }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "workstation_live", + version => "*", + }, + test_suite => { name => "default_install" }, + }, { machine => { name => "64bit" }, product => { @@ -26,6 +36,16 @@ }, test_suite => { name => "default_install" }, }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "server_boot", + version => "*", + }, + test_suite => { name => "default_install" }, + }, { machine => { name => "64bit" }, product => { @@ -36,6 +56,16 @@ }, test_suite => { name => "default_install" }, }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "generic_boot", + version => "*", + }, + test_suite => { name => "default_install" }, + }, { machine => { name => "64bit" }, product => { @@ -96,6 +126,16 @@ }, test_suite => { name => "server_delete_pata" }, }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_delete_pata" }, + }, { machine => { name => "64bit" }, product => { @@ -126,6 +166,16 @@ }, test_suite => { name => "server_sata_multi" }, }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_sata_multi" }, + }, { machine => { name => "64bit" }, product => { @@ -216,6 +266,96 @@ }, test_suite => { name => "server_no_swap" }, }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_simple_encrypted" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_simple_free_space" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_multi_empty" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_software_raid" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_delete_partial" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_btrfs" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_ext3" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_lvmthin" }, + }, + { + machine => { name => "uefi" }, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "universal", + version => "*", + }, + test_suite => { name => "server_no_swap" }, + }, { machine => { name => "64bit" }, product => { @@ -570,6 +710,18 @@ ], variables => "", }, + { + backend => "qemu", + name => "uefi", + settings => [ + { key => "QEMUCPU", value => "qemu64" }, + { key => "QEMUCPUS", value => "2"}, + { key => "QEMUVGA", value => "std"}, + { key => "QEMURAM", value => "2048"}, + { key => "UEFI", value => "1"} + ], + variables => "", + }, ], Products => [ { diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index efa9b6bc..787f63fc 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -2,9 +2,25 @@ use base "anacondatest"; use strict; use testapi; +# get_kernel_line switches to menu edit screen and sets the cursor to the end of kernel line +sub get_kernel_line { + if( get_var("UEFI")){ + send_key "e"; + send_key "down"; + send_key "down"; + send_key "end"; + } else { + send_key "tab"; + } +} + sub run { # Wait for bootloader to appear - assert_screen "bootloader", 30; + if( get_var("UEFI")){ + assert_screen "bootloader_uefi", 30; + } else { + assert_screen "bootloader", 30; + } # Make sure we skip media check if it's selected by default. Standard # 'boot installer' menu entry is always first. @@ -13,7 +29,7 @@ sub run { # if variable GRUB is set, add its value into kernel line in grub if( get_var("GRUB")){ - send_key "tab"; + get_kernel_line; type_string " ".get_var("GRUB"); } @@ -21,7 +37,7 @@ sub run { # if variable REPOSITORY_VARIATION is set, construct inst.repo url and add it to kernel line if (get_var("REPOSITORY_VARIATION")){ unless (get_var("GRUB")){ - send_key "tab"; + get_kernel_line; } my $fedora_version = ""; my $repourl = ""; @@ -35,6 +51,9 @@ sub run { } # now we are on the correct "boot" menu item + # hit Ctrl+x for the case when the uefi kernel line was edited + send_key "ctrl-x"; + # Return starts boot in all other cases send_key "ret"; unless (get_var("KICKSTART")) diff --git a/tests/uefi_postinstall.pm b/tests/uefi_postinstall.pm new file mode 100644 index 00000000..e2807361 --- /dev/null +++ b/tests/uefi_postinstall.pm @@ -0,0 +1,27 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + my $self=shift; + if (not( check_screen "root_console", 0)) { + $self->root_console(tty=>3); + } + assert_screen "root_console"; + # this test shows if the system is booted with efi + type_string 'reset; [ -d /sys/firmware/efi/ ]; echo $?'; + send_key "ret"; + assert_screen "console_command_success"; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: