diff --git a/lib/anaconda.pm b/lib/anaconda.pm index a75c5b51..5d326eb5 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 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"; diff --git a/lib/bugzilla.pm b/lib/bugzilla.pm index 7b433abf..f2b9e9b2 100644 --- a/lib/bugzilla.pm +++ b/lib/bugzilla.pm @@ -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.