Пример #1
0
    def __init__(self):
        super(SaveReports, self).__init__()

        basedir_keys = ["ureport.directory", "report.spooldirectory"]
        self.basedir = None
        self.create_components = None
        self.load_config_to_self("basedir", basedir_keys, "/var/spool/faf/")

        self.load_config_to_self("create_components",
                                 ["ureport.createcomponents"],
                                 False, callback=str2bool)

        # Instance of 'SaveReports' has no 'basedir' member
        # pylint: disable-msg=E1101

        self.dir_report = paths["reports"]
        self.dir_report_incoming = paths["reports_incoming"]
        self.dir_report_saved = paths["reports_saved"]
        self.dir_report_deferred = paths["reports_deferred"]

        self.dir_attach = paths["attachments"]
        self.dir_attach_incoming = paths["attachments_incoming"]
        self.dir_attach_saved = paths["attachments_saved"]
        self.dir_attach_deferred = paths["attachments_deferred"]

        try:
            ensure_dirs([self.dir_report_incoming, self.dir_report_saved,
                         self.dir_report_deferred, self.dir_attach_incoming,
                         self.dir_attach_saved, self.dir_attach_deferred])
        except FafError as ex:
            self.log_error("Required directories can't be created: {0}"
                           .format(str(ex)))
            raise
Пример #2
0
 def setUp(self):
     super(ActionsTestCase, self).setUp()
     self.basic_fixtures()
     ensure_dirs([paths["reports_incoming"]])
     ensure_dirs([paths["reports_saved"]])
     ensure_dirs([paths["reports_deferred"]])
     ensure_dirs([paths["attachments_incoming"]])
     sample_report_names = ("ureport1", "ureport_core", "ureport_python",
                            "ureport_kerneloops", "ureport_java",
                            "ureport_ruby", "ureport_kerneloops_nouveau")
     sample_reports = {}
     i = 0
     for report_name in sample_report_names:
         i += 1
         report_filename = os.path.join(faftests.cpath, "..",
                                        "sample_reports", report_name)
         for j in range(i):
             shutil.copy(
                 report_filename,
                 os.path.join(paths["reports_incoming"],
                              "{0}_{1}".format(report_name, j)))
         with open(report_filename, "r") as file:
             sample_reports[report_name] = ureport2(json.load(file))
             sample_reports[report_name]["test_count"] = i
     self.sample_reports = sample_reports
Пример #3
0
 def setUp(self):
     super(ReportTestCase, self).setUp()
     self.basic_fixtures()
     self.db.session.commit()
     ensure_dirs([paths["reports_incoming"]])
     ensure_dirs([paths["reports_saved"]])
     ensure_dirs([paths["reports_deferred"]])
     ensure_dirs([paths["attachments_incoming"]])
Пример #4
0
 def setUp(self):
     super(ReportTestCase, self).setUp()
     self.basic_fixtures()
     self.db.session.commit()
     ensure_dirs([paths["reports_incoming"]])
     ensure_dirs([paths["reports_saved"]])
     ensure_dirs([paths["reports_deferred"]])
     ensure_dirs([paths["attachments_incoming"]])
Пример #5
0
    def __init__(self):
        super(PullReports, self).__init__()

        self.load_config_to_self("master", ["pullreports.master"],
                                 "https://retrace.fedoraproject.org/faf")
        self.load_config_to_self("basedir", ["ureport.directory"],
                                 "/var/spool/faf")

        self.known_file = os.path.join(self.basedir, "reports",
                                       PullReports.KNOWN_FILE_NAME)
        self._load_known()

        self.incoming_dir = os.path.join(self.basedir, "reports", "incoming")
        try:
            ensure_dirs([self.incoming_dir])
        except FafError as ex:
            self.log_error("Required directories can't be created")
            raise
Пример #6
0
    def __init__(self):
        super(PullReports, self).__init__()

        self.load_config_to_self("master", ["pullreports.master"],
                                 "https://retrace.fedoraproject.org/faf")
        self.load_config_to_self("basedir", ["ureport.directory"],
                                 "/var/spool/faf")

        self.known_file = os.path.join(self.basedir, "reports",
                                       PullReports.KNOWN_FILE_NAME)
        self._load_known()

        self.incoming_dir = os.path.join(self.basedir, "reports", "incoming")
        try:
            ensure_dirs([self.incoming_dir])
        except FafError as ex:
            self.log_error("Required directories can't be created")
            raise
Пример #7
0
    def __init__(self):
        super(ArchiveReports, self).__init__()

        basedir_keys = ["ureport.directory", "report.spooldirectory"]
        self.basedir = None
        self.load_config_to_self("basedir", basedir_keys, "/var/spool/faf/")

        # Instance of 'ArchiveReports' has no 'basedir' member
        # pylint: disable-msg=E1101

        self.dir_report = os.path.join(self.basedir,
                                       ArchiveReports.dirname_reports)
        self.dir_report_incoming = os.path.join(
            self.dir_report, ArchiveReports.dirname_incoming)
        self.dir_report_saved = os.path.join(self.dir_report,
                                             ArchiveReports.dirname_saved)
        self.dir_report_deferred = os.path.join(
            self.dir_report, ArchiveReports.dirname_deferred)
        self.dir_report_archive = os.path.join(self.dir_report,
                                               ArchiveReports.dirname_archive)

        self.dir_attach = os.path.join(self.basedir,
                                       ArchiveReports.dirname_attachments)
        self.dir_attach_incoming = os.path.join(
            self.dir_attach, ArchiveReports.dirname_incoming)
        self.dir_attach_saved = os.path.join(self.dir_attach,
                                             ArchiveReports.dirname_saved)
        self.dir_attach_deferred = os.path.join(
            self.dir_attach, ArchiveReports.dirname_deferred)
        self.dir_attach_archive = os.path.join(self.dir_attach,
                                               ArchiveReports.dirname_archive)

        try:
            ensure_dirs([
                self.dir_report_incoming, self.dir_report_saved,
                self.dir_report_deferred, self.dir_report_archive,
                self.dir_attach_incoming, self.dir_attach_saved,
                self.dir_attach_deferred, self.dir_attach_archive
            ])
        except FafError as ex:
            self.log_error("Required directories can't be created: {0}".format(
                str(ex)))
            raise
Пример #8
0
    def __init__(self):
        super(ArchiveReports, self).__init__()

        basedir_keys = ["ureport.directory", "report.spooldirectory"]
        self.basedir = None
        self.load_config_to_self("basedir", basedir_keys, "/var/spool/faf/")

        # Instance of 'ArchiveReports' has no 'basedir' member
        # pylint: disable-msg=E1101

        self.dir_report = os.path.join(self.basedir,
                                       ArchiveReports.dirname_reports)
        self.dir_report_incoming = os.path.join(self.dir_report,
                                                ArchiveReports.dirname_incoming)
        self.dir_report_saved = os.path.join(self.dir_report,
                                             ArchiveReports.dirname_saved)
        self.dir_report_deferred = os.path.join(self.dir_report,
                                                ArchiveReports.dirname_deferred)
        self.dir_report_archive = os.path.join(self.dir_report,
                                               ArchiveReports.dirname_archive)

        self.dir_attach = os.path.join(self.basedir,
                                       ArchiveReports.dirname_attachments)
        self.dir_attach_incoming = os.path.join(self.dir_attach,
                                                ArchiveReports.dirname_incoming)
        self.dir_attach_saved = os.path.join(self.dir_attach,
                                             ArchiveReports.dirname_saved)
        self.dir_attach_deferred = os.path.join(self.dir_attach,
                                                ArchiveReports.dirname_deferred)
        self.dir_attach_archive = os.path.join(self.dir_attach,
                                               ArchiveReports.dirname_archive)

        try:
            ensure_dirs([self.dir_report_incoming, self.dir_report_saved,
                         self.dir_report_deferred, self.dir_report_archive,
                         self.dir_attach_incoming, self.dir_attach_saved,
                         self.dir_attach_deferred, self.dir_attach_archive])
        except FafError as ex:
            self.log_error("Required directories can't be created: {0}"
                           .format(str(ex)))
            raise
Пример #9
0
 def setUp(self):
     super(ActionsTestCase, self).setUp()
     self.basic_fixtures()
     ensure_dirs([paths["reports_incoming"]])
     ensure_dirs([paths["reports_saved"]])
     ensure_dirs([paths["reports_deferred"]])
     ensure_dirs([paths["attachments_incoming"]])
     sample_report_names = ("ureport1", "ureport_core", "ureport_python",
                            "ureport_kerneloops", "ureport_java",
                            "ureport_ruby", "ureport_kerneloops_nouveau")
     sample_reports = {}
     i = 0
     for report_name in sample_report_names:
         i += 1
         report_filename = os.path.join(faftests.cpath, "..",
                                        "sample_reports", report_name)
         for j in range(i):
             shutil.copy(
                 report_filename,
                 os.path.join(paths["reports_incoming"], "{0}_{1}".format(report_name, j)))
         with open(report_filename, "r") as file:
             sample_reports[report_name] = ureport2(json.load(file))
             sample_reports[report_name]["test_count"] = i
     self.sample_reports = sample_reports