Exemple #1
0
def test_installed_nodefconf_noudp(monkeypatch):
    monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
    monkeypatch.setattr(checkmemcached, 'is_sysconfig_default', lambda: False)
    monkeypatch.setattr(checkmemcached, 'is_udp_disabled', lambda: True)

    checkmemcached.check_memcached(True)

    assert reporting.create_report.called == 1
    assert reporting.create_report.report_fields[
        'title'] == 'memcached has already disabled UDP port'
Exemple #2
0
def test_installed_defconf(monkeypatch):
    for udp_disabled in (False, True):
        monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
        monkeypatch.setattr(checkmemcached, 'is_sysconfig_default',
                            lambda: True)
        monkeypatch.setattr(checkmemcached, 'is_udp_disabled',
                            lambda: udp_disabled)

        checkmemcached.check_memcached(True)

        assert reporting.create_report.called == 1
        assert reporting.create_report.report_fields[
            'title'] == 'memcached service is using default configuration'
Exemple #3
0
def test_uninstalled(monkeypatch):
    for sysconfig_default in (False, True):
        for udp_disabled in (False, True):
            monkeypatch.setattr(reporting, 'create_report',
                                create_report_mocked())
            monkeypatch.setattr(
                checkmemcached,
                'is_sysconfig_default',
                lambda: sysconfig_default,
            )
            monkeypatch.setattr(checkmemcached, 'is_udp_disabled',
                                lambda: udp_disabled)

            checkmemcached.check_memcached(False)

            assert reporting.create_report.called == 0
Exemple #4
0
 def process(self):
     check_memcached(has_package(InstalledRedHatSignedRPM, 'memcached'))