diff --git a/lib/anaconda.pm b/lib/anaconda.pm index 820c97a3..c58da74a 100644 --- a/lib/anaconda.pm +++ b/lib/anaconda.pm @@ -9,7 +9,7 @@ use testapi; use utils; use bugzilla; -our @EXPORT = qw/select_disks custom_scheme_select custom_blivet_add_partition custom_blivet_format_partition custom_blivet_resize_partition custom_change_type custom_change_fs custom_change_device custom_delete_part get_full_repo check_help_on_pane get_mirrorlist_url crash_anaconda_text report_bug_text/; +our @EXPORT = qw/select_disks custom_scheme_select custom_blivet_add_partition custom_blivet_format_partition custom_blivet_resize_partition custom_change_type custom_change_fs custom_change_device custom_delete_part get_full_repo check_help_on_pane get_mirrorlist_url crash_anaconda_text report_bug_text bugzilla_setup/; sub select_disks { # Handles disk selection. Has one optional argument - number of @@ -361,6 +361,34 @@ sub check_help_on_pane { } } + + +sub bugzilla_setup { + # This routines makes necessary settings to enable Bugzilla (staging/production) + # reporting from Anaconda easily, without the need to type the Bugzilla API. + # Switch to shell + send_key("alt-f3"); + assert_screen("anaconda_text_install_shell"); + # Navigate to the libreport configuration directory + type_string("cd /etc/libreport/events/\n"); + # Change values in the report_Bugzilla.conf file + my $apikey = get_var("_SECRET_BUGZILLA_APIKEY") // undef; + # If we want to report to Bugzilla Staging, then we will + # change the configuration file. Normally, it is set + # to report to the production Bugzilla. + my $bugzilla = get_var("BUGZILLA_INSTANCE") // "staging"; + if ($bugzilla eq "staging") { + enter_cmd("sed -i 's/bugzilla.redhat.com/bugzilla.stage.redhat.com/g' report_Bugzilla.conf"); + } + # If API key is defined, update the configuration file with the API key + if ($apikey) { + enter_cmd("sed -i s/Bugzilla_APIKey =/Bugzilla_APIKey = $apikey/g report_Bugzilla.conf"); + } + #Switch back to the installation console + send_key("alt-f1"); + assert_screen("anaconda_text_install_shell"); +} + sub crash_anaconda_text { # This routine uses the Anaconda crash trigger to break the ongoing Anaconda installation to simulate # an Anaconda crash and runs a series of steps that results in creating a bug in Bugzilla. diff --git a/templates.fif.json b/templates.fif.json index 689aa507..f5e524a1 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -1229,7 +1229,7 @@ "profiles": { "fedora-seasonal-aarch64-*-aarch64": 20, "fedora-seasonal-ppc64le-*-ppc64le": 20, - "fedora-seasonal-x86_64-*-64bit": 20 + "fedora-universal-x86_64-*-64bit": 20 }, "settings": { "ANACONDA_TEXT": "1", diff --git a/tests/install_text.pm b/tests/install_text.pm index c1d297f5..f5afb298 100644 --- a/tests/install_text.pm +++ b/tests/install_text.pm @@ -37,6 +37,10 @@ sub run { wait_still_screen 5; } + if (get_var("CRASH_REPORT") == 1) { + bugzilla_setup(); + } + # prepare for different number of spokes (e. g. as in Atomic DVD) my %spoke_number = ( "language" => 1,