From 35735f21cde8d0c2420c2c6214efd6637f5f432f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 27 Jan 2016 20:48:04 -0800 Subject: [PATCH] Pungi 4 conversion: handle Pungi-derived BUILD and FLAVOR With the arrival of Pungi 4, the scheduler is no longer using fedfind-provided BUILD and FLAVOR values, but ones derived from Pungi properties. BUILD is now simply the Pungi compose_id. FLAVOR is produced by joining the Pungi variant, type, and format with '-' characters as the separators. Pungi, unfortunately, does not treat 'Rawhide' as a release, it synthesizes a release number for Rawhide composes and places that in the compose ID. To cope with that, for now, the scheduler will set RAWHIDE to '1' if the compose is a Rawhide one. As we have to adapt all places where we parse the release in any case, this commit consolidates them into a fedorabase subroutine. For the one place where we also used to parse the 'milestone' from fedfind, there is a placeholder get_milestone subroutine which currently returns an empty string, as I don't yet have a good handle on how to draw the kinds of distinctions fedfind mapped to 'milestone' from Pungi metadata. --- VARIABLES.md | 8 +-- lib/fedorabase.pm | 16 ++++++ templates | 88 +++++++++++++++---------------- tests/_boot_to_anaconda.pm | 5 +- tests/install_source_graphical.pm | 11 ++-- tests/install_source_variation.pm | 4 +- tests/upgrade_run.pm | 5 +- 7 files changed, 73 insertions(+), 64 deletions(-) diff --git a/VARIABLES.md b/VARIABLES.md index 820d6684..58b42fa2 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -78,9 +78,11 @@ These variables should be set when tests are scheduled (when running `isos post` | Variable | Explanation | | -------- | ----------- | -| `ISO` | contains filename of ISO that is used for booting | +| `ISO` | contains filename of ISO that is used for booting, if ISO is already downloaded | +| `ISOURL` | contains URL for ISO to boot, openQA will download it. Set this or `ISO`, not both | | `DISTRI` | contains distribution name (should be same as in WebUI, probably `fedora`) | | `VERSION` | contains version of distribution | -| `FLAVOR` | indicates what type of distribution is used (`universal`, `generic_boot`, `workstation_live`, `server_boot`) | +| `FLAVOR` | indicates what type of distribution is used. Three Pungi properties, joined with `-`: `variant`, `type`, and `format`. e.g.: `Server-dvd-iso`. Special value `universal` is used to schedule the group of tests that should be run once each per arch per compose, against the 'best' available ISO | | `ARCH` | is set to architecture that will be used (`x86_64`, `i686`) | -| `BUILD` | contains string `vv_tt_bb`, where `vv` is fedora version number, `tt` is release name (`Beta`, `Final`, ...) and `bb` is build (`RC3`, ...) | +| `BUILD` | contains Pungi compose_id (something like `Fedora-24-20160121.n.3`) | +| `RAWHIDE` | set to 1 if this is a Rawhide compose (this is kind of a hack, see https://pagure.io/pungi/issue/134 ) | diff --git a/lib/fedorabase.pm b/lib/fedorabase.pm index 352a5cd2..f460536d 100644 --- a/lib/fedorabase.pm +++ b/lib/fedorabase.pm @@ -88,6 +88,22 @@ sub boot_to_login_screen { } } +sub get_release { + my $self = shift; + if (get_var("RAWHIDE")) { + return 'rawhide'; + } + else { + return lc((split /-/, get_var("BUILD"))[1]); + } +} + +sub get_milestone { + my $self = shift; + # FIXME: we don't know how to do this with Pungi 4 yet. + return ''; +} + 1; # vim: set sw=4 et: diff --git a/templates b/templates index 6dee55bd..bcd2d5f3 100755 --- a/templates +++ b/templates @@ -12,7 +12,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -23,7 +23,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -34,7 +34,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_boot", + flavor => "Server-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -45,7 +45,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_boot", + flavor => "Server-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -56,7 +56,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -67,7 +67,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -78,7 +78,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -89,7 +89,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -100,7 +100,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_boot", + flavor => "Workstation-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -111,7 +111,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_boot", + flavor => "Workstation-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -122,7 +122,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -133,7 +133,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -144,7 +144,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "cloud_atomic_canned", + flavor => "Cloud_Atomic-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -155,7 +155,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", version => "*", }, test_suite => { name => "base_selinux" }, @@ -166,7 +166,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", version => "*", }, test_suite => { name => "base_selinux" }, @@ -177,7 +177,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", version => "*", }, test_suite => { name => "base_selinux" }, @@ -188,7 +188,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", version => "*", }, test_suite => { name => "base_selinux" }, @@ -199,7 +199,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", version => "*", }, test_suite => { name => "base_services_start" }, @@ -210,7 +210,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", version => "*", }, test_suite => { name => "base_services_start" }, @@ -221,7 +221,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", version => "*", }, test_suite => { name => "base_services_start" }, @@ -232,7 +232,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", version => "*", }, test_suite => { name => "base_services_start" }, @@ -243,7 +243,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", version => "*", }, test_suite => { name => "base_service_manipulation" }, @@ -254,7 +254,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", version => "*", }, test_suite => { name => "base_service_manipulation" }, @@ -265,7 +265,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", version => "*", }, test_suite => { name => "base_service_manipulation" }, @@ -276,7 +276,7 @@ product => { arch => "x86_64", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", version => "*", }, test_suite => { name => "base_service_manipulation" }, @@ -727,7 +727,7 @@ product => { arch => "i386", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -738,7 +738,7 @@ product => { arch => "i386", distri => "fedora", - flavor => "server_boot", + flavor => "Server-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -749,7 +749,7 @@ product => { arch => "i386", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -760,7 +760,7 @@ product => { arch => "i386", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -771,7 +771,7 @@ product => { arch => "i386", distri => "fedora", - flavor => "workstation_boot", + flavor => "Workstation-boot-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -782,7 +782,7 @@ product => { arch => "i386", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", version => "*", }, test_suite => { name => "default_install" }, @@ -947,7 +947,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", name => "", settings => [ ], @@ -956,7 +956,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "server_boot", + flavor => "Server-boot-iso", name => "", settings => [ ], @@ -965,7 +965,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", name => "", settings => [ ], @@ -974,7 +974,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "cloud_atomic_canned", + flavor => "Cloud_Atomic-boot-iso", name => "", settings => [ { key => "CANNED", value => "1" } @@ -984,7 +984,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "workstation_boot", + flavor => "Workstation-boot-iso", name => "", settings => [ { key => "DESKTOP", value => "gnome" } @@ -994,7 +994,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", name => "", settings => [ { key => "LIVE", value => "1" }, @@ -1005,7 +1005,7 @@ { arch => "x86_64", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", name => "", settings => [ { key => "LIVE", value => "1" }, @@ -1025,7 +1025,7 @@ { arch => "i386", distri => "fedora", - flavor => "generic_boot", + flavor => "Everything-boot-iso", name => "", settings => [ ], @@ -1034,7 +1034,7 @@ { arch => "i386", distri => "fedora", - flavor => "server_boot", + flavor => "Server-boot-iso", name => "", settings => [ ], @@ -1043,7 +1043,7 @@ { arch => "i386", distri => "fedora", - flavor => "server_dvd", + flavor => "Server-dvd-iso", name => "", settings => [ ], @@ -1052,7 +1052,7 @@ { arch => "i386", distri => "fedora", - flavor => "workstation_boot", + flavor => "Workstation-boot-iso", name => "", settings => [ { key => "DESKTOP", value => "gnome" } @@ -1062,7 +1062,7 @@ { arch => "i386", distri => "fedora", - flavor => "workstation_live", + flavor => "Workstation-live-iso", name => "", settings => [ { key => "LIVE", value => "1" }, @@ -1073,7 +1073,7 @@ { arch => "i386", distri => "fedora", - flavor => "kde_live", + flavor => "KDE-live-iso", name => "", settings => [ { key => "LIVE", value => "1" }, diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 787f63fc..9651a8df 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -39,14 +39,11 @@ sub run { unless (get_var("GRUB")){ get_kernel_line; } - my $fedora_version = ""; my $repourl = ""; - $fedora_version = lc((split /_/, get_var("BUILD"))[0]); - # REPOSITORY_VARIATION should be set to repository URL without version and architecture # appended (it will be appended automatically) - $repourl = get_var("REPOSITORY_VARIATION")."/".$fedora_version."/".get_var("ARCH")."/os"; + $repourl = get_var("REPOSITORY_VARIATION")."/".$self->get_release."/".get_var("ARCH")."/os"; type_string " inst.repo=".$repourl; } diff --git a/tests/install_source_graphical.pm b/tests/install_source_graphical.pm index 386e3d38..711c33ae 100644 --- a/tests/install_source_graphical.pm +++ b/tests/install_source_graphical.pm @@ -21,25 +21,20 @@ sub run { # insert the url send_key "tab"; - my $fedora_version = lc((split /_/, get_var("BUILD"))[0]); my $repourl = ""; - if ($fedora_version ne "rawhide"){ - if (get_var("MIRRORLIST_GRAPHICAL")){ - $fedora_version = "fedora-".$fedora_version; - } - } + my $fedora_release = $self->get_release; # if either MIRRORLIST_GRAPHICAL or REPOSITORY_GRAPHICAL is set, type this into # the repository url input if (get_var("MIRRORLIST_GRAPHICAL")){ - $repourl = "mirrors.fedoraproject.org/mirrorlist?repo=".$fedora_version."&arch=".get_var('ARCH'); + $repourl = "mirrors.fedoraproject.org/mirrorlist?repo=".$fedora_release."&arch=".get_var('ARCH'); type_string $repourl; # select as mirror list assert_and_click "anaconda_install_source_repo_select_mirrorlist"; } elsif (get_var("REPOSITORY_GRAPHICAL")){ - $repourl = get_var("REPOSITORY_GRAPHICAL")."/".$fedora_version."/".get_var("ARCH")."/os"; + $repourl = get_var("REPOSITORY_GRAPHICAL")."/".$fedora_release."/".get_var("ARCH")."/os"; type_string $repourl; } diff --git a/tests/install_source_variation.pm b/tests/install_source_variation.pm index 3a25f6e9..4c8092fc 100644 --- a/tests/install_source_variation.pm +++ b/tests/install_source_variation.pm @@ -8,11 +8,9 @@ sub run { # Anaconda hub assert_screen "anaconda_main_hub"; - # FIXME: this code is scattered in at least three places (here, _boot_to_anaconda, _install_source_graphical. Deduplicate - my $fedora_version = lc((split /_/, get_var("BUILD"))[0]); my $repourl = ""; - $repourl = get_var("REPOSITORY_VARIATION")."/".$fedora_version."/".get_var("ARCH")."/os"; + $repourl = get_var("REPOSITORY_VARIATION")."/".$self->get_release."/".get_var("ARCH")."/os"; # check that the repo was used $self->root_console; diff --git a/tests/upgrade_run.pm b/tests/upgrade_run.pm index d1514779..e9738acf 100644 --- a/tests/upgrade_run.pm +++ b/tests/upgrade_run.pm @@ -3,8 +3,9 @@ use strict; use testapi; sub run { - my $release = lc(get_var('VERSION')); - my $milestone = lc((split /_/, get_var("BUILD"))[1]); + my $release = $self->get_release; + # NOTE: this doesn't actually work yet, it's a FIXME in fedorabase + my $milestone = $self->get_milestone; 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