diff --git a/README.md b/README.md index 201ccde8..ab86588b 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,9 @@ or in upgrade tests). It uploads `/var/log` in `post_fail_hook()`. It provides t and then calls `console_login()` for root. If you set `check` argument, it dies if it fails to log in. Example usage: running `$self->root_console(tty=>2, check=>0);` results in TTY2 displayed with root logged in. + - `check_release()` checks whether the installed release matches a given value. E.g. `check_release(23)` + checks whether the installed system is Fedora 23. The value can be 'Rawhide' or a Fedora release number; + often you will want to use `get_var('VERSION')`. Expects a console prompt to be active when it is called. ### New test development workflow diff --git a/lib/installedtest.pm b/lib/installedtest.pm index eb7b1842..0740e637 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -35,6 +35,15 @@ sub post_fail_hook { upload_logs "/tmp/var_log.tar.gz"; } +sub check_release { + my $self = shift; + my $release = shift; + type_string "clear\n"; + type_string "grep SUPPORT_PRODUCT_VERSION /usr/lib/os.release.d/os-release-fedora | grep -q ${release}\n"; + type_string "echo \$?\n"; + assert_screen "console_command_success"; +} + 1; # vim: set sw=4 et: diff --git a/main.pm b/main.pm index 612ed021..2b379bb1 100644 --- a/main.pm +++ b/main.pm @@ -57,9 +57,9 @@ if (get_var("ENTRYPOINT")) } elsif (get_var("UPGRADE")) { - # all upgrade tests consist of: preinstall phase (where packages are upgraded and fedup is - # installed), run phase (where fedup is run) and postinstall phase (where is checked if - # fedora was upgraded successfully) + # all upgrade tests consist of: preinstall phase (where packages are upgraded and + # dnf-plugin-system-upgrade is installed), run phase (where upgrade is run) and postinstall + # phase (where is checked if fedora was upgraded successfully) autotest::loadtest get_var('CASEDIR')."/tests/upgrade_preinstall.pm"; autotest::loadtest get_var('CASEDIR')."/tests/upgrade_run.pm"; # UPGRADE can be set to "minimal", "encrypted", "desktop"... diff --git a/needles/console_f22_installed.json b/needles/console_f22_installed.json deleted file mode 100644 index c42b9ba5..00000000 --- a/needles/console_f22_installed.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "properties": [], - "area": [ - { - "xpos": 0, - "ypos": 129, - "width": 238, - "height": 12, - "type": "match" - } - ], - "tags": [ - "console_f22_installed", - "ENV-DISTRI-fedora", - "ENV-INSTLANG-en_US", - "ENV-FLAVOR-develop" - ] -} \ No newline at end of file diff --git a/needles/console_f22_installed.png b/needles/console_f22_installed.png deleted file mode 100644 index 2442ad01..00000000 Binary files a/needles/console_f22_installed.png and /dev/null differ diff --git a/needles/graphical_login_gdm_input.json b/needles/graphical_login_gdm_input.json index becff622..67d95dbe 100644 --- a/needles/graphical_login_gdm_input.json +++ b/needles/graphical_login_gdm_input.json @@ -1,25 +1,18 @@ -{ - "area": [ - { - "xpos": 341, - "ypos": 372, - "width": 343, - "height": 65, - "type": "match" - }, - { - "xpos": 600, - "ypos": 470, - "width": 80, - "height": 30, - "type": "match" - } - ], - "tags": [ - "graphical_login_input", - "ENV-DISTRI-fedora", - "ENV-INSTLANG-en_US", - "ENV-FLAVOR-develop" - ], - "properties": [] -} +{ + "area": [ + { + "height": 65, + "type": "match", + "width": 343, + "xpos": 341, + "ypos": 372 + } + ], + "properties": [], + "tags": [ + "graphical_login_input", + "ENV-DISTRI-fedora", + "ENV-INSTLANG-en_US", + "ENV-FLAVOR-develop" + ] +} \ No newline at end of file diff --git a/needles/grub_fedup.json b/needles/grub_fedup.json deleted file mode 100644 index ba85f34a..00000000 --- a/needles/grub_fedup.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "properties": [], - "area": [ - { - "xpos": 119, - "ypos": 51, - "width": 61, - "height": 10, - "type": "match" - } - ], - "tags": [ - "grub_fedup", - "ENV-DISTRI-fedora", - "ENV-INSTLANG-en_US", - "ENV-FLAVOR-server" - ] -} \ No newline at end of file diff --git a/needles/grub_fedup.png b/needles/grub_fedup.png deleted file mode 100644 index e5d87a2a..00000000 Binary files a/needles/grub_fedup.png and /dev/null differ diff --git a/templates b/templates index f7d9dbc9..38743629 100755 --- a/templates +++ b/templates @@ -224,7 +224,7 @@ flavor => "universal", version => "*", }, - test_suite => { name => "fedup_minimal_64bit" }, + test_suite => { name => "upgrade_minimal_64bit" }, }, { machine => { name => "64bit" }, @@ -234,7 +234,7 @@ flavor => "universal", version => "*", }, - test_suite => { name => "fedup_desktop_64bit" }, + test_suite => { name => "upgrade_desktop_64bit" }, }, { machine => { name => "64bit" }, @@ -484,7 +484,7 @@ flavor => "universal", version => "*", }, - test_suite => { name => "fedup_minimal_32bit" }, + test_suite => { name => "upgrade_minimal_32bit" }, }, { machine => { name => "32bit" }, @@ -494,7 +494,7 @@ flavor => "universal", version => "*", }, - test_suite => { name => "fedup_desktop_32bit" }, + test_suite => { name => "upgrade_desktop_32bit" }, }, { machine => { name => "32bit" }, @@ -801,7 +801,7 @@ variables => "", }, { - name => "fedup_minimal_64bit", + name => "upgrade_minimal_64bit", prio => 19, settings => [ { key => "ROOT_PASSWORD", value => "weakpassword" }, @@ -812,7 +812,7 @@ variables => "", }, { - name => "fedup_desktop_64bit", + name => "upgrade_desktop_64bit", prio => 20, settings => [ { key => "ROOT_PASSWORD", value => "weakpassword" }, @@ -823,7 +823,7 @@ variables => "", }, { - name => "fedup_minimal_32bit", + name => "upgrade_minimal_32bit", prio => 19, settings => [ { key => "ROOT_PASSWORD", value => "weakpassword" }, @@ -834,7 +834,7 @@ variables => "", }, { - name => "fedup_desktop_32bit", + name => "upgrade_desktop_32bit", prio => 20, settings => [ { key => "ROOT_PASSWORD", value => "weakpassword" }, diff --git a/tests/upgrade_postinstall_desktop.pm b/tests/upgrade_postinstall_desktop.pm index 26e0d5d1..0cf6d737 100644 --- a/tests/upgrade_postinstall_desktop.pm +++ b/tests/upgrade_postinstall_desktop.pm @@ -17,6 +17,9 @@ sub run { send_key "ret"; # wait until desktop appears assert_screen "graphical_desktop_clean", 30; + # check an upgrade actually happened (and we can log into a console) + $self->root_console(tty=>3); + $self->check_release(get_var('VERSION')); } diff --git a/tests/upgrade_postinstall_minimal.pm b/tests/upgrade_postinstall_minimal.pm index abbf0a68..9f59761e 100644 --- a/tests/upgrade_postinstall_minimal.pm +++ b/tests/upgrade_postinstall_minimal.pm @@ -6,11 +6,10 @@ use testapi; sub run { my $self = shift; - # try to login, check whether F22 is installed + # try to login, check whether target release is installed $self->boot_to_login_screen(); $self->root_console(tty=>3); - - assert_screen "console_f22_installed"; + $self->check_release(get_var('VERSION')); } diff --git a/tests/upgrade_preinstall.pm b/tests/upgrade_preinstall.pm index 162d9633..c93ace9a 100644 --- a/tests/upgrade_preinstall.pm +++ b/tests/upgrade_preinstall.pm @@ -14,9 +14,9 @@ sub run { # switch to TTY3 for both, graphical and console tests $self->root_console(tty=>3); - # fedup should be installed on up-to-date system + # upgrader should be installed on up-to-date system - type_string 'yum -y update; echo $?'; + type_string 'dnf -y update; echo $?'; send_key "ret"; assert_screen "console_command_success", 1800; @@ -31,7 +31,7 @@ sub run { } $self->root_console(tty=>3); - type_string 'yum -y install fedup; echo $?'; + type_string 'dnf -y --enablerepo=updates-testing install dnf-plugin-system-upgrade; echo $?'; send_key "ret"; assert_screen "console_command_success", 1800; diff --git a/tests/upgrade_run.pm b/tests/upgrade_run.pm index fb3c6e1a..3d2e28c0 100644 --- a/tests/upgrade_run.pm +++ b/tests/upgrade_run.pm @@ -3,32 +3,24 @@ use strict; use testapi; sub run { - my $fedup_url; - my $to_version; - # FIXME: this is just a workaround, see https://phab.qadevel.cloud.fedoraproject.org/T478 - # construct download URL - if (get_var("BUILD") =~ /^(\d+)_Final_(.*)$/) { - $fedup_url = "https://dl.fedoraproject.org/pub/alt/stage/".$1."_".$2."/Server/".get_var("ARCH")."/os"; - $to_version = $1; - } else { - $fedup_url = "https://dl.fedoraproject.org/pub/alt/stage/".get_var("BUILD")."/Server/".get_var("ARCH")."/os"; - get_var("BUILD") =~ /^(\d+)/; - $to_version = $1; + my $release = lc(get_var('VERSION')); + my $milestone = lc((split /_/, get_var("BUILD"))[1]); + my $args = "--releasever=${release}"; + # This is excessive - after the Bodhi activation point we don't + # need --nogpgcheck for Branched. But that's hard to detect magically + if ($release eq 'rawhide' or $milestone eq 'branched') { + $args .= " --nogpgcheck"; } - - type_string "fedup --network ".$to_version." --instrepo ".$fedup_url; + type_string "dnf -y system-upgrade download ${args}"; send_key "ret"; - # wait untill fedup finishes its work (screen stops moving for 30 seconds) + # wait until dnf finishes its work (screen stops moving for 30 seconds) wait_still_screen 30, 6000; # TODO: shorter timeout, longer stillscreen? - upload_logs "/var/log/fedup.log"; + upload_logs "/var/log/dnf.log"; + upload_logs "/var/log/dnf.rpm.log"; - type_string "reboot"; - send_key "ret"; - - # check that "upgrade" item is shown in GRUB - assert_screen "grub_fedup", 30; + type_string "dnf system-upgrade reboot"; send_key "ret"; # now offline upgrading starts. user doesn't have to do anything, just wait untill