1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-08-25 16:45:44 +00:00

Move function.

This commit is contained in:
Lukas Ruzicka 2022-10-07 11:45:45 +02:00
parent 7b125f58f8
commit 570b6991db
2 changed files with 33 additions and 34 deletions

View File

@ -361,38 +361,6 @@ 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");
# Add some sleeps to make the output video more viewable
sleep(3);
# 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");
sleep(3);
}
# 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");
sleep(3);
}
#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.

View File

@ -11,13 +11,44 @@ use POSIX qw(strftime);
use JSON;
use REST::Client;
our @EXPORT = qw(convert_to_bz_timestamp get_newest_bug check_bug_status_field close_notabug);
our @EXPORT = qw(convert_to_bz_timestamp get_newest_bug check_bug_status_field close_notabug bugzilla_setup);
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");
# Add some sleeps to make the output video more viewable
sleep(3);
# 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");
sleep(3);
}
# 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");
sleep(3);
}
#Switch back to the installation console
send_key("alt-f1");
assert_screen("anaconda_text_install_shell");
}
sub start_bugzilla_client {
# Start a Bugzilla REST client for setting up communication.
# This is a local subroutine, not intended for export.
my $host = shift;
my $bugzilla = REST::Client->new();
$bugzilla->setHost("https://bugzilla.redhat.com");
$bugzilla->setHost($host);
return $bugzilla;
}