Ejemplo n.º 1
0
def test_installed_nodefconf(monkeypatch):
    monkeypatch.setattr(reporting, 'report_generic', report_generic_mocked())
    monkeypatch.setattr(library, 'is_config_default', lambda: False)

    library.check_chrony(True)

    assert reporting.report_generic.called == 1
    assert reporting.report_generic.report_fields['title'] == \
            'chrony using non-default configuration'
Ejemplo n.º 2
0
def test_installed_defconf(monkeypatch):
    monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
    monkeypatch.setattr(library, 'is_config_default', lambda: True)

    library.check_chrony(True)

    assert reporting.create_report.called == 1
    assert reporting.create_report.report_fields[
        'title'] == 'chrony using default configuration'
Ejemplo n.º 3
0
def test_uninstalled(monkeypatch):
    for config_default in (False, True):
        monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
        monkeypatch.setattr(library, 'is_config_default',
                            lambda: config_default)

        library.check_chrony(False)

        assert reporting.create_report.called == 0
Ejemplo n.º 4
0
    def process(self):
        installed_packages = set()

        signed_rpms = self.consume(InstalledRedHatSignedRPM)
        for rpm_pkgs in signed_rpms:
            for pkg in rpm_pkgs.items:
                installed_packages.add(pkg.name)

        check_chrony('chrony' in installed_packages)
Ejemplo n.º 5
0
 def process(self):
     check_chrony(has_package(InstalledRedHatSignedRPM, 'chrony'))