1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-02-16 12:34:32 +00:00

Comment out useless code and rename variables.

This commit is contained in:
Lukáš Růžička 2022-10-11 15:18:23 +02:00
parent 86a63a5cbe
commit 73c4b708ec
2 changed files with 33 additions and 37 deletions

View File

@ -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 bugzilla_setup/;
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 get_bug_number/;
sub select_disks {
# Handles disk selection. Has one optional argument - number of
@ -390,6 +390,14 @@ sub crash_anaconda_text {
}
sub get_bug_number {
# This routine collects the bug number from Anaconda logs
# so that it could be used to close the bug afterwards
# in order not to keep attracting attention to test bugs
# that are not useful for Anaconda team.
}
sub report_bug_text {
# This routine handles the Bugzilla reporting after a simulated crash on
# a textual console.
@ -401,23 +409,11 @@ sub report_bug_text {
# limit the Bugzilla search.
my $timestamp = time();
#
# First, collect the credentials.
my $login = get_var("BUGZILLA_LOGIN");
my $password = get_var("_SECRET_BUGZILLA_PASSWORD");
my $apikey = get_var("_SECRET_BUGZILLA_APIKEY");
# Choose item 1 - Report the bug.
type_string "1\n";
sleep 2;
# Choose item 1 - Report to Bugzilla
type_string "1\n";
sleep 5;
# Do login.
type_string $login;
type_string "\n";
sleep 5;
# Enter the name of the Zilla.
type_password $password;
type_string "\n";
sleep 10;
# Save the report without changing it.
# It would need some more tweaking to actually type into the report, but since
@ -441,29 +437,29 @@ sub report_bug_text {
record_soft_failure "Warning: Bugzilla has reported an error which could mean that the bug has not been created correctly, but it probably is not a real problem, if the test has not failed completely. ";
}
# Now, let us check with Bugzilla directly, if the bug has been created.
# First, we shall get a Bugzilla format timestamp to use it in the query.
# The timestamp will limit the list of bugs to those that have been created since
# the then -> resulting with high probability in the one that this test run
# has just created.
$timestamp = convert_to_bz_timestamp($timestamp);
# Then we fetch the latest bug from Bugzilla.
my $lastbug = get_newest_bug($timestamp, $login);
unless ($lastbug) {
die "Bugzilla returned no newly created bug. It seems that the bug has not been created.";
}
else {
print("BUGZILLA: The last bug was found: $lastbug\n");
}
# We have found that the bug indeed is in the bugzilla (otherwise
# we would have died already) so now we close it to clean up after this test run.
my $result = close_notabug($lastbug, $apikey);
unless ($result) {
record_soft_failure "The bug has not been closed for some reason. Check manually.";
}
else {
print("BUGZILLA: The last bug $lastbug changed status to CLOSED.\n");
}
## Now, let us check with Bugzilla directly, if the bug has been created.
## First, we shall get a Bugzilla format timestamp to use it in the query.
## The timestamp will limit the list of bugs to those that have been created since
## the then -> resulting with high probability in the one that this test run
## has just created.
#$timestamp = convert_to_bz_timestamp($timestamp);
## Then we fetch the latest bug from Bugzilla.
#my $lastbug = get_newest_bug($timestamp, $login);
#unless ($lastbug) {
# die "Bugzilla returned no newly created bug. It seems that the bug has not been created.";
#}
#else {
# print("BUGZILLA: The last bug was found: $lastbug\n");
#}
## We have found that the bug indeed is in the bugzilla (otherwise
## we would have died already) so now we close it to clean up after this test run.
#my $result = close_notabug($lastbug, $apikey);
#unless ($result) {
# record_soft_failure "The bug has not been closed for some reason. Check manually.";
#}
#else {
# print("BUGZILLA: The last bug $lastbug changed status to CLOSED.\n");
#}
# Quit anaconda
type_string "4\n";

View File

@ -24,7 +24,7 @@ sub bugzilla_setup {
# 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;
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.