Blame SOURCES/0030-ureport-Drop-Strata-integration.patch

99f8fd
From 646101d558765b59bae94aa27bfbefed3a085ab5 Mon Sep 17 00:00:00 2001
99f8fd
From: Ernestas Kulik <ekulik@redhat.com>
99f8fd
Date: Tue, 2 Jun 2020 10:57:36 +0200
99f8fd
Subject: [PATCH] ureport: Drop Strata integration
99f8fd
99f8fd
Strata is being sunset with no replacement for our used API endpoints in
99f8fd
sight. This commit drops the integration code, because no one pretty
99f8fd
much wants it, either.
99f8fd
---
99f8fd
 configure.ac                               |  11 --
99f8fd
 doc/reporter-rhtsupport.txt                |  17 --
99f8fd
 doc/reporter-ureport.txt                   |   8 -
99f8fd
 src/include/ureport.h                      |   4 +-
99f8fd
 src/lib/ureport.c                          | 138 +--------------
99f8fd
 src/plugins/Makefile.am                    |   6 -
99f8fd
 src/plugins/cert-api.access.redhat.com.pem |  74 --------
99f8fd
 src/plugins/report_RHTSupport.xml.in       |   5 -
99f8fd
 src/plugins/reporter-rhtsupport.c          | 186 +--------------------
99f8fd
 src/plugins/ureport.conf                   |   4 -
99f8fd
 tests/ureport.at                           | 174 -------------------
99f8fd
 tests/ureport/rhsm/__init__.py             |   0
99f8fd
 tests/ureport/rhsm/config.py               |   8 -
99f8fd
 13 files changed, 7 insertions(+), 628 deletions(-)
99f8fd
 delete mode 100644 src/plugins/cert-api.access.redhat.com.pem
99f8fd
 delete mode 100644 tests/ureport/rhsm/__init__.py
99f8fd
 delete mode 100644 tests/ureport/rhsm/config.py
99f8fd
99f8fd
diff --git a/configure.ac b/configure.ac
99f8fd
index ce45389..ef35f84 100644
99f8fd
--- a/configure.ac
99f8fd
+++ b/configure.ac
99f8fd
@@ -172,17 +172,6 @@ do
99f8fd
 done
99f8fd
 fi dnl end NO_MANTISBT
99f8fd
 
99f8fd
-dnl enable import of certificate for rhtsupport plugin
99f8fd
-AC_ARG_ENABLE([import-rhtsupport-cert],
99f8fd
-AS_HELP_STRING([--enable-import-rhtsupport-cert],
99f8fd
-    [import certificate needed for rhtsupport plugin (default is NO)]),
99f8fd
-[], [enable_import_rhtsupport_cert="no"])
99f8fd
-
99f8fd
-AS_IF([test "x$enable_import_rhtsupport_cert" != "xno"],
99f8fd
-AM_CONDITIONAL(ENABLE_IMPORT_RHTSUPPORT_CERT, true),
99f8fd
-AM_CONDITIONAL(ENABLE_IMPORT_RHTSUPPORT_CERT, false))
99f8fd
-
99f8fd
-
99f8fd
 AC_ARG_WITH(python2,
99f8fd
 AS_HELP_STRING([--with-python2],[use python2 (default is YES)]),
99f8fd
 LIBREPORT_PARSE_WITH([python2]))
99f8fd
diff --git a/doc/reporter-rhtsupport.txt b/doc/reporter-rhtsupport.txt
99f8fd
index e52a152..132c0ea 100644
99f8fd
--- a/doc/reporter-rhtsupport.txt
99f8fd
+++ b/doc/reporter-rhtsupport.txt
99f8fd
@@ -18,9 +18,6 @@ DESCRIPTION
99f8fd
 The tool reads problem directory DIR. Then it logs in to RHTSupport
99f8fd
 and creates a new case.
99f8fd
 
99f8fd
-The tool can be configured to submit an uReport to RHTSupport together with
99f8fd
-creating a new case.
99f8fd
-
99f8fd
 The URL to new case is printed to stdout and recorded in 'reported_to'
99f8fd
 element in DIR.
99f8fd
 
99f8fd
@@ -36,10 +33,6 @@ to enter case ID to which you want to upload the FILEs.
99f8fd
 Option -tCASE uploads FILEs to the case CASE on RHTSupport site.
99f8fd
 -d DIR is ignored.
99f8fd
 
99f8fd
-Option -u uploads uReport along with creating a new case. uReport configuration
99f8fd
-is loaded from UR_CONFFILE which defaults to
99f8fd
-/etc/libreport/plugins/ureport.conf.
99f8fd
-
99f8fd
 Configuration file
99f8fd
 ~~~~~~~~~~~~~~~~~~
99f8fd
 Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
99f8fd
@@ -56,10 +49,6 @@ Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
99f8fd
 'SSLVerify'::
99f8fd
 	Use yes/true/on/1 to verify server's SSL certificate. (default: yes)
99f8fd
 
99f8fd
-'SubmitUReport'::
99f8fd
-	Use yes/true/on/1 to enable submitting uReport together wit creating a new
99f8fd
-	case. (default: no)
99f8fd
-
99f8fd
 Parameters can be overridden via $RHTSupport_PARAM environment variables.
99f8fd
 
99f8fd
 Integration with ABRT events
99f8fd
@@ -84,12 +73,6 @@ OPTIONS
99f8fd
 -t[ID]::
99f8fd
    Upload FILEs to the already created case on RHTSupport site.
99f8fd
 
99f8fd
--u::
99f8fd
-   Submit uReport together with creating a new case.
99f8fd
-
99f8fd
--C UR_CONFFILE::
99f8fd
-   Configuration file for submitting uReports.
99f8fd
-
99f8fd
 -F CONF_FORMAT_FILE::
99f8fd
    Formatting file for a new case.
99f8fd
 
99f8fd
diff --git a/doc/reporter-ureport.txt b/doc/reporter-ureport.txt
99f8fd
index 7deb911..fc06541 100644
99f8fd
--- a/doc/reporter-ureport.txt
99f8fd
+++ b/doc/reporter-ureport.txt
99f8fd
@@ -34,10 +34,6 @@ Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
99f8fd
 
99f8fd
    Possible values are:
99f8fd
 
99f8fd
-   'rhsm';;
99f8fd
-      Uses the system V3 entitlement certificate that is used for Red Hat
99f8fd
-      subscription management.
99f8fd
-
99f8fd
    'puppet';;
99f8fd
       Uses the certificate that is used by the Puppet configuration management tool.
99f8fd
 
99f8fd
@@ -51,10 +47,6 @@ Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
99f8fd
 
99f8fd
    Possible values are::
99f8fd
 
99f8fd
-   'rhts-credentials';;
99f8fd
-      Uses Login= and Password= values from /etc/libreport/plugins/rhtsupport.conf and
99f8fd
-      user's local ~/.config/libreport/rhtsupport.conf.
99f8fd
-
99f8fd
    '<user_name>:<password>';;
99f8fd
       Manually supply credentials.
99f8fd
 
99f8fd
diff --git a/src/include/ureport.h b/src/include/ureport.h
99f8fd
index 63d9bf2..2e6de49 100644
99f8fd
--- a/src/include/ureport.h
99f8fd
+++ b/src/include/ureport.h
99f8fd
@@ -115,8 +115,7 @@ ureport_server_config_set_url(struct ureport_server_config *config,
99f8fd
  * Configure client certificate paths
99f8fd
  *
99f8fd
  * @param config Where the paths are stored
99f8fd
- * @param client_path Path in form of cert_full_path:key_full_path or one of
99f8fd
- *        the following string: 'rhsm', 'puppet'.
99f8fd
+ * @param client_path Path in form of cert_full_path:key_full_path or 'puppet'.
99f8fd
  */
99f8fd
 #define ureport_server_config_set_client_auth libreport_ureport_server_config_set_client_auth
99f8fd
 void
99f8fd
@@ -139,7 +138,6 @@ ureport_server_config_set_basic_auth(struct ureport_server_config *config,
99f8fd
  * Configure user name and password for HTTP Basic authentication according to
99f8fd
  * user preferences.
99f8fd
  *
99f8fd
- *  "rhts-credentials" - Uses Login= and Password= from rhtsupport.conf
99f8fd
  *  "<user_name>:<password>" - Manually supply user name and password.
99f8fd
  *  "<user_name>" - Manually supply user name and be asked for password.
99f8fd
  *
99f8fd
diff --git a/src/lib/ureport.c b/src/lib/ureport.c
99f8fd
index ced4810..5d0a820 100644
99f8fd
--- a/src/lib/ureport.c
99f8fd
+++ b/src/lib/ureport.c
99f8fd
@@ -30,19 +30,6 @@
99f8fd
 
99f8fd
 #define BTHASH_URL_SFX "reports/bthash/"
99f8fd
 
99f8fd
-#define RHSM_WEB_SERVICE_URL "https://cert-api.access.redhat.com/rs/telemetry/abrt"
99f8fd
-
99f8fd
-#define RHSMCON_PEM_DIR_PATH "/etc/pki/consumer"
99f8fd
-#define RHSMCON_CERT_NAME "cert.pem"
99f8fd
-#define RHSMCON_KEY_NAME "key.pem"
99f8fd
-
99f8fd
-/* Using the same template as for RHSM certificate, macro for cert dir path and
99f8fd
- * macro for cert name. Cert path can be easily modified for example by reading
99f8fd
- * an environment variable LIBREPORT_DEBUG_AUTHORITY_CERT_DIR_PATH
99f8fd
- */
99f8fd
-#define CERT_AUTHORITY_CERT_PATH "/etc/libreport"
99f8fd
-#define CERT_AUTHORITY_CERT_NAME "cert-api.access.redhat.com.pem"
99f8fd
-
99f8fd
 static char *
99f8fd
 puppet_config_print(const char *key)
99f8fd
 {
99f8fd
@@ -73,55 +60,6 @@ ureport_server_config_set_url(struct ureport_server_config *config,
99f8fd
     config->ur_url = server_url;
99f8fd
 }
99f8fd
 
99f8fd
-static char *
99f8fd
-rhsm_config_get_consumer_cert_dir(void)
99f8fd
-{
99f8fd
-    char *result = getenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
99f8fd
-    if (result != NULL)
99f8fd
-        return xstrdup(result);
99f8fd
-
99f8fd
-    result = run_in_shell_and_save_output(0,
99f8fd
-            "python3 -c \"from rhsm.config import initConfig; print(initConfig().get('rhsm', 'consumerCertDir'))\"",
99f8fd
-            NULL, NULL);
99f8fd
-
99f8fd
-    /* run_in_shell_and_save_output always returns non-NULL */
99f8fd
-    if (result[0] != '/')
99f8fd
-        goto error;
99f8fd
-
99f8fd
-    char *newline = strchrnul(result, '\n');
99f8fd
-    if (!newline)
99f8fd
-        goto error;
99f8fd
-
99f8fd
-    *newline = '\0';
99f8fd
-    return result;
99f8fd
-error:
99f8fd
-    free(result);
99f8fd
-    error_msg("Failed to get 'rhsm':'consumerCertDir' from rhsm.config python module. Using "RHSMCON_PEM_DIR_PATH);
99f8fd
-    return xstrdup(RHSMCON_PEM_DIR_PATH);
99f8fd
-}
99f8fd
-
99f8fd
-static bool
99f8fd
-certificate_exist(char *cert_name)
99f8fd
-{
99f8fd
-    if (access(cert_name, F_OK) != 0)
99f8fd
-    {
99f8fd
-        log_notice("RHSM consumer certificate '%s' does not exist.", cert_name);
99f8fd
-        return false;
99f8fd
-    }
99f8fd
-    return true;
99f8fd
-}
99f8fd
-
99f8fd
-static bool
99f8fd
-cert_authority_cert_exist(char *cert_name)
99f8fd
-{
99f8fd
-    if (access(cert_name, F_OK) != 0)
99f8fd
-    {
99f8fd
-        log_notice("Certs validating the server '%s' does not exist.", cert_name);
99f8fd
-        return false;
99f8fd
-    }
99f8fd
-    return true;
99f8fd
-}
99f8fd
-
99f8fd
 void
99f8fd
 ureport_server_config_set_client_auth(struct ureport_server_config *config,
99f8fd
                                       const char *client_auth)
99f8fd
@@ -139,52 +77,6 @@ ureport_server_config_set_client_auth(struct ureport_server_config *config,
99f8fd
 
99f8fd
         log_notice("Not using client authentication");
99f8fd
     }
99f8fd
-    else if (strcmp(client_auth, "rhsm") == 0)
99f8fd
-    {
99f8fd
-        if (config->ur_url == NULL)
99f8fd
-            ureport_server_config_set_url(config, xstrdup(RHSM_WEB_SERVICE_URL));
99f8fd
-
99f8fd
-        /* always returns non-NULL */
99f8fd
-        char *rhsm_dir = rhsm_config_get_consumer_cert_dir();
99f8fd
-
99f8fd
-        char *cert_full_name = concat_path_file(rhsm_dir, RHSMCON_CERT_NAME);
99f8fd
-        char *key_full_name = concat_path_file(rhsm_dir, RHSMCON_KEY_NAME);
99f8fd
-
99f8fd
-        /* get authority certificate dir path from environment variable, if it
99f8fd
-         * is not set, use CERT_AUTHORITY_CERT_PATH
99f8fd
-         */
99f8fd
-        const char *authority_cert_dir_path = getenv("LIBREPORT_DEBUG_AUTHORITY_CERT_DIR_PATH");
99f8fd
-        if (authority_cert_dir_path == NULL)
99f8fd
-           authority_cert_dir_path = CERT_AUTHORITY_CERT_PATH;
99f8fd
-
99f8fd
-        char *cert_authority_cert_full_name = concat_path_file(authority_cert_dir_path,
99f8fd
-                                                                 CERT_AUTHORITY_CERT_NAME);
99f8fd
-
99f8fd
-        if (certificate_exist(cert_full_name) && certificate_exist(key_full_name))
99f8fd
-        {
99f8fd
-            config->ur_client_cert = cert_full_name;
99f8fd
-            config->ur_client_key = key_full_name;
99f8fd
-            log_debug("Using cert files: '%s' : '%s'", config->ur_client_cert, config->ur_client_key);
99f8fd
-        }
99f8fd
-        else
99f8fd
-        {
99f8fd
-            free(cert_full_name);
99f8fd
-            free(key_full_name);
99f8fd
-            log_notice("Using the default configuration for uReports.");
99f8fd
-        }
99f8fd
-
99f8fd
-        if (cert_authority_cert_exist(cert_authority_cert_full_name))
99f8fd
-        {
99f8fd
-            config->ur_cert_authority_cert = cert_authority_cert_full_name;
99f8fd
-            log_debug("Using validating server cert: '%s'", config->ur_cert_authority_cert);
99f8fd
-        }
99f8fd
-        else
99f8fd
-        {
99f8fd
-            free(cert_authority_cert_full_name);
99f8fd
-        }
99f8fd
-
99f8fd
-        free(rhsm_dir);
99f8fd
-    }
99f8fd
     else if (strcmp(client_auth, "puppet") == 0)
99f8fd
     {
99f8fd
         config->ur_client_cert = puppet_config_print("hostcert");
99f8fd
@@ -241,32 +133,12 @@ ureport_server_config_load_basic_auth(struct ureport_server_config *config,
99f8fd
     const char *username = NULL;
99f8fd
     const char *password = NULL;
99f8fd
 
99f8fd
-    if (strcmp(http_auth_pref, "rhts-credentials") == 0)
99f8fd
-    {
99f8fd
-        settings = new_map_string();
99f8fd
-
99f8fd
-        char *local_conf = xasprintf("%s"USER_HOME_CONFIG_PATH"/rhtsupport.conf", getenv("HOME"));
99f8fd
-
99f8fd
-        if (!load_plugin_conf_file("rhtsupport.conf", settings, /*skip key w/o values:*/ false) &&
99f8fd
-            !load_conf_file(local_conf, settings, /*skip key w/o values:*/ false))
99f8fd
-            error_msg_and_die("Could not get RHTSupport credentials");
99f8fd
-        free(local_conf);
99f8fd
-
99f8fd
-        username = get_map_string_item_or_NULL(settings, "Login");
99f8fd
-        password = get_map_string_item_or_NULL(settings, "Password");
99f8fd
-
99f8fd
-        if (config->ur_url == NULL)
99f8fd
-            ureport_server_config_set_url(config, xstrdup(RHSM_WEB_SERVICE_URL));
99f8fd
-    }
99f8fd
-    else
99f8fd
-    {
99f8fd
-        username = tmp_username = xstrdup(http_auth_pref);
99f8fd
-        password = strchr(tmp_username, ':');
99f8fd
+    username = tmp_username = xstrdup(http_auth_pref);
99f8fd
+    password = strchr(tmp_username, ':');
99f8fd
 
99f8fd
-        if (password != NULL)
99f8fd
-            /* It is "char *", see strchr() few lines above. */
99f8fd
-            *((char *)(password++)) = '\0';
99f8fd
-    }
99f8fd
+    if (password != NULL)
99f8fd
+        /* It is "char *", see strchr() few lines above. */
99f8fd
+        *((char *)(password++)) = '\0';
99f8fd
 
99f8fd
     if (password == NULL)
99f8fd
     {
99f8fd
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
99f8fd
index b228602..f73e7dc 100644
99f8fd
--- a/src/plugins/Makefile.am
99f8fd
+++ b/src/plugins/Makefile.am
99f8fd
@@ -28,12 +28,6 @@ pluginsconfdir = $(PLUGINS_CONF_DIR)
99f8fd
 
99f8fd
 reportpluginsconfdir = $(REPORT_PLUGINS_CONF_DIR)
99f8fd
 
99f8fd
-if ENABLE_IMPORT_RHTSUPPORT_CERT
99f8fd
-libreportconfdir = $(CONF_DIR)
99f8fd
-dist_libreportconf_DATA = \
99f8fd
-    cert-api.access.redhat.com.pem
99f8fd
-endif
99f8fd
-
99f8fd
 reporters_plugin_conf =
99f8fd
 reporters_plugin_format_conf =
99f8fd
 if BUILD_BUGZILLA
99f8fd
diff --git a/src/plugins/cert-api.access.redhat.com.pem b/src/plugins/cert-api.access.redhat.com.pem
99f8fd
deleted file mode 100644
99f8fd
index 20ef8c0..0000000
99f8fd
--- a/src/plugins/cert-api.access.redhat.com.pem
99f8fd
+++ /dev/null
99f8fd
@@ -1,74 +0,0 @@
99f8fd
------BEGIN CERTIFICATE-----
99f8fd
-MIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD
99f8fd
-VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp
99f8fd
-Z2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0
99f8fd
-d29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN
99f8fd
-AQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw
99f8fd
-MzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAV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ED6y7muQNRmgDpA5PcbvO
99f8fd
-gl7OexNL4zcpyfMdAmTYf5yTRSvB42Yg5hVfuzPEnOIqupwES3mWkEHRlqbMUkHw
99f8fd
-qIQAxIwQqZd5PdPpElQ/6j/ZT9DwW/I6zgndX2rsS0oGYcwFTkSj0/rKKkC13hk7
99f8fd
-LchXMZu5ckdustM79U6OZIBairrJaL2OpR08un2nwIjgEGqhVFYc44UK1VpkE8mr
99f8fd
-qvqJS6OHVlTlKcEDnhVkPS3i5qjuS/PtSq0CwH8bzYKFJayLDY/z36Zv6PdttzmU
99f8fd
-Yb1NSDcJejHJ80pMINutyYQ=
99f8fd
------END CERTIFICATE-----
99f8fd
diff --git a/src/plugins/report_RHTSupport.xml.in b/src/plugins/report_RHTSupport.xml.in
99f8fd
index 357a94d..c64cb55 100644
99f8fd
--- a/src/plugins/report_RHTSupport.xml.in
99f8fd
+++ b/src/plugins/report_RHTSupport.xml.in
99f8fd
@@ -26,11 +26,6 @@
99f8fd
             <allow-empty>no</allow-empty>
99f8fd
         </option>
99f8fd
         <advanced-options>
99f8fd
-            <option type="bool" name="RHTSupport_SubmitUReport">
99f8fd
-                <_label>Submit uReport</_label>
99f8fd
-                <_note-html>Submit <a href="https://access.redhat.com/articles/642323">micro-report</a> when creating a new case. </_note-html>
99f8fd
-                <default-value>yes</default-value>
99f8fd
-            </option>
99f8fd
             <option type="text" name="RHTSupport_URL">
99f8fd
                 <_label>RH Portal URL</_label>
99f8fd
                 <allow-empty>no</allow-empty>
99f8fd
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
99f8fd
index d11b4bd..411bffc 100644
99f8fd
--- a/src/plugins/reporter-rhtsupport.c
99f8fd
+++ b/src/plugins/reporter-rhtsupport.c
99f8fd
@@ -222,96 +222,6 @@ ret_clean:
99f8fd
     return retval;
99f8fd
 }
99f8fd
 
99f8fd
-static
99f8fd
-struct ureport_server_response *ureport_do_post_credentials(const char *json, struct ureport_server_config *config, const char *action)
99f8fd
-{
99f8fd
-    struct post_state *post_state = NULL;
99f8fd
-    while (1)
99f8fd
-    {
99f8fd
-        post_state = ureport_do_post(json, config, action);
99f8fd
-
99f8fd
-        if (post_state == NULL)
99f8fd
-        {
99f8fd
-            error_msg(_("Failed on submitting the problem"));
99f8fd
-            return NULL;
99f8fd
-        }
99f8fd
-
99f8fd
-        if (post_state->http_resp_code != 401)
99f8fd
-            break;
99f8fd
-
99f8fd
-        free_post_state(post_state);
99f8fd
-
99f8fd
-        char *login = NULL;
99f8fd
-        char *password = NULL;
99f8fd
-        ask_rh_credentials(&login, &password);
99f8fd
-        ureport_server_config_set_basic_auth(config, login, password);
99f8fd
-        free(password);
99f8fd
-        free(login);
99f8fd
-    }
99f8fd
-
99f8fd
-    struct ureport_server_response *resp = ureport_server_response_from_reply(post_state, config);
99f8fd
-    free(post_state);
99f8fd
-    return resp;
99f8fd
-}
99f8fd
-
99f8fd
-static
99f8fd
-char *submit_ureport(const char *dump_dir_name, struct ureport_server_config *conf)
99f8fd
-{
99f8fd
-    struct dump_dir *dd = dd_opendir(dump_dir_name, DD_OPEN_READONLY);
99f8fd
-    if (dd == NULL)
99f8fd
-        return NULL;
99f8fd
-
99f8fd
-    report_result_t *rr_bthash = find_in_reported_to(dd, "uReport");
99f8fd
-    dd_close(dd);
99f8fd
-
99f8fd
-    if (rr_bthash != NULL)
99f8fd
-    {
99f8fd
-        log_notice("uReport has already been submitted.");
99f8fd
-        char *ret = xstrdup(rr_bthash->bthash);
99f8fd
-        free_report_result(rr_bthash);
99f8fd
-        return ret;
99f8fd
-    }
99f8fd
-
99f8fd
-    char *json = ureport_from_dump_dir(dump_dir_name);
99f8fd
-    if (json == NULL)
99f8fd
-    {
99f8fd
-        log_notice(_("Failed to generate microreport from the problem data"));
99f8fd
-        return NULL;
99f8fd
-    }
99f8fd
-
99f8fd
-    struct ureport_server_response *resp = ureport_do_post_credentials(json, conf, UREPORT_SUBMIT_ACTION);
99f8fd
-    free(json);
99f8fd
-    if (resp == NULL)
99f8fd
-        return NULL;
99f8fd
-
99f8fd
-    char *bthash = NULL;
99f8fd
-    if (!resp->urr_is_error)
99f8fd
-    {
99f8fd
-        if (resp->urr_bthash != NULL)
99f8fd
-            bthash = xstrdup(resp->urr_bthash);
99f8fd
-
99f8fd
-        ureport_server_response_save_in_dump_dir(resp, dump_dir_name, conf);
99f8fd
-
99f8fd
-        if (resp->urr_message)
99f8fd
-            log_warning("%s", resp->urr_message);
99f8fd
-    }
99f8fd
-    else if (g_verbose > 2)
99f8fd
-        error_msg(_("Server responded with an error: '%s'"), resp->urr_value);
99f8fd
-
99f8fd
-    ureport_server_response_free(resp);
99f8fd
-    return bthash;
99f8fd
-}
99f8fd
-
99f8fd
-static
99f8fd
-void attach_to_ureport(struct ureport_server_config *conf,
99f8fd
-        const char *bthash, const char *attach_id, const char *data)
99f8fd
-{
99f8fd
-    char *json = ureport_json_attachment_new(bthash, attach_id, data);
99f8fd
-    struct ureport_server_response *resp = ureport_do_post_credentials(json, conf, UREPORT_ATTACH_ACTION);
99f8fd
-    ureport_server_response_free(resp);
99f8fd
-    free(json);
99f8fd
-}
99f8fd
-
99f8fd
 static
99f8fd
 bool check_for_hints(const char *url, char **login, char **password, bool ssl_verify, const char *tempfile)
99f8fd
 {
99f8fd
@@ -420,42 +330,6 @@ char *get_param_string(const char *name, map_string_t *settings, const char *dfl
99f8fd
     return xstrdup(envvar ? envvar : (get_map_string_item_or_NULL(settings, name) ? : dflt));
99f8fd
 }
99f8fd
 
99f8fd
-static
99f8fd
-void prepare_ureport_configuration(const char *urcfile,
99f8fd
-        map_string_t *settings, struct ureport_server_config *urconf,
99f8fd
-        const char *portal_url, const char *login, const char *password, bool ssl_verify)
99f8fd
-{
99f8fd
-    load_conf_file(urcfile, settings, false);
99f8fd
-    ureport_server_config_init(urconf);
99f8fd
-
99f8fd
-    /* The following lines cause that we always use URL from ureport's
99f8fd
-     * configuration becuase the GUI reporter always exports uReport_URL env
99f8fd
-     * var.
99f8fd
-     *
99f8fd
-     *   char *url = NULL;
99f8fd
-     *   UREPORT_OPTION_VALUE_FROM_CONF(settings, "URL", url, xstrdup);
99f8fd
-     *   if (url != NULL)
99f8fd
-     *       ureport_server_config_set_url(urconf, url);
99f8fd
-     */
99f8fd
-
99f8fd
-    ureport_server_config_set_url(urconf, concat_path_file(portal_url, "/telemetry/abrt"));
99f8fd
-    urconf->ur_ssl_verify = ssl_verify;
99f8fd
-
99f8fd
-    ureport_server_config_set_basic_auth(urconf, login, password);
99f8fd
-
99f8fd
-    bool include_auth = true;
99f8fd
-    UREPORT_OPTION_VALUE_FROM_CONF(settings, "IncludeAuthData", include_auth, string_to_bool);
99f8fd
-
99f8fd
-    if (include_auth)
99f8fd
-    {
99f8fd
-        const char *auth_items = NULL;
99f8fd
-        UREPORT_OPTION_VALUE_FROM_CONF(settings, "AuthDataItems", auth_items, (const char *));
99f8fd
-        urconf->ur_prefs.urp_auth_items = parse_list(auth_items);
99f8fd
-    }
99f8fd
-
99f8fd
-    urconf->ur_prefs.urp_flags |= UREPORT_PREF_FLAG_RETURN_ON_FAILURE;
99f8fd
-}
99f8fd
-
99f8fd
 static char *create_case_url(char *url, const char *case_no)
99f8fd
 {
99f8fd
     char *url1 = concat_path_file(url, RHTSUPPORT_CASE_URL_PATH);
99f8fd
@@ -496,7 +370,6 @@ int main(int argc, char **argv)
99f8fd
     const char *dump_dir_name = ".";
99f8fd
     const char *case_no = NULL;
99f8fd
     GList *conf_file = NULL;
99f8fd
-    const char *urconf_file = UREPORT_CONF_FILE_PATH;
99f8fd
     const char *fmt_file = NULL;
99f8fd
 
99f8fd
     /* Can't keep these strings/structs static: _() doesn't support that */
99f8fd
@@ -524,10 +397,6 @@ int main(int argc, char **argv)
99f8fd
         "\n"
99f8fd
         "Option -tCASE uploads FILEs to the case CASE on RHTSupport site.\n"
99f8fd
         "-d DIR is ignored.\n"
99f8fd
-        "\n"
99f8fd
-        "Option -u sends ABRT crash statistics data (uReport) before creating a new case.\n"
99f8fd
-        "uReport configuration is loaded from UR_CONFFILE which defaults to\n"
99f8fd
-        UREPORT_CONF_FILE_PATH".\n"
99f8fd
     );
99f8fd
     enum {
99f8fd
         OPT_v = 1 << 0,
99f8fd
@@ -547,8 +416,6 @@ int main(int argc, char **argv)
99f8fd
         OPT_LIST(     'c', NULL, &conf_file    , "FILE", _("Configuration file (may be given many times)")),
99f8fd
         OPT_OPTSTRING('t', NULL, &case_no      , "ID"  , _("Upload FILEs [to case with this ID]")),
99f8fd
         OPT_BOOL(     'f', NULL, NULL          ,         _("Force reporting even if this problem is already reported")),
99f8fd
-        OPT_BOOL(     'u', NULL, NULL          ,         _("Submit uReport before creating a new case")),
99f8fd
-        OPT_STRING(   'C', NULL, &urconf_file  , "FILE", _("Configuration file for uReport")),
99f8fd
         OPT_STRING(   'F', NULL, &fmt_file     , "FILE", _("Formatting file for a new case")),
99f8fd
         OPT_BOOL(     'D', NULL, NULL          ,         _("Debug")),
99f8fd
         OPT_END()
99f8fd
@@ -607,22 +474,10 @@ int main(int argc, char **argv)
99f8fd
                 /* RH has a 250m limit for web attachments (as of 2013) */
99f8fd
                 envvar ? envvar : (get_map_string_item_or_NULL(settings, "BigSizeMB") ? : "200")
99f8fd
     );
99f8fd
-    envvar = getenv("RHTSupport_SubmitUReport");
99f8fd
-    bool submit_ur = string_to_bool(
99f8fd
-                envvar ? envvar :
99f8fd
-                    (get_map_string_item_or_NULL(settings, "SubmitUReport") ? :
99f8fd
-                        ((opts & OPT_u) ? "1" : "0"))
99f8fd
-    );
99f8fd
+
99f8fd
     free_map_string(settings);
99f8fd
 
99f8fd
     char *base_api_url = xstrdup(url);
99f8fd
-    char *bthash = NULL;
99f8fd
-
99f8fd
-    map_string_t *ursettings = new_map_string();
99f8fd
-    struct ureport_server_config urconf;
99f8fd
-
99f8fd
-    prepare_ureport_configuration(urconf_file, ursettings, &urconf,
99f8fd
-            url, login, password, ssl_verify);
99f8fd
 
99f8fd
     if (opts & OPT_t)
99f8fd
     {
99f8fd
@@ -697,17 +552,6 @@ int main(int argc, char **argv)
99f8fd
                 return 0;
99f8fd
         }
99f8fd
         free_report_result(reported_to);
99f8fd
-
99f8fd
-        if (submit_ur)
99f8fd
-        {
99f8fd
-            log_warning(_("Sending ABRT crash statistics data"));
99f8fd
-
99f8fd
-            bthash = submit_ureport(dump_dir_name, &urconf);
99f8fd
-
99f8fd
-            /* Ensure that we will use the updated credentials */
99f8fd
-            STRCPY_IF_NOT_EQUAL(login, urconf.ur_username);
99f8fd
-            STRCPY_IF_NOT_EQUAL(password, urconf.ur_password);
99f8fd
-        }
99f8fd
     }
99f8fd
 
99f8fd
     problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name);
99f8fd
@@ -930,30 +774,6 @@ int main(int argc, char **argv)
99f8fd
         }
99f8fd
         /* else: error msg was already emitted by dd_opendir */
99f8fd
 
99f8fd
-        if (bthash)
99f8fd
-        {
99f8fd
-            log_warning(_("Linking ABRT crash statistics record with the case"));
99f8fd
-
99f8fd
-            /* Make sure we use the current credentials */
99f8fd
-            ureport_server_config_set_basic_auth(&urconf, login, password);
99f8fd
-
99f8fd
-            /* Attach Customer Case ID*/
99f8fd
-            attach_to_ureport(&urconf, bthash, "RHCID", result->url);
99f8fd
-
99f8fd
-            /* Attach Contact e-mail if configured */
99f8fd
-            const char *email = NULL;
99f8fd
-            UREPORT_OPTION_VALUE_FROM_CONF(ursettings, "ContactEmail", email, (const char *));
99f8fd
-            if (email != NULL)
99f8fd
-            {
99f8fd
-                log_warning(_("Linking ABRT crash statistics record with contact email: '%s'"), email);
99f8fd
-                attach_to_ureport(&urconf, bthash, "email", email);
99f8fd
-            }
99f8fd
-
99f8fd
-            /* Update the credentials */
99f8fd
-            STRCPY_IF_NOT_EQUAL(login, urconf.ur_username);
99f8fd
-            STRCPY_IF_NOT_EQUAL(password, urconf.ur_password);
99f8fd
-        }
99f8fd
-
99f8fd
         url = result->url;
99f8fd
         result->url = NULL;
99f8fd
         free_rhts_result(result);
99f8fd
@@ -1021,10 +841,6 @@ int main(int argc, char **argv)
99f8fd
     free_rhts_result(result_atch);
99f8fd
     free_rhts_result(result);
99f8fd
 
99f8fd
-    ureport_server_config_destroy(&urconf);
99f8fd
-    free_map_string(ursettings);
99f8fd
-    free(bthash);
99f8fd
-
99f8fd
     free(base_api_url);
99f8fd
     free(url);
99f8fd
     free(login);
99f8fd
diff --git a/src/plugins/ureport.conf b/src/plugins/ureport.conf
99f8fd
index 04dc100..11f4531 100644
99f8fd
--- a/src/plugins/ureport.conf
99f8fd
+++ b/src/plugins/ureport.conf
99f8fd
@@ -22,8 +22,6 @@
99f8fd
 # 'IncludeAuthData' to 'yes'.
99f8fd
 # None (default):
99f8fd
 # SSLClientAuth =
99f8fd
-# Using RH subscription management consumer certificate:
99f8fd
-# SSLClientAuth = rhsm
99f8fd
 # Using Puppet certificate:
99f8fd
 # SSLClientAuth = puppet
99f8fd
 # Using custom certificate:
99f8fd
@@ -32,8 +30,6 @@
99f8fd
 # HTTP Basic authentication credentials.
99f8fd
 # Assingning any value to 'HTTPAuth' changes the default value of
99f8fd
 # 'IncludeAuthData' to 'yes'.
99f8fd
-# Use Login= and Password= from /etc/libreport/plugins/rhtsupport.conf:
99f8fd
-# HTTPAuth = rhts-credentials
99f8fd
 # Use username and password:
99f8fd
 # HTTPAuth = username:password
99f8fd
 
99f8fd
diff --git a/tests/ureport.at b/tests/ureport.at
99f8fd
index ecaa3dd..51ca0c2 100644
99f8fd
--- a/tests/ureport.at
99f8fd
+++ b/tests/ureport.at
99f8fd
@@ -250,73 +250,6 @@ int main(void)
99f8fd
     ureport_server_config_destroy(&config);
99f8fd
     free_map_string(settings);
99f8fd
 
99f8fd
-    /* value from env */
99f8fd
-    /* HTTPAuth set to 'username:password' */
99f8fd
-    /* SSLClientAuth set to 'rhsm' */
99f8fd
-    ureport_server_config_init(&config);
99f8fd
-
99f8fd
-    settings = new_map_string();
99f8fd
-
99f8fd
-    setenv("uReport_SSLClientAuth", "rhsm", 1);
99f8fd
-    setenv("uReport_HTTPAuth", "username:password", 1);
99f8fd
-    setenv("uReport_AuthDataItems", "hostname, time", 1);
99f8fd
-
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_CORRECT_DIR_PATH, 1);
99f8fd
-
99f8fd
-    ureport_server_config_load(&config, settings);
99f8fd
-
99f8fd
-    assert(strcmp(config.ur_username, "username") == 0);
99f8fd
-    assert(strcmp(config.ur_password, "password") == 0);
99f8fd
-
99f8fd
-    assert(config.ur_client_cert == NULL);
99f8fd
-    assert(config.ur_client_key == NULL);
99f8fd
-    assert(size_map_string(config.ur_http_headers) == 0);
99f8fd
-
99f8fd
-    l = config.ur_prefs.urp_auth_items;
99f8fd
-    assert(strcmp(l->data, "hostname") == 0);
99f8fd
-    assert(strcmp(l->next->data, "time") == 0);
99f8fd
-
99f8fd
-    unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
99f8fd
-
99f8fd
-    unsetenv("uReport_SSLClientAuth");
99f8fd
-    unsetenv("uReport_HTTPAuth");
99f8fd
-    unsetenv("uReport_AuthDataItems");
99f8fd
-
99f8fd
-    free_map_string(settings);
99f8fd
-
99f8fd
-    ureport_server_config_destroy(&config);
99f8fd
-
99f8fd
-    /* value from settings */
99f8fd
-    /* HTTPAuth set to 'username:password' */
99f8fd
-    /* SSLClientAuth set to 'rhsm' */
99f8fd
-    ureport_server_config_init(&config);
99f8fd
-
99f8fd
-    settings = new_map_string();
99f8fd
-    insert_map_string(settings, xstrdup("SSLClientAuth"), xstrdup("rhsm"));
99f8fd
-    insert_map_string(settings, xstrdup("HTTPAuth"), xstrdup("rhn-username:rhn-password"));
99f8fd
-    insert_map_string(settings, xstrdup("AuthDataItems"), xstrdup("hostname, type"));
99f8fd
-
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_CORRECT_DIR_PATH, 1);
99f8fd
-
99f8fd
-    ureport_server_config_load(&config, settings);
99f8fd
-
99f8fd
-    assert(strcmp(config.ur_username, "rhn-username") == 0);
99f8fd
-    assert(strcmp(config.ur_password, "rhn-password") == 0);
99f8fd
-
99f8fd
-    assert(config.ur_client_cert == NULL);
99f8fd
-    assert(config.ur_client_key == NULL);
99f8fd
-    assert(size_map_string(config.ur_http_headers) == 0);
99f8fd
-
99f8fd
-    l = config.ur_prefs.urp_auth_items;
99f8fd
-    assert(strcmp(l->data, "hostname") == 0);
99f8fd
-    assert(strcmp(l->next->data, "type") == 0);
99f8fd
-
99f8fd
-    unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
99f8fd
-
99f8fd
-    free_map_string(settings);
99f8fd
-
99f8fd
-    ureport_server_config_destroy(&config);
99f8fd
-
99f8fd
     return 0;
99f8fd
 }
99f8fd
 ]])
99f8fd
@@ -366,7 +299,6 @@ AT_TESTFUN([ureport_server_config_set_client_auth],
99f8fd
 #include <assert.h>
99f8fd
 
99f8fd
 #define DESTROYED_POINTER (void *)0xdeadbeef
99f8fd
-#define RHSM_WEB_SERVICE_URL "https://cert-api.access.redhat.com/rs/telemetry/abrt"
99f8fd
 
99f8fd
 #define TESTING_CERTS_CORRECT_DIR_PATH "../../ureport/certs/correct"
99f8fd
 #define TESTING_CERTS_INCORRECT_ONLY_CERT_DIR_PATH "../../ureport/certs/only_cert"
99f8fd
@@ -374,10 +306,6 @@ AT_TESTFUN([ureport_server_config_set_client_auth],
99f8fd
 #define TESTING_PYTHONPATH "../../ureport/"
99f8fd
 #define WRONG_TESTING_PYTHONPATH "../../ureportxxxxxx/"
99f8fd
 
99f8fd
-#define RHSMCON_PEM_DIR_PATH "/etc/pki/consumer"
99f8fd
-#define RHSMCON_CERT_NAME "cert.pem"
99f8fd
-#define RHSMCON_KEY_NAME "key.pem"
99f8fd
-
99f8fd
 char *my_strdup(const char *str)
99f8fd
 {
99f8fd
     if (str == NULL)
99f8fd
@@ -500,52 +428,6 @@ int main(void)
99f8fd
 
99f8fd
     ureport_server_config_destroy(&config);
99f8fd
 
99f8fd
-    /* client_auth == rhsm */
99f8fd
-    /* ur_url == NULL */
99f8fd
-    /* no certs */
99f8fd
-    char *empty_cert_dir = mkdtemp(strdup("/tmp/cert_XXXXXX"));
99f8fd
-    assert(empty_cert_dir);
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", empty_cert_dir, 1);
99f8fd
-
99f8fd
-    int status = test_ureport_server_config_set_client_auth_exit_code_ext(&config, "rhsm", NULL, NULL);
99f8fd
-    assert(status == 0);
99f8fd
-
99f8fd
-    assert(rmdir(empty_cert_dir) == 0);
99f8fd
-
99f8fd
-    /* client_auth == rhsm */
99f8fd
-    /* ur_url == NULL */
99f8fd
-    /* certs exists (only RHSMCON_CERT_NAME exists) */
99f8fd
-
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_INCORRECT_ONLY_CERT_DIR_PATH, 1);
99f8fd
-
99f8fd
-    status = test_ureport_server_config_set_client_auth_exit_code_ext(&config, "rhsm", NULL, NULL);
99f8fd
-    assert(status == 0);
99f8fd
-
99f8fd
-    /* client_auth == rhsm */
99f8fd
-    /* ur_url == NULL */
99f8fd
-    /* certs exists (only RHSMCON_KEY_NAME exists) */
99f8fd
-
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_INCORRECT_ONLY_KEY_DIR_PATH, 1);
99f8fd
-
99f8fd
-    status = test_ureport_server_config_set_client_auth_exit_code_ext(&config, "rhsm", NULL, NULL);
99f8fd
-    assert(status == 0);
99f8fd
-
99f8fd
-    /* client_auth == rhsm */
99f8fd
-    /* ur_url == NULL */
99f8fd
-    /* certs exists (correct) */
99f8fd
-    ureport_server_config_init(&config);
99f8fd
-
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_CORRECT_DIR_PATH, 1);
99f8fd
-
99f8fd
-    ureport_server_config_set_client_auth(&config, "rhsm");
99f8fd
-
99f8fd
-    assert_ureport_server_config(&config, RHSM_WEB_SERVICE_URL, true,
99f8fd
-                                TESTING_CERTS_CORRECT_DIR_PATH"/cert.pem",
99f8fd
-                                TESTING_CERTS_CORRECT_DIR_PATH"/key.pem",
99f8fd
-                                NULL, NULL);
99f8fd
-
99f8fd
-    ureport_server_config_destroy(&config);
99f8fd
-
99f8fd
     /* client_auth == cert:key */
99f8fd
     /* ur_url == NULL */
99f8fd
     ureport_server_config_init(&config);
99f8fd
@@ -572,44 +454,6 @@ int main(void)
99f8fd
     ret_val = test_ureport_server_config_set_client_auth_exit_code(&config, "cert");
99f8fd
     assert(ret_val != 0 && ret_val != -1);
99f8fd
 
99f8fd
-/* rhsm_config_get_consumer_cert_dir */
99f8fd
-/* certs exists (correct content) */
99f8fd
-    unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
99f8fd
-    setenv("PYTHONPATH", TESTING_PYTHONPATH, 1);
99f8fd
-
99f8fd
-    ureport_server_config_init(&config);
99f8fd
-    ureport_server_config_set_client_auth(&config, "rhsm");
99f8fd
-
99f8fd
-    char *abs_path_cert = realpath(TESTING_CERTS_CORRECT_DIR_PATH"/cert.pem", NULL);
99f8fd
-    char *abs_path_key = realpath(TESTING_CERTS_CORRECT_DIR_PATH"/key.pem", NULL);
99f8fd
-
99f8fd
-    assert_ureport_server_config(&config, RHSM_WEB_SERVICE_URL, true,
99f8fd
-                                abs_path_cert,
99f8fd
-                                abs_path_key,
99f8fd
-                                NULL, NULL);
99f8fd
-    free(abs_path_cert);
99f8fd
-    free(abs_path_key);
99f8fd
-
99f8fd
-    ureport_server_config_destroy(&config);
99f8fd
-
99f8fd
-    /* python script fails, '/etc/pki/consumer' is returned  */
99f8fd
-
99f8fd
-    /* set cert dir path to '/etc/pki/consumer' */
99f8fd
-    /* store return value of ureport_server_config_set_client_auth */
99f8fd
-    setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", RHSMCON_PEM_DIR_PATH, 1);
99f8fd
-
99f8fd
-    int exp_ret_val = test_ureport_server_config_set_client_auth_exit_code(&config, "rhsm");
99f8fd
-
99f8fd
-    /* Do the same with unset LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH and wrong PYTHONPATH */
99f8fd
-    /* function rhsm_config_get_consumer_cert_dir has to return RHSMCON_PEM_DIR_PATH */
99f8fd
-    unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
99f8fd
-    setenv("PYTHONPATH", WRONG_TESTING_PYTHONPATH, 1);
99f8fd
-
99f8fd
-    int rec_ret_val = test_ureport_server_config_set_client_auth_exit_code(&config, "rhsm");
99f8fd
-
99f8fd
-    /* we expect the same return value */
99f8fd
-//    assert(exp_ret_val == rec_ret_val);
99f8fd
-
99f8fd
     return 0;
99f8fd
 }
99f8fd
 ]])
99f8fd
@@ -1208,8 +1052,6 @@ AT_TESTFUN([ureport_server_config_load_basic_auth],
99f8fd
 #include "libreport_curl.h"
99f8fd
 #include "problem_data.h"
99f8fd
 
99f8fd
-#define RHSM_WEB_SERVICE_URL "https://cert-api.access.redhat.com/rs/telemetry/abrt"
99f8fd
-
99f8fd
 int main(void)
99f8fd
 {
99f8fd
     g_verbose=3;
99f8fd
@@ -1226,22 +1068,6 @@ int main(void)
99f8fd
         ureport_server_config_destroy(&config);
99f8fd
     }
99f8fd
 
99f8fd
-    {
99f8fd
-        struct ureport_server_config config;
99f8fd
-        ureport_server_config_init(&config);
99f8fd
-
99f8fd
-        setenv("LIBREPORT_DEBUG_PLUGINS_CONF_DIR", "../../ureport-rhts-credentials/", 1);
99f8fd
-
99f8fd
-        ureport_server_config_load_basic_auth(&config, "rhts-credentials");
99f8fd
-
99f8fd
-        assert(strcmp(config.ur_username, "rhn-user-name") == 0);
99f8fd
-        assert(strcmp(config.ur_password, "rhn-password") == 0);
99f8fd
-        assert(strcmp(config.ur_url, RHSM_WEB_SERVICE_URL) == 0);
99f8fd
-
99f8fd
-        unsetenv("LIBREPORT_DEBUG_PLUGINS_CONF_DIR");
99f8fd
-        ureport_server_config_destroy(&config);
99f8fd
-    }
99f8fd
-
99f8fd
     {
99f8fd
         pid_t pid = fork();
99f8fd
         if (pid < 0)
99f8fd
diff --git a/tests/ureport/rhsm/__init__.py b/tests/ureport/rhsm/__init__.py
99f8fd
deleted file mode 100644
99f8fd
index e69de29..0000000
99f8fd
diff --git a/tests/ureport/rhsm/config.py b/tests/ureport/rhsm/config.py
99f8fd
deleted file mode 100644
99f8fd
index 44483d8..0000000
99f8fd
--- a/tests/ureport/rhsm/config.py
99f8fd
+++ /dev/null
99f8fd
@@ -1,8 +0,0 @@
99f8fd
-import os
99f8fd
-
99f8fd
-def initConfig():
99f8fd
-    return myConfig()
99f8fd
-
99f8fd
-class myConfig():
99f8fd
-    def get(self, key, value):
99f8fd
-        return os.path.abspath("../../ureport/certs/correct")