diff --git a/backport-Don-t-build-rhel-bugzilla-without-bugzilla.patch b/backport-Don-t-build-rhel-bugzilla-without-bugzilla.patch new file mode 100644 index 0000000000000000000000000000000000000000..d7a6a6a095fc1f08c167582f7dd1131a87fc4f1a --- /dev/null +++ b/backport-Don-t-build-rhel-bugzilla-without-bugzilla.patch @@ -0,0 +1,31 @@ +From d6ea77d651c47724629a484ea53b7a6ee197ea15 Mon Sep 17 00:00:00 2001 +From: Michal Fabik +Date: Mon, 29 Aug 2022 18:20:15 +0200 +Subject: [PATCH] Don't build rhel-bugzilla --without-bugzilla + +The --without-bugzilla ./configure option should disable building of the +libreport-rhel-bugzilla subpackage. +--- + libreport.spec | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index 2a0e2b3f..675d93a7 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -14,6 +14,7 @@ MAN5_BUGZILLA = \ + bugzilla_format_kernel.conf.txt \ + bugzilla_format_analyzer_libreport.conf.txt \ + bugzilla_formatdup_analyzer_libreport.conf.txt \ ++ report_rhel_bugzilla.conf.txt \ + report_Bugzilla.conf.txt + + # silent rules for ASCIIDOC and XMLTO +@@ -54,7 +55,6 @@ MAN5_TXT = \ + report_fedora.conf.txt \ + report_centos.conf.txt \ + report_Logger.conf.txt \ +- report_rhel_bugzilla.conf.txt \ + report_uReport.conf.txt \ + report_logger.conf.txt \ + report_mailx.conf.txt \ diff --git a/backport-Fix-build-without-bugzilla.patch b/backport-Fix-build-without-bugzilla.patch new file mode 100644 index 0000000000000000000000000000000000000000..2196b321acd6e0c9f860ad6bc9be2ddead931780 --- /dev/null +++ b/backport-Fix-build-without-bugzilla.patch @@ -0,0 +1,655 @@ +From 4b25e48c6a075816d99b67dbbf63daef30cb3252 Mon Sep 17 00:00:00 2001 +From: Michal Fabik +Date: Mon, 29 Aug 2022 09:58:43 +0200 +Subject: [PATCH] Fix build --without-bugzilla + +Disable the tests for the libreport-plugin-bugzilla subpackage when +the build is configured with --without-bugzilla, move BZ API tests to a +common file with other BZ tests and fix conditional build of documentation. +--- + tests/Makefile.am | 3 +- + tests/bugzilla_plugin.at.in | 298 ++++++++++++++++++++++++++++++++ + tests/rhbz_functions.at | 304 --------------------------------- + tests/testsuite.at | 1 - + 4 files changed, 299 insertions(+), 307 deletions(-) + delete mode 100644 tests/rhbz_functions.at + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 2acc18431..daa0b6aa4 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -83,8 +83,7 @@ TESTSUITE_AT = \ + event_config.at \ + proc_helpers.at \ + forbidden_words.at \ +- client.at \ +- rhbz_functions.at ++ client.at + + TESTSUITE_AT_IN = + +diff --git a/tests/bugzilla_plugin.at.in b/tests/bugzilla_plugin.at.in +index 0006ee928..22f7fe293 100644 +--- a/tests/bugzilla_plugin.at.in ++++ b/tests/bugzilla_plugin.at.in +@@ -107,3 +107,301 @@ TS_MAIN + TS_RETURN_MAIN + ]], + [test "x$BUILD_BUGZILLA" != 'xyes']) ++ ++AT_TESTFUN_COND([rhbz_functions], ++[[ ++ ++#define PACKAGE_NAME "libreport" ++#define VERSION "1.0" ++ ++#include "testsuite.h" ++#include "internal_libreport.h" ++#include "client.h" ++#include "abrt_xmlrpc.h" ++#include "rhbz.h" ++#include "proxies.c" ++#include "rhbz.c" ++#include "abrt_xmlrpc.c" ++#include ++#include ++ ++TS_MAIN ++{ ++ pid_t pid = fork(); ++ ++ if (pid == 0) ++ { ++ int ret = 0; ++ const char *argv[] = ++ { ++ "../../mock_bugzilla_server/mock_bugzilla_server.py", ++ NULL ++ }; ++ ret = execv((char *)argv[0], (char * const *)argv); ++ if (ret == -1) ++ { ++ printf("execv failed: %s\n", strerror(errno)); ++ } ++ } ++ else if (pid > 0) ++ { ++ libreport_g_verbose = 3; ++ char cwd_buf[PATH_MAX + 1]; ++ ++ static const char *dirs[] = { ++ NULL, ++ NULL, ++ }; ++ dirs[0] = getcwd(cwd_buf, sizeof(cwd_buf)); ++ ++ static int dir_flags[] = { ++ CONF_DIR_FLAG_NONE, ++ -1, ++ }; ++ ++ unlink("libreport.conf"); ++ FILE *lrf = fopen("libreport.conf", "wx"); ++ assert(lrf != NULL); ++ fprintf(lrf, "AlwaysExcludedElements = maps, var_log_messages, proc_pid_status"); ++ fclose(lrf); ++ ++ assert(libreport_load_global_configuration_from_dirs(dirs, dir_flags)); ++ ++ struct bugzilla_struct { ++ char *b_login; ++ char *b_password; ++ const char *b_bugzilla_url; ++ const char *b_bugzilla_xmlrpc; ++ char *b_product; ++ char *b_product_version; ++ const char *b_DontMatchComponents; ++ int b_ssl_verify; ++ int b_create_private; ++ GList *b_private_groups; ++ }; ++ ++ sleep(3); ++ ++ struct bugzilla_struct rhbz = { 0 }; ++ rhbz.b_bugzilla_url = "http://localhost:8080/"; ++ rhbz.b_bugzilla_xmlrpc = g_build_filename(rhbz.b_bugzilla_url, "xmlrpc.cgi", NULL); ++ rhbz.b_ssl_verify = FALSE; ++ ++ xmlrpc_env env; ++ xmlrpc_env_init(&env); ++ xmlrpc_client_setup_global_const(&env); ++ if (env.fault_occurred) ++ printf("Error in setup_global_const: %s\n", env.fault_string); ++ xmlrpc_env_clean(&env); ++ ++ struct abrt_xmlrpc *client = abrt_xmlrpc_new_client(rhbz.b_bugzilla_xmlrpc, rhbz.b_ssl_verify); ++ ++ { ++ TS_ASSERT_TRUE(rhbz_login(client, "captainnemo", "giantsquidsalad")); ++ } ++ ++ /*{ ++ xmlrpc_value *result = abrt_xmlrpc_call(client, "Product.get", "{s:(s)}", ++ "names", "Fedora"); ++ xmlrpc_value *product_list = rhbz_get_member("products", result); ++ xmlrpc_DECREF(result); ++ ++ xmlrpc_value *product = rhbz_array_item_at(product_list, 0); ++ xmlrpc_DECREF(product_list); ++ ++ g_autofree char *product_description = (char *)rhbz_bug_read_item("description", product, ++ RHBZ_READ_STR); ++ xmlrpc_DECREF(product); ++ ++ TS_ASSERT_STRING_EQ(product_description, "bog standard OS", "Checking product description"); ++ ++ }*/ ++ ++ { ++ int bug_id = -1; ++ ++ problem_data_t *problem_data = create_problem_data_for_reporting("../../sample_problems/1"); ++ bug_id = rhbz_new_bug(client, ++ problem_data, "Red Hat Enterprise Linux 8", "8.0", ++ "gdb doesn't work", ++ "It's been broken for ages", ++ rhbz.b_create_private, ++ rhbz.b_private_groups ++ ); ++ ++ TS_ASSERT_SIGNED_EQ(bug_id, 0); ++ ++ const char *bt = problem_data_get_content_or_NULL(problem_data, "backtrace"); ++ int ret = rhbz_attach_blob(client, "0", "backtrace", bt, strlen(bt), RHBZ_MINOR_UPDATE); ++ TS_ASSERT_SIGNED_EQ(ret, 0); ++ g_hash_table_destroy(problem_data); ++ } ++ ++ { ++ int bug_id = -1; ++ ++ problem_data_t *problem_data = create_problem_data_for_reporting("../../sample_problems/2"); ++ bug_id = rhbz_new_bug(client, ++ problem_data, "Red Hat Enterprise Linux 8", "8.0", ++ "gdb doesn't work", ++ "It's been broken for ages", ++ rhbz.b_create_private, ++ rhbz.b_private_groups ++ ); ++ TS_ASSERT_SIGNED_EQ(bug_id, 1); ++ g_hash_table_destroy(problem_data); ++ } ++ ++ { ++ int bug_id = -1; ++ ++ problem_data_t *problem_data = create_problem_data_for_reporting("../../sample_problems/3"); ++ bug_id = rhbz_new_bug(client, ++ problem_data, "Fedora", "33", ++ "afmw doesn't work", ++ "It's been broken for ages", ++ rhbz.b_create_private, ++ rhbz.b_private_groups ++ ); ++ TS_ASSERT_SIGNED_EQ(bug_id, 2); ++ g_hash_table_destroy(problem_data); ++ } ++ g_free((void *)rhbz.b_bugzilla_xmlrpc); ++ ++ { ++ xmlrpc_value *sub_components = rhbz_get_sub_components(client, "Red Hat Enterprise Linux 8", "unknown"); ++ char *sub_component = rhbz_get_default_sub_component("unknown", sub_components); ++ TS_ASSERT_STRING_EQ(sub_component, "torpedoes", "Picking a sub_component when no default is hardcoded"); ++ g_free(sub_component); ++ if (sub_components) ++ xmlrpc_DECREF(sub_components); ++ } ++ ++ { ++ rhbz_mail_to_cc(client, 0, "dev1@example.com", RHBZ_MINOR_UPDATE); ++ rhbz_mail_to_cc(client, 0, "dev2@example.com", RHBZ_MINOR_UPDATE); ++ xmlrpc_value *search = abrt_xmlrpc_call(client, ++ "Bug.search", ++ "{s:s,s:(ss)}", ++ "quicksearch", ++ "ALL product:\"Red Hat Enterprise Linux 8\"", ++ "include_fields", ++ "id", "cc"); ++ xmlrpc_value *bugs = rhbz_get_member("bugs", search); ++ xmlrpc_DECREF(search); ++ xmlrpc_value *bug = rhbz_array_item_at(bugs, 0); ++ xmlrpc_DECREF(bugs); ++ ++ GList *cc_list = rhbz_bug_cc(bug); ++ xmlrpc_DECREF(bug); ++ ++ TS_ASSERT_STRING_EQ(g_list_nth_data(cc_list, 0), "dev1@example.com", "Checking updated bug cc list"); ++ TS_ASSERT_STRING_EQ(g_list_nth_data(cc_list, 1), "dev2@example.com", "Checking updated bug cc list"); ++ g_list_free_full(cc_list, g_free); ++ ++ } ++ ++ { ++ rhbz_set_url(client, 1, "http://example.com/bug123", RHBZ_MINOR_UPDATE); ++ xmlrpc_value *search = abrt_xmlrpc_call(client, ++ "Bug.search", ++ "{s:s,s:(ss)}", ++ "quicksearch", ++ "ALL product:\"Red Hat Enterprise Linux 8\" url:\"http://example.com/bug123\"", ++ "include_fields", ++ "id", "url"); ++ xmlrpc_value *bugs = rhbz_get_member("bugs", search); ++ xmlrpc_DECREF(search); ++ xmlrpc_value *bug = rhbz_array_item_at(bugs, 0); ++ xmlrpc_DECREF(bugs); ++ ++ g_autofree char *updated_url = (char *)rhbz_bug_read_item("url", bug, RHBZ_READ_STR); ++ TS_ASSERT_STRING_EQ(updated_url, "http://example.com/bug123", "Checking updated bug url"); ++ xmlrpc_DECREF(bug); ++ ++ } ++ ++ { ++ xmlrpc_value *all_bugs = rhbz_search_duphash(client, ++ "Red Hat Enterprise Linux 8", ++ NULL, ++ NULL, ++ "abrt_hash:(null);"); ++ TS_ASSERT_SIGNED_EQ(rhbz_array_size(all_bugs), 2); ++ xmlrpc_DECREF(all_bugs); ++ } ++ ++ { ++ rhbz_close_as_duplicate(client, 1, 0, RHBZ_MINOR_UPDATE); ++ xmlrpc_value *search = abrt_xmlrpc_call(client, "Bug.search", ++ "{s:s,s:(ssss)}", ++ "quicksearch", ++ "ALL resolution:\"DUPLICATE\"", ++ "include_fields", "id", "status", "resolution", "dupe_of"); ++ ++ xmlrpc_value *bugs = rhbz_get_member("bugs", search); ++ xmlrpc_DECREF(search); ++ xmlrpc_value *bug = rhbz_array_item_at(bugs, 0); ++ xmlrpc_DECREF(bugs); ++ ++ char *status = (char *)rhbz_bug_read_item("status", bug, RHBZ_READ_STR); ++ char *resolution = (char *)rhbz_bug_read_item("resolution", bug, RHBZ_READ_STR); ++ int *dupe_of = (int *)rhbz_bug_read_item("dupe_of", bug, RHBZ_READ_INT); ++ xmlrpc_DECREF(bug); ++ ++ TS_ASSERT_STRING_EQ(status, "CLOSED", "Checking closed bug status"); ++ TS_ASSERT_STRING_EQ(resolution, "DUPLICATE", "Checking closed bug resolution"); ++ TS_ASSERT_SIGNED_EQ(*dupe_of, 0); ++ ++ g_free(status); ++ g_free(resolution); ++ g_free(dupe_of); ++ } ++ ++ { ++ struct bug_info *my_bug = rhbz_bug_info(client, 0); ++ ++ TS_ASSERT_STRING_EQ(my_bug->bi_product, "Red Hat Enterprise Linux 8", "bug_info.bi_product"); ++ TS_ASSERT_STRING_EQ(my_bug->bi_reporter, "captainnemo", "bug_info.bi_reporter"); ++ TS_ASSERT_STRING_EQ(my_bug->bi_status, "NEW", "bug_info.bi_status"); ++ TS_ASSERT_STRING_EQ(my_bug->bi_platform, "x86_64", "bug_info.bi_platform"); ++ free_bug_info(my_bug); ++ } ++ ++ { ++ struct bug_info *my_bug = rhbz_bug_info(client, 1); ++ struct bug_info *origin = rhbz_find_origin_bug_closed_duplicate(client, my_bug); ++ TS_ASSERT_SIGNED_EQ(origin->bi_id, 0); ++ free_bug_info(my_bug); ++ free_bug_info(origin); ++ } ++ ++ { ++ rhbz_add_comment(client, 0, "some comment", 0); ++ ++ GList *comment_list = rhbz_comments(client, 0); ++ ++ TS_ASSERT_STRING_EQ(g_list_nth_data(comment_list, 0), "some comment", "Checking add_comment"); ++ g_list_free_full(comment_list, g_free); ++ } ++ ++ { ++ rhbz_logout(client); ++ } ++ ++ { ++ xmlrpc_value *stop = abrt_xmlrpc_call(client, "Bugzilla.stop_server", "{}"); ++ xmlrpc_DECREF(stop); ++ } ++ abrt_xmlrpc_free_client(client); ++ ++ } ++ else // pid == -1 ++ { ++ printf("fork failed: %s\n", strerror(errno)); ++ return 1; ++ } ++} ++TS_RETURN_MAIN ++]], ++[test "x$BUILD_BUGZILLA" != 'xyes']) +diff --git a/tests/rhbz_functions.at b/tests/rhbz_functions.at +deleted file mode 100644 +index 3e504d07a..000000000 +--- a/tests/rhbz_functions.at ++++ /dev/null +@@ -1,304 +0,0 @@ +-# -*- Autotest -*- +- +-AT_BANNER([rhbz functions]) +- +-## -------------- ## +-## rhbz_functions ## +-## -------------- ## +- +-AT_TESTFUN([rhbz_functions], +-[[ +- +-#define PACKAGE_NAME "libreport" +-#define VERSION "1.0" +- +-#include "testsuite.h" +-#include "internal_libreport.h" +-#include "client.h" +-#include "abrt_xmlrpc.h" +-#include "rhbz.h" +-#include "proxies.c" +-#include "rhbz.c" +-#include "abrt_xmlrpc.c" +-#include +-#include +- +-TS_MAIN +-{ +- pid_t pid = fork(); +- +- if (pid == 0) +- { +- int ret = 0; +- const char *argv[] = +- { +- "../../mock_bugzilla_server/mock_bugzilla_server.py", +- NULL +- }; +- ret = execv((char *)argv[0], (char * const *)argv); +- if (ret == -1) +- { +- printf("execv failed: %s\n", strerror(errno)); +- } +- } +- else if (pid > 0) +- { +- libreport_g_verbose = 3; +- char cwd_buf[PATH_MAX + 1]; +- +- static const char *dirs[] = { +- NULL, +- NULL, +- }; +- dirs[0] = getcwd(cwd_buf, sizeof(cwd_buf)); +- +- static int dir_flags[] = { +- CONF_DIR_FLAG_NONE, +- -1, +- }; +- +- unlink("libreport.conf"); +- FILE *lrf = fopen("libreport.conf", "wx"); +- assert(lrf != NULL); +- fprintf(lrf, "AlwaysExcludedElements = maps, var_log_messages, proc_pid_status"); +- fclose(lrf); +- +- assert(libreport_load_global_configuration_from_dirs(dirs, dir_flags)); +- +- struct bugzilla_struct { +- char *b_login; +- char *b_password; +- const char *b_bugzilla_url; +- const char *b_bugzilla_xmlrpc; +- char *b_product; +- char *b_product_version; +- const char *b_DontMatchComponents; +- int b_ssl_verify; +- int b_create_private; +- GList *b_private_groups; +- }; +- +- sleep(3); +- +- struct bugzilla_struct rhbz = { 0 }; +- rhbz.b_bugzilla_url = "http://localhost:8080/"; +- rhbz.b_bugzilla_xmlrpc = g_build_filename(rhbz.b_bugzilla_url, "xmlrpc.cgi", NULL); +- rhbz.b_ssl_verify = FALSE; +- +- xmlrpc_env env; +- xmlrpc_env_init(&env); +- xmlrpc_client_setup_global_const(&env); +- if (env.fault_occurred) +- printf("Error in setup_global_const: %s\n", env.fault_string); +- xmlrpc_env_clean(&env); +- +- struct abrt_xmlrpc *client = abrt_xmlrpc_new_client(rhbz.b_bugzilla_xmlrpc, rhbz.b_ssl_verify); +- +- { +- TS_ASSERT_TRUE(rhbz_login(client, "captainnemo", "giantsquidsalad")); +- } +- +- /*{ +- xmlrpc_value *result = abrt_xmlrpc_call(client, "Product.get", "{s:(s)}", +- "names", "Fedora"); +- xmlrpc_value *product_list = rhbz_get_member("products", result); +- xmlrpc_DECREF(result); +- +- xmlrpc_value *product = rhbz_array_item_at(product_list, 0); +- xmlrpc_DECREF(product_list); +- +- g_autofree char *product_description = (char *)rhbz_bug_read_item("description", product, +- RHBZ_READ_STR); +- xmlrpc_DECREF(product); +- +- TS_ASSERT_STRING_EQ(product_description, "bog standard OS", "Checking product description"); +- +- }*/ +- +- { +- int bug_id = -1; +- +- problem_data_t *problem_data = create_problem_data_for_reporting("../../sample_problems/1"); +- bug_id = rhbz_new_bug(client, +- problem_data, "Red Hat Enterprise Linux 8", "8.0", +- "gdb doesn't work", +- "It's been broken for ages", +- rhbz.b_create_private, +- rhbz.b_private_groups +- ); +- +- TS_ASSERT_SIGNED_EQ(bug_id, 0); +- +- const char *bt = problem_data_get_content_or_NULL(problem_data, "backtrace"); +- int ret = rhbz_attach_blob(client, "0", "backtrace", bt, strlen(bt), RHBZ_MINOR_UPDATE); +- TS_ASSERT_SIGNED_EQ(ret, 0); +- g_hash_table_destroy(problem_data); +- } +- +- { +- int bug_id = -1; +- +- problem_data_t *problem_data = create_problem_data_for_reporting("../../sample_problems/2"); +- bug_id = rhbz_new_bug(client, +- problem_data, "Red Hat Enterprise Linux 8", "8.0", +- "gdb doesn't work", +- "It's been broken for ages", +- rhbz.b_create_private, +- rhbz.b_private_groups +- ); +- TS_ASSERT_SIGNED_EQ(bug_id, 1); +- g_hash_table_destroy(problem_data); +- } +- +- { +- int bug_id = -1; +- +- problem_data_t *problem_data = create_problem_data_for_reporting("../../sample_problems/3"); +- bug_id = rhbz_new_bug(client, +- problem_data, "Fedora", "33", +- "afmw doesn't work", +- "It's been broken for ages", +- rhbz.b_create_private, +- rhbz.b_private_groups +- ); +- TS_ASSERT_SIGNED_EQ(bug_id, 2); +- g_hash_table_destroy(problem_data); +- } +- g_free((void *)rhbz.b_bugzilla_xmlrpc); +- +- { +- xmlrpc_value *sub_components = rhbz_get_sub_components(client, "Red Hat Enterprise Linux 8", "unknown"); +- char *sub_component = rhbz_get_default_sub_component("unknown", sub_components); +- TS_ASSERT_STRING_EQ(sub_component, "torpedoes", "Picking a sub_component when no default is hardcoded"); +- g_free(sub_component); +- if (sub_components) +- xmlrpc_DECREF(sub_components); +- } +- +- { +- rhbz_mail_to_cc(client, 0, "dev1@example.com", RHBZ_MINOR_UPDATE); +- rhbz_mail_to_cc(client, 0, "dev2@example.com", RHBZ_MINOR_UPDATE); +- xmlrpc_value *search = abrt_xmlrpc_call(client, +- "Bug.search", +- "{s:s,s:(ss)}", +- "quicksearch", +- "ALL product:\"Red Hat Enterprise Linux 8\"", +- "include_fields", +- "id", "cc"); +- xmlrpc_value *bugs = rhbz_get_member("bugs", search); +- xmlrpc_DECREF(search); +- xmlrpc_value *bug = rhbz_array_item_at(bugs, 0); +- xmlrpc_DECREF(bugs); +- +- GList *cc_list = rhbz_bug_cc(bug); +- xmlrpc_DECREF(bug); +- +- TS_ASSERT_STRING_EQ(g_list_nth_data(cc_list, 0), "dev1@example.com", "Checking updated bug cc list"); +- TS_ASSERT_STRING_EQ(g_list_nth_data(cc_list, 1), "dev2@example.com", "Checking updated bug cc list"); +- g_list_free_full(cc_list, g_free); +- +- } +- +- { +- rhbz_set_url(client, 1, "http://example.com/bug123", RHBZ_MINOR_UPDATE); +- xmlrpc_value *search = abrt_xmlrpc_call(client, +- "Bug.search", +- "{s:s,s:(ss)}", +- "quicksearch", +- "ALL product:\"Red Hat Enterprise Linux 8\" url:\"http://example.com/bug123\"", +- "include_fields", +- "id", "url"); +- xmlrpc_value *bugs = rhbz_get_member("bugs", search); +- xmlrpc_DECREF(search); +- xmlrpc_value *bug = rhbz_array_item_at(bugs, 0); +- xmlrpc_DECREF(bugs); +- +- g_autofree char *updated_url = (char *)rhbz_bug_read_item("url", bug, RHBZ_READ_STR); +- TS_ASSERT_STRING_EQ(updated_url, "http://example.com/bug123", "Checking updated bug url"); +- xmlrpc_DECREF(bug); +- +- } +- +- { +- xmlrpc_value *all_bugs = rhbz_search_duphash(client, +- "Red Hat Enterprise Linux 8", +- NULL, +- NULL, +- "abrt_hash:(null);"); +- TS_ASSERT_SIGNED_EQ(rhbz_array_size(all_bugs), 2); +- xmlrpc_DECREF(all_bugs); +- } +- +- { +- rhbz_close_as_duplicate(client, 1, 0, RHBZ_MINOR_UPDATE); +- xmlrpc_value *search = abrt_xmlrpc_call(client, "Bug.search", +- "{s:s,s:(ssss)}", +- "quicksearch", +- "ALL resolution:\"DUPLICATE\"", +- "include_fields", "id", "status", "resolution", "dupe_of"); +- +- xmlrpc_value *bugs = rhbz_get_member("bugs", search); +- xmlrpc_DECREF(search); +- xmlrpc_value *bug = rhbz_array_item_at(bugs, 0); +- xmlrpc_DECREF(bugs); +- +- char *status = (char *)rhbz_bug_read_item("status", bug, RHBZ_READ_STR); +- char *resolution = (char *)rhbz_bug_read_item("resolution", bug, RHBZ_READ_STR); +- int *dupe_of = (int *)rhbz_bug_read_item("dupe_of", bug, RHBZ_READ_INT); +- xmlrpc_DECREF(bug); +- +- TS_ASSERT_STRING_EQ(status, "CLOSED", "Checking closed bug status"); +- TS_ASSERT_STRING_EQ(resolution, "DUPLICATE", "Checking closed bug resolution"); +- TS_ASSERT_SIGNED_EQ(*dupe_of, 0); +- +- g_free(status); +- g_free(resolution); +- g_free(dupe_of); +- } +- +- { +- struct bug_info *my_bug = rhbz_bug_info(client, 0); +- +- TS_ASSERT_STRING_EQ(my_bug->bi_product, "Red Hat Enterprise Linux 8", "bug_info.bi_product"); +- TS_ASSERT_STRING_EQ(my_bug->bi_reporter, "captainnemo", "bug_info.bi_reporter"); +- TS_ASSERT_STRING_EQ(my_bug->bi_status, "NEW", "bug_info.bi_status"); +- TS_ASSERT_STRING_EQ(my_bug->bi_platform, "x86_64", "bug_info.bi_platform"); +- free_bug_info(my_bug); +- } +- +- { +- struct bug_info *my_bug = rhbz_bug_info(client, 1); +- struct bug_info *origin = rhbz_find_origin_bug_closed_duplicate(client, my_bug); +- TS_ASSERT_SIGNED_EQ(origin->bi_id, 0); +- free_bug_info(my_bug); +- free_bug_info(origin); +- } +- +- { +- rhbz_add_comment(client, 0, "some comment", 0); +- +- GList *comment_list = rhbz_comments(client, 0); +- +- TS_ASSERT_STRING_EQ(g_list_nth_data(comment_list, 0), "some comment", "Checking add_comment"); +- g_list_free_full(comment_list, g_free); +- } +- +- { +- rhbz_logout(client); +- } +- +- { +- xmlrpc_value *stop = abrt_xmlrpc_call(client, "Bugzilla.stop_server", "{}"); +- xmlrpc_DECREF(stop); +- } +- abrt_xmlrpc_free_client(client); +- +- } +- else // pid == -1 +- { +- printf("fork failed: %s\n", strerror(errno)); +- return 1; +- } +-} +-TS_RETURN_MAIN +-]]) +diff --git a/tests/testsuite.at b/tests/testsuite.at +index 721904e2c..1c896e463 100644 +--- a/tests/testsuite.at ++++ b/tests/testsuite.at +@@ -31,4 +31,3 @@ m4_include([bugzilla_plugin.at]) + m4_include([proc_helpers.at]) + m4_include([forbidden_words.at]) + m4_include([client.at]) +-m4_include([rhbz_functions.at]) diff --git a/backport-make-anaconda-event-conf-depend-on-BZ.patch b/backport-make-anaconda-event-conf-depend-on-BZ.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c0f6ed2ec333ec459c55f873999843d14dcf097 --- /dev/null +++ b/backport-make-anaconda-event-conf-depend-on-BZ.patch @@ -0,0 +1,32 @@ +From 8262a46550d729cceb2c2799bde367a4c3f77567 Mon Sep 17 00:00:00 2001 +From: Michal Fabik +Date: Mon, 29 Aug 2022 16:51:31 +0200 +Subject: [PATCH] doc: Make anaconda_event.conf depend on BZ + +The libreport-anaconda subpackage depends on libreport-plugin-bugzilla, +i.e. on the --without-bugzilla configure option. Fix conditional build +of libreport-anaconda's documentation. +--- + doc/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index 4734f7f2..2a0e2b3f 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -3,6 +3,7 @@ EXTRA_DIST = + MAN1_BUGZILLA = \ + reporter-bugzilla.txt + MAN5_BUGZILLA = \ ++ anaconda_event.conf.txt \ + bugzilla_anaconda_event.conf.txt \ + bugzilla.conf.txt \ + bugzilla_event.conf.txt \ +@@ -37,7 +38,6 @@ MAN1_TXT = \ + reporter-systemd-journal.txt + + MAN5_TXT = \ +- anaconda_event.conf.txt \ + mantisbt.conf.txt \ + mantisbt_format.conf.txt \ + mantisbt_formatdup.conf.txt \ diff --git a/libreport.spec b/libreport.spec index 3d889e6fe2e929e1b5263f8d7ff0d388155ffd58..5c0d1b3bf089c2e0b2b68a2f8ca13df405b62fe2 100644 --- a/libreport.spec +++ b/libreport.spec @@ -2,12 +2,15 @@ Name: libreport Version: 2.15.2 -Release: 4 +Release: 5 License: GPLv2+ Summary: Generic library for reporting various problems URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Patch6000: backport-Fix-build-without-bugzilla.patch +Patch6002: backport-make-anaconda-event-conf-depend-on-BZ.patch +Patch6001: backport-Don-t-build-rhel-bugzilla-without-bugzilla.patch Patch9000: fix-bug-delete-gtk-deprecation-warnings.patch BuildRequires: dbus-devel gtk3-devel curl-devel desktop-file-utils python3-devel @@ -335,6 +338,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Thu Nov 9 2023 zhoupengcheng - 2.15.2-5 +- DESC:fix build failed + * Fri Apr 28 2023 zhoupengcheng - 2.15.2-4 - Type:bugfix - CVE:NA