|
|
2c83a8 |
From 1e38476046ca0dde7d91ac07462871820cfd55ca Mon Sep 17 00:00:00 2001
|
|
|
2c83a8 |
From: Matej Habrnal <mhabrnal@redhat.com>
|
|
|
2c83a8 |
Date: Tue, 22 Mar 2016 14:16:40 +0100
|
|
|
2c83a8 |
Subject: [PATCH] bugzilla: make the event configurable
|
|
|
2c83a8 |
|
|
|
2c83a8 |
Allow downstream to choose whether they want to open Bugzilla bugs
|
|
|
2c83a8 |
private by default.
|
|
|
2c83a8 |
|
|
|
2c83a8 |
Related to rhbz#1279453
|
|
|
2c83a8 |
|
|
|
2c83a8 |
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
|
|
2c83a8 |
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
|
|
|
2c83a8 |
---
|
|
|
2c83a8 |
configure.ac | 15 +++++
|
|
|
2c83a8 |
po/POTFILES.skip | 1 +
|
|
|
2c83a8 |
src/plugins/Makefile.am | 2 +-
|
|
|
2c83a8 |
src/plugins/bugzilla.conf | 4 +-
|
|
|
2c83a8 |
src/plugins/report_Bugzilla.xml.in | 71 ---------------------
|
|
|
2c83a8 |
src/plugins/report_Bugzilla.xml.in.in | 72 +++++++++++++++++++++
|
|
|
2c83a8 |
tests/Makefile.am | 8 ++-
|
|
|
2c83a8 |
tests/bugzilla_plugin.at.in | 114 ++++++++++++++++++++++++++++++++++
|
|
|
2c83a8 |
tests/testsuite.at | 1 +
|
|
|
2c83a8 |
10 files changed, 214 insertions(+), 76 deletions(-)
|
|
|
2c83a8 |
delete mode 100644 src/plugins/report_Bugzilla.xml.in
|
|
|
2c83a8 |
create mode 100644 src/plugins/report_Bugzilla.xml.in.in
|
|
|
2c83a8 |
create mode 100644 tests/bugzilla_plugin.at.in
|
|
|
2c83a8 |
|
|
|
2c83a8 |
diff --git a/configure.ac b/configure.ac
|
|
|
2c83a8 |
index 8aea410..a7f67c9 100644
|
|
|
2c83a8 |
--- a/configure.ac
|
|
|
2c83a8 |
+++ b/configure.ac
|
|
|
2c83a8 |
@@ -95,6 +95,19 @@ AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no])
|
|
|
2c83a8 |
[exit 1]
|
|
|
2c83a8 |
[fi]
|
|
|
2c83a8 |
|
|
|
2c83a8 |
+AC_ARG_WITH([redhatbugzillacreateprivate],
|
|
|
2c83a8 |
+ AS_HELP_STRING([--with-redhatbugzillacreateprivate="yes/no"],
|
|
|
2c83a8 |
+ [Whether the Red Hat Bugzilla plugin should open
|
|
|
2c83a8 |
+ bugs private by default ("yes")]),
|
|
|
2c83a8 |
+ [], [with_redhatbugzillacreateprivate="yes"])
|
|
|
2c83a8 |
+AC_SUBST([RED_HAT_BUGZILLA_CREATE_PRIVATE], [$with_redhatbugzillacreateprivate])
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+AC_ARG_WITH([redhatbugzillaprivategroups],
|
|
|
2c83a8 |
+ AS_HELP_STRING([--with-redhatbugzillaprivategroups="CSV"],
|
|
|
2c83a8 |
+ [Name of groups separated by comma]),
|
|
|
2c83a8 |
+ [], [with_redhatbugzillaprivategroups="redhat"])
|
|
|
2c83a8 |
+AC_SUBST([RED_HAT_BUGZILLA_PRIVATE_GROUPS], [$with_redhatbugzillaprivategroups])
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
XMLRPC_CFLAGS=`xmlrpc-c-config --cflags 2> /dev/null`
|
|
|
2c83a8 |
XMLRPC_LIBS=`xmlrpc-c-config --libs 2> /dev/null`
|
|
|
2c83a8 |
AC_SUBST(XMLRPC_CFLAGS)
|
|
|
2c83a8 |
@@ -337,11 +350,13 @@ AC_CONFIG_FILES([
|
|
|
2c83a8 |
src/cli/Makefile
|
|
|
2c83a8 |
src/report-newt/Makefile
|
|
|
2c83a8 |
src/plugins/Makefile
|
|
|
2c83a8 |
+ src/plugins/report_Bugzilla.xml.in
|
|
|
2c83a8 |
src/client-python/Makefile
|
|
|
2c83a8 |
po/Makefile.in
|
|
|
2c83a8 |
doc/Makefile
|
|
|
2c83a8 |
doc/plugins-dbus/Makefile
|
|
|
2c83a8 |
src/workflows/Makefile
|
|
|
2c83a8 |
+ tests/bugzilla_plugin.at
|
|
|
2c83a8 |
])
|
|
|
2c83a8 |
|
|
|
2c83a8 |
# src/plugins/Makefile
|
|
|
2c83a8 |
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
|
|
|
2c83a8 |
index 2048914..5268b71 100644
|
|
|
2c83a8 |
--- a/po/POTFILES.skip
|
|
|
2c83a8 |
+++ b/po/POTFILES.skip
|
|
|
2c83a8 |
@@ -1,2 +1,3 @@
|
|
|
2c83a8 |
contrib/command-not-found/pk-tools-common.c
|
|
|
2c83a8 |
build/
|
|
|
2c83a8 |
+src/plugins/report_Bugzilla.xml.in.in
|
|
|
2c83a8 |
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
|
|
|
2c83a8 |
index d5d75b6..397cc72 100644
|
|
|
2c83a8 |
--- a/src/plugins/Makefile.am
|
|
|
2c83a8 |
+++ b/src/plugins/Makefile.am
|
|
|
2c83a8 |
@@ -82,7 +82,7 @@ dist_eventsdef_DATA = \
|
|
|
2c83a8 |
reporters_extra_dist =
|
|
|
2c83a8 |
if BUILD_BUGZILLA
|
|
|
2c83a8 |
dist_eventsdef_DATA += bugzilla_event.conf bugzilla_anaconda_event.conf
|
|
|
2c83a8 |
-reporters_extra_dist += report_Bugzilla.xml.in report_Bugzilla.conf
|
|
|
2c83a8 |
+reporters_extra_dist += report_Bugzilla.xml.in.in report_Bugzilla.conf
|
|
|
2c83a8 |
endif
|
|
|
2c83a8 |
|
|
|
2c83a8 |
if BUILD_UREPORT
|
|
|
2c83a8 |
diff --git a/src/plugins/bugzilla.conf b/src/plugins/bugzilla.conf
|
|
|
2c83a8 |
index 29c44b3..51648de 100644
|
|
|
2c83a8 |
--- a/src/plugins/bugzilla.conf
|
|
|
2c83a8 |
+++ b/src/plugins/bugzilla.conf
|
|
|
2c83a8 |
@@ -17,5 +17,5 @@ Password =
|
|
|
2c83a8 |
DontMatchComponents = selinux-policy
|
|
|
2c83a8 |
|
|
|
2c83a8 |
# for more info about these settings see: https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets
|
|
|
2c83a8 |
-# CreatePrivate = no
|
|
|
2c83a8 |
-# PrivateGroups = private
|
|
|
2c83a8 |
+# CreatePrivate = yes
|
|
|
2c83a8 |
+# PrivateGroups = redhat
|
|
|
2c83a8 |
diff --git a/src/plugins/report_Bugzilla.xml.in b/src/plugins/report_Bugzilla.xml.in
|
|
|
2c83a8 |
deleted file mode 100644
|
|
|
2c83a8 |
index 9ffe90f..0000000
|
|
|
2c83a8 |
--- a/src/plugins/report_Bugzilla.xml.in
|
|
|
2c83a8 |
+++ /dev/null
|
|
|
2c83a8 |
@@ -1,71 +0,0 @@
|
|
|
2c83a8 |
-
|
|
|
2c83a8 |
-<event>
|
|
|
2c83a8 |
- <_name>Bugzilla</_name>
|
|
|
2c83a8 |
- <_description>Report to Bugzilla bug tracker</_description>
|
|
|
2c83a8 |
-
|
|
|
2c83a8 |
- <requires-items>component,duphash,os_release</requires-items>
|
|
|
2c83a8 |
- <exclude-items-by-default>coredump,count,event_log,reported_to,vmcore</exclude-items-by-default>
|
|
|
2c83a8 |
- <exclude-items-always></exclude-items-always>
|
|
|
2c83a8 |
- <exclude-binary-items>no</exclude-binary-items>
|
|
|
2c83a8 |
- <include-items-by-default></include-items-by-default>
|
|
|
2c83a8 |
- <minimal-rating>3</minimal-rating>
|
|
|
2c83a8 |
- <gui-review-elements>yes</gui-review-elements>
|
|
|
2c83a8 |
-
|
|
|
2c83a8 |
- <options>
|
|
|
2c83a8 |
- <option type="text" name="Bugzilla_BugzillaURL">
|
|
|
2c83a8 |
- <_label>Bugzilla URL</_label>
|
|
|
2c83a8 |
- <allow-empty>no</allow-empty>
|
|
|
2c83a8 |
- <_description>Address of Bugzilla server</_description>
|
|
|
2c83a8 |
- <default-value>https://bugzilla.redhat.com</default-value>
|
|
|
2c83a8 |
- <_note-html>You can create bugzilla.redhat.com account <a href="https://bugzilla.redhat.com/createaccount.cgi">here</a></_note-html>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="text" name="Bugzilla_Login">
|
|
|
2c83a8 |
- <_label>User name</_label>
|
|
|
2c83a8 |
- <allow-empty>no</allow-empty>
|
|
|
2c83a8 |
- <_description>Bugzilla account user name</_description>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="password" name="Bugzilla_Password">
|
|
|
2c83a8 |
- <_label>Password</_label>
|
|
|
2c83a8 |
- <allow-empty>no</allow-empty>
|
|
|
2c83a8 |
- <_description>Bugzilla account password</_description>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="bool" name="Bugzilla_SSLVerify">
|
|
|
2c83a8 |
- <_label>Verify SSL</_label>
|
|
|
2c83a8 |
- <_description>Check SSL key validity</_description>
|
|
|
2c83a8 |
- <default-value>yes</default-value>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="bool" name="Bugzilla_CreatePrivate">
|
|
|
2c83a8 |
- <_label>Restrict access</_label>
|
|
|
2c83a8 |
- <_description>Restrict access to the created bugzilla ticket allowing only users from specified groups to view it (see advanced settings for more details)</_description>
|
|
|
2c83a8 |
- <default-value>no</default-value>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <advanced-options>
|
|
|
2c83a8 |
- <option type="text" name="Bugzilla_Product">
|
|
|
2c83a8 |
- <_label>Bugzilla product</_label>
|
|
|
2c83a8 |
- <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
- <_note-html>Specify this only if you needed different product than specified in /etc/os-release</_note-html>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="text" name="Bugzilla_ProductVersion">
|
|
|
2c83a8 |
- <_label>Bugzilla product version</_label>
|
|
|
2c83a8 |
- <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
- <_note-html>Specify this only if you needed different product version than specified in /etc/os-release</_note-html>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="text" name="http_proxy">
|
|
|
2c83a8 |
- <_label>HTTP Proxy</_label>
|
|
|
2c83a8 |
- <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
- <_note-html>Sets the proxy server to use for HTTP</_note-html>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="text" name="HTTPS_PROXY">
|
|
|
2c83a8 |
- <_label>HTTPS Proxy</_label>
|
|
|
2c83a8 |
- <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
- <_note-html>Sets the proxy server to use for HTTPS</_note-html>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- <option type="text" name="Bugzilla_PrivateGroups">
|
|
|
2c83a8 |
- <_label>Groups</_label>
|
|
|
2c83a8 |
- <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
- <default-value>private</default-value>
|
|
|
2c83a8 |
- <_note-html>Restrict the access to specified groups <a href="https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets">?</a></_note-html>
|
|
|
2c83a8 |
- </option>
|
|
|
2c83a8 |
- </advanced-options>
|
|
|
2c83a8 |
- </options>
|
|
|
2c83a8 |
-</event>
|
|
|
2c83a8 |
diff --git a/src/plugins/report_Bugzilla.xml.in.in b/src/plugins/report_Bugzilla.xml.in.in
|
|
|
2c83a8 |
new file mode 100644
|
|
|
2c83a8 |
index 0000000..5ef3925
|
|
|
2c83a8 |
--- /dev/null
|
|
|
2c83a8 |
+++ b/src/plugins/report_Bugzilla.xml.in.in
|
|
|
2c83a8 |
@@ -0,0 +1,72 @@
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+<event>
|
|
|
2c83a8 |
+ <_name>Bugzilla</_name>
|
|
|
2c83a8 |
+ <_description>Report to Bugzilla bug tracker</_description>
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ <requires-items>component,duphash,os_release</requires-items>
|
|
|
2c83a8 |
+ <exclude-items-by-default>coredump,count,event_log,reported_to,vmcore</exclude-items-by-default>
|
|
|
2c83a8 |
+ <exclude-items-always></exclude-items-always>
|
|
|
2c83a8 |
+ <exclude-binary-items>no</exclude-binary-items>
|
|
|
2c83a8 |
+ <include-items-by-default></include-items-by-default>
|
|
|
2c83a8 |
+ <minimal-rating>3</minimal-rating>
|
|
|
2c83a8 |
+ <gui-review-elements>yes</gui-review-elements>
|
|
|
2c83a8 |
+ <support-restricted-access optionname="Bugzilla_CreatePrivate">yes</support-restricted-access>
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ <options>
|
|
|
2c83a8 |
+ <option type="text" name="Bugzilla_Login">
|
|
|
2c83a8 |
+ <_label>User name</_label>
|
|
|
2c83a8 |
+ <allow-empty>no</allow-empty>
|
|
|
2c83a8 |
+ <_description>Bugzilla account user name</_description>
|
|
|
2c83a8 |
+ <_note-html>You can create bugzilla.redhat.com account <a href="https://bugzilla.redhat.com/createaccount.cgi">here</a></_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="password" name="Bugzilla_Password">
|
|
|
2c83a8 |
+ <_label>Password</_label>
|
|
|
2c83a8 |
+ <allow-empty>no</allow-empty>
|
|
|
2c83a8 |
+ <_description>Bugzilla account password</_description>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="bool" name="Bugzilla_CreatePrivate">
|
|
|
2c83a8 |
+ <_label>Restrict access</_label>
|
|
|
2c83a8 |
+ <_note-html>Restrict access to the created bugzilla ticket allowing only users from specified groups to view it (see advanced settings for more details)</_note-html>
|
|
|
2c83a8 |
+ <default-value>@RED_HAT_BUGZILLA_CREATE_PRIVATE@</default-value>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <advanced-options>
|
|
|
2c83a8 |
+ <option type="text" name="Bugzilla_PrivateGroups">
|
|
|
2c83a8 |
+ <_label>Groups</_label>
|
|
|
2c83a8 |
+ <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
+ <default-value>@RED_HAT_BUGZILLA_PRIVATE_GROUPS@</default-value>
|
|
|
2c83a8 |
+ <_note-html>Restrict the access to specified groups <a href="https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets">?</a></_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="text" name="Bugzilla_BugzillaURL">
|
|
|
2c83a8 |
+ <_label>Bugzilla URL</_label>
|
|
|
2c83a8 |
+ <allow-empty>no</allow-empty>
|
|
|
2c83a8 |
+ <default-value>https://bugzilla.redhat.com</default-value>
|
|
|
2c83a8 |
+ <_note-html>Address of Bugzilla server</_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="bool" name="Bugzilla_SSLVerify">
|
|
|
2c83a8 |
+ <_label>Verify SSL</_label>
|
|
|
2c83a8 |
+ <_note-html>Check SSL key validity</_note-html>
|
|
|
2c83a8 |
+ <default-value>yes</default-value>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="text" name="Bugzilla_Product">
|
|
|
2c83a8 |
+ <_label>Bugzilla product</_label>
|
|
|
2c83a8 |
+ <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
+ <_note-html>Specify this only if you needed different product than specified in /etc/os-release</_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="text" name="Bugzilla_ProductVersion">
|
|
|
2c83a8 |
+ <_label>Bugzilla product version</_label>
|
|
|
2c83a8 |
+ <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
+ <_note-html>Specify this only if you needed different product version than specified in /etc/os-release</_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="text" name="http_proxy">
|
|
|
2c83a8 |
+ <_label>HTTP Proxy</_label>
|
|
|
2c83a8 |
+ <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
+ <_note-html>Sets the proxy server to use for HTTP</_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ <option type="text" name="HTTPS_PROXY">
|
|
|
2c83a8 |
+ <_label>HTTPS Proxy</_label>
|
|
|
2c83a8 |
+ <allow-empty>yes</allow-empty>
|
|
|
2c83a8 |
+ <_note-html>Sets the proxy server to use for HTTPS</_note-html>
|
|
|
2c83a8 |
+ </option>
|
|
|
2c83a8 |
+ </advanced-options>
|
|
|
2c83a8 |
+ </options>
|
|
|
2c83a8 |
+</event>
|
|
|
2c83a8 |
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
|
|
2c83a8 |
index c22958b..825a870 100644
|
|
|
2c83a8 |
--- a/tests/Makefile.am
|
|
|
2c83a8 |
+++ b/tests/Makefile.am
|
|
|
2c83a8 |
@@ -48,12 +48,16 @@ TESTSUITE_AT = \
|
|
|
2c83a8 |
iso_date.at \
|
|
|
2c83a8 |
uriparser.at
|
|
|
2c83a8 |
|
|
|
2c83a8 |
+TESTSUITE_AT_IN = \
|
|
|
2c83a8 |
+ bugzilla_plugin.at
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
EXTRA_DIST += $(TESTSUITE_AT)
|
|
|
2c83a8 |
TESTSUITE = $(srcdir)/testsuite
|
|
|
2c83a8 |
MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
|
|
|
2c83a8 |
check_DATA = atconfig atlocal $(TESTSUITE)
|
|
|
2c83a8 |
DISTCLEANFILES = atconfig
|
|
|
2c83a8 |
-EXTRA_DIST += atlocal.in conf ureport ureport-rhts-credentials
|
|
|
2c83a8 |
+EXTRA_DIST += atlocal.in conf ureport ureport-rhts-credentials \
|
|
|
2c83a8 |
+ bugzilla_plugin.at.in
|
|
|
2c83a8 |
|
|
|
2c83a8 |
atconfig: $(top_builddir)/config.status
|
|
|
2c83a8 |
(cd ${top_builddir} && ./config.status ${subdir}/atconfig)
|
|
|
2c83a8 |
@@ -69,6 +73,6 @@ clean-local:
|
|
|
2c83a8 |
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean
|
|
|
2c83a8 |
|
|
|
2c83a8 |
AUTOTEST = $(AUTOM4TE) --language=autotest
|
|
|
2c83a8 |
-$(TESTSUITE): $(TESTSUITE_AT) $(srcdir)/package.m4
|
|
|
2c83a8 |
+$(TESTSUITE): $(TESTSUITE_AT) $(TESTSUITE_AT_IN) $(srcdir)/package.m4
|
|
|
2c83a8 |
$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
|
|
|
2c83a8 |
mv $@.tmp $@
|
|
|
2c83a8 |
diff --git a/tests/bugzilla_plugin.at.in b/tests/bugzilla_plugin.at.in
|
|
|
2c83a8 |
new file mode 100644
|
|
|
2c83a8 |
index 0000000..a06b9d3
|
|
|
2c83a8 |
--- /dev/null
|
|
|
2c83a8 |
+++ b/tests/bugzilla_plugin.at.in
|
|
|
2c83a8 |
@@ -0,0 +1,114 @@
|
|
|
2c83a8 |
+# -*- Autotest -*-
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+AT_BANNER([Bugzilla])
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+## ------------------- ##
|
|
|
2c83a8 |
+## report_Bugzilla_xml ##
|
|
|
2c83a8 |
+## ------------------- ##
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+AT_TESTFUN([report_Bugzilla_xml],
|
|
|
2c83a8 |
+[[
|
|
|
2c83a8 |
+#include "testsuite.h"
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+TS_MAIN
|
|
|
2c83a8 |
+{
|
|
|
2c83a8 |
+ event_config_t *conf = new_event_config("report_Bugzilla");
|
|
|
2c83a8 |
+ load_event_description_from_file(conf, "../../../src/plugins/report_Bugzilla.xml");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(ec_get_screen_name(conf), "Bugzilla", "Screen name");
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(ec_get_description(conf), "Report to Bugzilla bug tracker", "Description");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(conf->ec_creates_items, NULL, "Not-defined create items");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(conf->ec_requires_items, "component,duphash,os_release", "Correct required items");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(conf->ec_exclude_items_by_default, "coredump,count,event_log,reported_to,vmcore", "Correct excluded items by default");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(conf->ec_exclude_items_always, NULL, "Not-defined excluded items always");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_FALSE(conf->ec_exclude_binary_items);
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(conf->ec_include_items_by_default, NULL, "Not-defined included items by default");
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_SIGNED_EQ(conf->ec_minimal_rating, 3);
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_FALSE(conf->ec_skip_review);
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_FALSE(conf->ec_sending_sensitive_data);
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_TRUE(conf->ec_supports_restricted_access);
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ event_option_t options[10] = {
|
|
|
2c83a8 |
+ { .eo_value = NULL, .eo_label = (char *)"User name",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"You can create bugzilla.redhat.com account here",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 0, .is_advanced = 0,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = NULL, .eo_label = (char *)"Password", .eo_note_html = NULL,
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_PASSWORD, .eo_allow_empty = 0, .is_advanced = 0,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = (char *)"@RED_HAT_BUGZILLA_CREATE_PRIVATE@", .eo_label = (char *)"Restrict access",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Restrict access to the created bugzilla ticket allowing only users from specified groups to view it (see advanced settings for more details)",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_BOOL, .eo_allow_empty = 0, .is_advanced = 0,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = (char *)"@RED_HAT_BUGZILLA_PRIVATE_GROUPS@", .eo_label = (char *)"Groups",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Restrict the access to specified groups ?",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 1, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = (char *)"https://bugzilla.redhat.com", .eo_label = (char *)"Bugzilla URL",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Address of Bugzilla server",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 0, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = (char *)"yes", .eo_label = (char *)"Verify SSL",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Check SSL key validity",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_BOOL, .eo_allow_empty = 0, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = NULL, .eo_label = (char *)"Bugzilla product",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Specify this only if you needed different product than specified in /etc/os-release",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 1, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = NULL, .eo_label = (char *)"Bugzilla product version",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Specify this only if you needed different product version than specified in /etc/os-release",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 1, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = NULL, .eo_label = (char *)"HTTP Proxy",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Sets the proxy server to use for HTTP",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 1, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ { .eo_value = NULL, .eo_label = (char *)"HTTPS Proxy",
|
|
|
2c83a8 |
+ .eo_note_html = (char *)"Sets the proxy server to use for HTTPS",
|
|
|
2c83a8 |
+ .eo_type = OPTION_TYPE_TEXT, .eo_allow_empty = 1, .is_advanced = 1,
|
|
|
2c83a8 |
+ },
|
|
|
2c83a8 |
+ };
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ const char *option_names[] = {
|
|
|
2c83a8 |
+ "Bugzilla_Login",
|
|
|
2c83a8 |
+ "Bugzilla_Password",
|
|
|
2c83a8 |
+ "Bugzilla_CreatePrivate",
|
|
|
2c83a8 |
+ "Bugzilla_PrivateGroups",
|
|
|
2c83a8 |
+ "Bugzilla_BugzillaURL",
|
|
|
2c83a8 |
+ "Bugzilla_SSLVerify",
|
|
|
2c83a8 |
+ "Bugzilla_Product",
|
|
|
2c83a8 |
+ "Bugzilla_ProductVersion",
|
|
|
2c83a8 |
+ "http_proxy",
|
|
|
2c83a8 |
+ "HTTPS_PROXY"
|
|
|
2c83a8 |
+ };
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ for (unsigned i = 0; i < ARRAY_SIZE(option_names); ++i) {
|
|
|
2c83a8 |
+ event_option_t *eo = get_event_option_from_list(option_names[i], conf->options);
|
|
|
2c83a8 |
+ TS_ASSERT_PTR_IS_NOT_NULL_MESSAGE(eo, option_names[i]);
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ if (eo == NULL)
|
|
|
2c83a8 |
+ continue;
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(eo->eo_value, options[i].eo_value, option_names[i]);
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(eo->eo_label, options[i].eo_label, option_names[i]);
|
|
|
2c83a8 |
+ TS_ASSERT_STRING_EQ(eo->eo_note_html, options[i].eo_note_html, option_names[i]);
|
|
|
2c83a8 |
+ TS_ASSERT_SIGNED_OP_MESSAGE(eo->eo_type, ==, options[i].eo_type, option_names[i]);
|
|
|
2c83a8 |
+ TS_ASSERT_SIGNED_OP_MESSAGE(eo->eo_allow_empty, ==, options[i].eo_allow_empty, option_names[i]);
|
|
|
2c83a8 |
+ TS_ASSERT_SIGNED_OP_MESSAGE(eo->is_advanced, ==, options[i].is_advanced, option_names[i]);
|
|
|
2c83a8 |
+ }
|
|
|
2c83a8 |
+
|
|
|
2c83a8 |
+ free_event_config(conf);
|
|
|
2c83a8 |
+}
|
|
|
2c83a8 |
+TS_RETURN_MAIN
|
|
|
2c83a8 |
+]])
|
|
|
2c83a8 |
diff --git a/tests/testsuite.at b/tests/testsuite.at
|
|
|
2c83a8 |
index 72e0715..c8269b1 100644
|
|
|
2c83a8 |
--- a/tests/testsuite.at
|
|
|
2c83a8 |
+++ b/tests/testsuite.at
|
|
|
2c83a8 |
@@ -21,3 +21,4 @@ m4_include([dump_dir.at])
|
|
|
2c83a8 |
m4_include([global_config.at])
|
|
|
2c83a8 |
m4_include([iso_date.at])
|
|
|
2c83a8 |
m4_include([uriparser.at])
|
|
|
2c83a8 |
+m4_include([bugzilla_plugin.at])
|
|
|
2c83a8 |
--
|
|
|
2c83a8 |
1.8.3.1
|
|
|
2c83a8 |
|