|
|
8bb8a7 |
From 9b6a90f1fc2508252bcb33791b24ec53f6b471cb Mon Sep 17 00:00:00 2001
|
|
|
8bb8a7 |
From: Dinesh Prasanth M K <dmoluguw@redhat.com>
|
|
|
8bb8a7 |
Date: Tue, 10 Dec 2019 14:02:16 -0500
|
|
|
8bb8a7 |
Subject: [PATCH] Move config object from plugins to registry
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
This patch moves the config object from the plugins
|
|
|
8bb8a7 |
to the registry, thereby allowing the plugins to use
|
|
|
8bb8a7 |
the values parsed from the healthcheck.conf file while
|
|
|
8bb8a7 |
initializing. This improves the way a plugin can use
|
|
|
8bb8a7 |
the values defined in the conf
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
Signed-off-by: Dinesh Prasanth M K <dmoluguw@redhat.com>
|
|
|
8bb8a7 |
---
|
|
|
8bb8a7 |
src/ipahealthcheck/core/core.py | 11 ++-
|
|
|
8bb8a7 |
src/ipahealthcheck/core/plugin.py | 6 +-
|
|
|
8bb8a7 |
src/ipahealthcheck/dogtag/plugin.py | 3 +-
|
|
|
8bb8a7 |
src/ipahealthcheck/ds/plugin.py | 3 +-
|
|
|
8bb8a7 |
src/ipahealthcheck/ipa/plugin.py | 3 +-
|
|
|
8bb8a7 |
src/ipahealthcheck/system/plugin.py | 2 +-
|
|
|
8bb8a7 |
tests/test_dogtag_ca.py | 9 +--
|
|
|
8bb8a7 |
tests/test_dogtag_connectivity.py | 8 +--
|
|
|
8bb8a7 |
tests/test_ds_replication.py | 6 +-
|
|
|
8bb8a7 |
tests/test_ds_ruv.py | 9 +--
|
|
|
8bb8a7 |
tests/test_ipa_agent.py | 21 ++----
|
|
|
8bb8a7 |
tests/test_ipa_certfile_expiration.py | 9 +--
|
|
|
8bb8a7 |
tests/test_ipa_certmonger_ca.py | 6 +-
|
|
|
8bb8a7 |
tests/test_ipa_dna.py | 9 +--
|
|
|
8bb8a7 |
tests/test_ipa_dns.py | 27 +++-----
|
|
|
8bb8a7 |
tests/test_ipa_expiration.py | 18 ++---
|
|
|
8bb8a7 |
tests/test_ipa_nssdb.py | 12 ++--
|
|
|
8bb8a7 |
tests/test_ipa_nssvalidation.py | 9 +--
|
|
|
8bb8a7 |
tests/test_ipa_opensslvalidation.py | 6 +-
|
|
|
8bb8a7 |
tests/test_ipa_revocation.py | 6 +-
|
|
|
8bb8a7 |
tests/test_ipa_roles.py | 15 ++---
|
|
|
8bb8a7 |
tests/test_ipa_topology.py | 12 ++--
|
|
|
8bb8a7 |
tests/test_ipa_tracking.py | 8 +--
|
|
|
8bb8a7 |
tests/test_ipa_trust.py | 96 +++++++++------------------
|
|
|
8bb8a7 |
tests/test_meta_services.py | 3 +-
|
|
|
8bb8a7 |
tests/test_system_filesystemspace.py | 9 +--
|
|
|
8bb8a7 |
26 files changed, 120 insertions(+), 206 deletions(-)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
diff --git a/src/ipahealthcheck/core/core.py b/src/ipahealthcheck/core/core.py
|
|
|
8bb8a7 |
index aef6197..ade8455 100644
|
|
|
8bb8a7 |
--- a/src/ipahealthcheck/core/core.py
|
|
|
8bb8a7 |
+++ b/src/ipahealthcheck/core/core.py
|
|
|
8bb8a7 |
@@ -64,7 +64,7 @@ def source_or_check_matches(plugin, source, check):
|
|
|
8bb8a7 |
return True
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
-def run_service_plugins(plugins, config, source, check):
|
|
|
8bb8a7 |
+def run_service_plugins(plugins, source, check):
|
|
|
8bb8a7 |
"""Execute plugins with the base class of ServiceCheck
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
This is a specialized check to use systemd to determine
|
|
|
8bb8a7 |
@@ -90,7 +90,7 @@ def run_service_plugins(plugins, config, source, check):
|
|
|
8bb8a7 |
return results, set(available)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
-def run_plugins(plugins, config, available, source, check):
|
|
|
8bb8a7 |
+def run_plugins(plugins, available, source, check):
|
|
|
8bb8a7 |
"""Execute plugins without the base class of ServiceCheck
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
These are the remaining, non-service checking checks
|
|
|
8bb8a7 |
@@ -106,7 +106,6 @@ def run_plugins(plugins, config, available, source, check):
|
|
|
8bb8a7 |
continue
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
logger.debug('Calling check %s' % plugin)
|
|
|
8bb8a7 |
- plugin.config = config
|
|
|
8bb8a7 |
if not set(plugin.requires).issubset(available):
|
|
|
8bb8a7 |
logger.debug('Skipping %s:%s because %s service(s) not running',
|
|
|
8bb8a7 |
plugin.__class__.__module__,
|
|
|
8bb8a7 |
@@ -218,7 +217,7 @@ class RunChecks:
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
for name, registry in find_registries(self.entry_points).items():
|
|
|
8bb8a7 |
try:
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config)
|
|
|
8bb8a7 |
except Exception as e:
|
|
|
8bb8a7 |
print("Unable to initialize %s: %s" % (name, e))
|
|
|
8bb8a7 |
return 1
|
|
|
8bb8a7 |
@@ -246,10 +245,10 @@ class RunChecks:
|
|
|
8bb8a7 |
if options.source:
|
|
|
8bb8a7 |
results = limit_results(results, options.source, options.check)
|
|
|
8bb8a7 |
else:
|
|
|
8bb8a7 |
- results, available = run_service_plugins(plugins, config,
|
|
|
8bb8a7 |
+ results, available = run_service_plugins(plugins,
|
|
|
8bb8a7 |
options.source,
|
|
|
8bb8a7 |
options.check)
|
|
|
8bb8a7 |
- results.extend(run_plugins(plugins, config, available,
|
|
|
8bb8a7 |
+ results.extend(run_plugins(plugins, available,
|
|
|
8bb8a7 |
options.source, options.check))
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
if options.source and len(results.results) == 0:
|
|
|
8bb8a7 |
diff --git a/src/ipahealthcheck/core/plugin.py b/src/ipahealthcheck/core/plugin.py
|
|
|
8bb8a7 |
index 6a29a7f..5754808 100644
|
|
|
8bb8a7 |
--- a/src/ipahealthcheck/core/plugin.py
|
|
|
8bb8a7 |
+++ b/src/ipahealthcheck/core/plugin.py
|
|
|
8bb8a7 |
@@ -41,9 +41,11 @@ class Registry:
|
|
|
8bb8a7 |
def __init__(self):
|
|
|
8bb8a7 |
self.plugins = []
|
|
|
8bb8a7 |
self.framework = None
|
|
|
8bb8a7 |
+ self.config = dict()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- def initialize(self, framework):
|
|
|
8bb8a7 |
+ def initialize(self, framework, config):
|
|
|
8bb8a7 |
self.framework = framework
|
|
|
8bb8a7 |
+ self.config = config
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def __call__(self, cls):
|
|
|
8bb8a7 |
if not callable(cls):
|
|
|
8bb8a7 |
@@ -98,7 +100,7 @@ class Plugin:
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def __init__(self, registry):
|
|
|
8bb8a7 |
self.registry = registry
|
|
|
8bb8a7 |
- self.config = dict()
|
|
|
8bb8a7 |
+ self.config = registry.config
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
class Result:
|
|
|
8bb8a7 |
diff --git a/src/ipahealthcheck/dogtag/plugin.py b/src/ipahealthcheck/dogtag/plugin.py
|
|
|
8bb8a7 |
index 3d8257e..d54fe3b 100644
|
|
|
8bb8a7 |
--- a/src/ipahealthcheck/dogtag/plugin.py
|
|
|
8bb8a7 |
+++ b/src/ipahealthcheck/dogtag/plugin.py
|
|
|
8bb8a7 |
@@ -16,7 +16,8 @@ class DogtagPlugin(Plugin):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
class DogtagRegistry(Registry):
|
|
|
8bb8a7 |
- def initialize(self, framework):
|
|
|
8bb8a7 |
+ def initialize(self, framework, config):
|
|
|
8bb8a7 |
+ super(DogtagRegistry, self).initialize(framework, config)
|
|
|
8bb8a7 |
installutils.check_server_configuration()
|
|
|
8bb8a7 |
if not api.isdone('bootstrap'):
|
|
|
8bb8a7 |
api.bootstrap(in_server=True,
|
|
|
8bb8a7 |
diff --git a/src/ipahealthcheck/ds/plugin.py b/src/ipahealthcheck/ds/plugin.py
|
|
|
8bb8a7 |
index 9ef3461..0e40922 100644
|
|
|
8bb8a7 |
--- a/src/ipahealthcheck/ds/plugin.py
|
|
|
8bb8a7 |
+++ b/src/ipahealthcheck/ds/plugin.py
|
|
|
8bb8a7 |
@@ -16,7 +16,8 @@ class DSPlugin(Plugin):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
class DSRegistry(Registry):
|
|
|
8bb8a7 |
- def initialize(self, framework):
|
|
|
8bb8a7 |
+ def initialize(self, framework, config):
|
|
|
8bb8a7 |
+ super(DSRegistry, self).initialize(framework, config)
|
|
|
8bb8a7 |
installutils.check_server_configuration()
|
|
|
8bb8a7 |
if not api.isdone('bootstrap'):
|
|
|
8bb8a7 |
api.bootstrap(in_server=True,
|
|
|
8bb8a7 |
diff --git a/src/ipahealthcheck/ipa/plugin.py b/src/ipahealthcheck/ipa/plugin.py
|
|
|
8bb8a7 |
index 34cb8c9..c1a6d39 100644
|
|
|
8bb8a7 |
--- a/src/ipahealthcheck/ipa/plugin.py
|
|
|
8bb8a7 |
+++ b/src/ipahealthcheck/ipa/plugin.py
|
|
|
8bb8a7 |
@@ -36,7 +36,8 @@ class IPARegistry(Registry):
|
|
|
8bb8a7 |
self.trust_agent = False
|
|
|
8bb8a7 |
self.trust_controller = False
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- def initialize(self, framework):
|
|
|
8bb8a7 |
+ def initialize(self, framework, config):
|
|
|
8bb8a7 |
+ super(IPARegistry, self).initialize(framework, config)
|
|
|
8bb8a7 |
# deferred import for mock
|
|
|
8bb8a7 |
from ipaserver.servroles import ADtrustBasedRole, ServiceBasedRole
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
diff --git a/src/ipahealthcheck/system/plugin.py b/src/ipahealthcheck/system/plugin.py
|
|
|
8bb8a7 |
index 23e8b5e..03d8c23 100644
|
|
|
8bb8a7 |
--- a/src/ipahealthcheck/system/plugin.py
|
|
|
8bb8a7 |
+++ b/src/ipahealthcheck/system/plugin.py
|
|
|
8bb8a7 |
@@ -12,7 +12,7 @@ class SystemPlugin(Plugin):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
class SystemRegistry(Registry):
|
|
|
8bb8a7 |
- def initialize(self, framework):
|
|
|
8bb8a7 |
+ def initialize(self, framework, config):
|
|
|
8bb8a7 |
pass
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
diff --git a/tests/test_dogtag_ca.py b/tests/test_dogtag_ca.py
|
|
|
8bb8a7 |
index 48eba20..0820aba 100644
|
|
|
8bb8a7 |
--- a/tests/test_dogtag_ca.py
|
|
|
8bb8a7 |
+++ b/tests/test_dogtag_ca.py
|
|
|
8bb8a7 |
@@ -59,10 +59,9 @@ class TestCACerts(BaseTest):
|
|
|
8bb8a7 |
mock_directive.side_effect = [name for name, nsstrust in trust.items()]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = DogtagCertsConfigCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 6
|
|
|
8bb8a7 |
@@ -98,10 +97,9 @@ class TestCACerts(BaseTest):
|
|
|
8bb8a7 |
mock_directive.side_effect = nicknames
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = DogtagCertsConfigCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
num = len(self.results.results)
|
|
|
8bb8a7 |
@@ -129,10 +127,9 @@ class TestCACerts(BaseTest):
|
|
|
8bb8a7 |
mock_cainstance.return_value = CAInstance(False)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config)
|
|
|
8bb8a7 |
f = DogtagCertsConfigCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 0
|
|
|
8bb8a7 |
diff --git a/tests/test_dogtag_connectivity.py b/tests/test_dogtag_connectivity.py
|
|
|
8bb8a7 |
index 544e325..7165706 100644
|
|
|
8bb8a7 |
--- a/tests/test_dogtag_connectivity.py
|
|
|
8bb8a7 |
+++ b/tests/test_dogtag_connectivity.py
|
|
|
8bb8a7 |
@@ -5,7 +5,7 @@
|
|
|
8bb8a7 |
from util import capture_results, CAInstance
|
|
|
8bb8a7 |
from util import m_api
|
|
|
8bb8a7 |
from base import BaseTest
|
|
|
8bb8a7 |
-from ipahealthcheck.core import constants
|
|
|
8bb8a7 |
+from ipahealthcheck.core import constants, config
|
|
|
8bb8a7 |
from ipahealthcheck.dogtag.plugin import registry
|
|
|
8bb8a7 |
from ipahealthcheck.dogtag.ca import DogtagCertsConnectivityCheck
|
|
|
8bb8a7 |
from unittest.mock import Mock
|
|
|
8bb8a7 |
@@ -26,7 +26,7 @@ class TestCAConnectivity(BaseTest):
|
|
|
8bb8a7 |
}
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = DogtagCertsConnectivityCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
@@ -47,7 +47,7 @@ class TestCAConnectivity(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = DogtagCertsConnectivityCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
@@ -67,7 +67,7 @@ class TestCAConnectivity(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = DogtagCertsConnectivityCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
diff --git a/tests/test_ds_replication.py b/tests/test_ds_replication.py
|
|
|
8bb8a7 |
index b6b3652..24e909e 100644
|
|
|
8bb8a7 |
--- a/tests/test_ds_replication.py
|
|
|
8bb8a7 |
+++ b/tests/test_ds_replication.py
|
|
|
8bb8a7 |
@@ -44,10 +44,9 @@ class TestReplicationConflicts(BaseTest):
|
|
|
8bb8a7 |
mock_conn.return_value = mock_ldap(None)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = ReplicationConflictCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# A valid call relies on a success to be set by core
|
|
|
8bb8a7 |
@@ -73,10 +72,9 @@ class TestReplicationConflicts(BaseTest):
|
|
|
8bb8a7 |
mock_conn.return_value = mock_ldap([ldapentry])
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = ReplicationConflictCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
diff --git a/tests/test_ds_ruv.py b/tests/test_ds_ruv.py
|
|
|
8bb8a7 |
index 37070f5..8a3fe84 100644
|
|
|
8bb8a7 |
--- a/tests/test_ds_ruv.py
|
|
|
8bb8a7 |
+++ b/tests/test_ds_ruv.py
|
|
|
8bb8a7 |
@@ -63,11 +63,10 @@ class TestRUV(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_no_ruvs(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = RUVCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(None)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 0
|
|
|
8bb8a7 |
@@ -88,11 +87,10 @@ class TestRUV(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = RUVCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(entries)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -123,11 +121,10 @@ class TestRUV(BaseTest):
|
|
|
8bb8a7 |
entries.append(None)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = RUVCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(entries)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_agent.py b/tests/test_ipa_agent.py
|
|
|
8bb8a7 |
index c58c7a6..8021298 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_agent.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_agent.py
|
|
|
8bb8a7 |
@@ -76,11 +76,10 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap([ldapentry])
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -101,11 +100,10 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap([ldapentry])
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -118,10 +116,9 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
mock_load_cert.side_effect = IOError('test')
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -131,11 +128,10 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
def test_nss_agent_no_entry_found(self):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(None) # None == NotFound
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -158,11 +154,10 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap([ldapentry, ldapentry2])
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -183,11 +178,10 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config())
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap([ldapentry])
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -208,11 +202,10 @@ class TestNSSAgent(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPARAAgent(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap([ldapentry])
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_certfile_expiration.py b/tests/test_ipa_certfile_expiration.py
|
|
|
8bb8a7 |
index d5601c5..43e59b4 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_certfile_expiration.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_certfile_expiration.py
|
|
|
8bb8a7 |
@@ -41,10 +41,9 @@ class TestIPACertificateFile(BaseTest):
|
|
|
8bb8a7 |
mock_load_cert.return_value = cert
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertfileExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 28
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -65,10 +64,9 @@ class TestIPACertificateFile(BaseTest):
|
|
|
8bb8a7 |
mock_load_cert.return_value = cert
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertfileExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 30
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -90,10 +88,9 @@ class TestIPACertificateFile(BaseTest):
|
|
|
8bb8a7 |
mock_load_cert.return_value = cert
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertfileExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 30
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_certmonger_ca.py b/tests/test_ipa_certmonger_ca.py
|
|
|
8bb8a7 |
index 4eec1ba..3b67784 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_certmonger_ca.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_certmonger_ca.py
|
|
|
8bb8a7 |
@@ -4,7 +4,7 @@
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
from util import capture_results, CAInstance
|
|
|
8bb8a7 |
from base import BaseTest
|
|
|
8bb8a7 |
-from ipahealthcheck.core import constants
|
|
|
8bb8a7 |
+from ipahealthcheck.core import constants, config
|
|
|
8bb8a7 |
from ipahealthcheck.ipa.plugin import registry
|
|
|
8bb8a7 |
from ipahealthcheck.ipa.certs import IPACertmongerCA
|
|
|
8bb8a7 |
from unittest.mock import Mock, patch
|
|
|
8bb8a7 |
@@ -24,7 +24,7 @@ class TestCertmonger(BaseTest):
|
|
|
8bb8a7 |
'dogtag-ipa-ca-renew-agent-reuse'
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertmongerCA(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
@@ -44,7 +44,7 @@ class TestCertmonger(BaseTest):
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertmongerCA(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_dna.py b/tests/test_ipa_dna.py
|
|
|
8bb8a7 |
index 5450642..5c88c22 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_dna.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_dna.py
|
|
|
8bb8a7 |
@@ -31,10 +31,9 @@ class TestDNARange(BaseTest):
|
|
|
8bb8a7 |
def test_dnarange_set(self, mock_manager):
|
|
|
8bb8a7 |
mock_manager.return_value = mock_ReplicationManager(start=1, max=100)
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNARangeCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -52,10 +51,9 @@ class TestDNARange(BaseTest):
|
|
|
8bb8a7 |
def test_dnarange_noset(self, mock_manager):
|
|
|
8bb8a7 |
mock_manager.return_value = mock_ReplicationManager()
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNARangeCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -76,10 +74,9 @@ class TestDNARange(BaseTest):
|
|
|
8bb8a7 |
next=101,
|
|
|
8bb8a7 |
next_max=200)
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNARangeCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_dns.py b/tests/test_ipa_dns.py
|
|
|
8bb8a7 |
index dde4c4d..61e9a27 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_dns.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_dns.py
|
|
|
8bb8a7 |
@@ -192,10 +192,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 9
|
|
|
8bb8a7 |
@@ -235,10 +234,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 17
|
|
|
8bb8a7 |
@@ -286,10 +284,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 25
|
|
|
8bb8a7 |
@@ -335,10 +332,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 23
|
|
|
8bb8a7 |
@@ -389,10 +385,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 25
|
|
|
8bb8a7 |
@@ -447,10 +442,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 25
|
|
|
8bb8a7 |
@@ -509,10 +503,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 32
|
|
|
8bb8a7 |
@@ -545,10 +538,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 9
|
|
|
8bb8a7 |
@@ -581,10 +573,9 @@ class TestDNSSystemRecords(BaseTest):
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPADNSSystemRecordsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 15
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_expiration.py b/tests/test_ipa_expiration.py
|
|
|
8bb8a7 |
index 6cd6952..cd7de82 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_expiration.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_expiration.py
|
|
|
8bb8a7 |
@@ -30,10 +30,9 @@ class TestExpiration(BaseTest):
|
|
|
8bb8a7 |
set_requests()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertmongerExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 7
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -66,10 +65,9 @@ class TestExpiration(BaseTest):
|
|
|
8bb8a7 |
set_requests(remove=0, add=replaceme)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertmongerExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 30
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -122,10 +120,9 @@ class TestChainExpiration(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACAChainExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 7
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -160,10 +157,9 @@ class TestChainExpiration(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACAChainExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 7
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -200,10 +196,9 @@ class TestChainExpiration(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACAChainExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 7
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
@@ -238,10 +233,9 @@ class TestChainExpiration(BaseTest):
|
|
|
8bb8a7 |
)
|
|
|
8bb8a7 |
]
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACAChainExpirationCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
f.config.cert_expiration_days = 7
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_nssdb.py b/tests/test_ipa_nssdb.py
|
|
|
8bb8a7 |
index 590401c..9def3d1 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_nssdb.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_nssdb.py
|
|
|
8bb8a7 |
@@ -48,10 +48,9 @@ class TestNSSDBTrust(BaseTest):
|
|
|
8bb8a7 |
mock_certdb.return_value = mock_CertDB(trust)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertNSSTrust(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 4
|
|
|
8bb8a7 |
@@ -74,10 +73,9 @@ class TestNSSDBTrust(BaseTest):
|
|
|
8bb8a7 |
mock_certdb.return_value = mock_CertDB(trust)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertNSSTrust(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# The check reports success for those that it found and are correct and
|
|
|
8bb8a7 |
@@ -114,10 +112,9 @@ class TestNSSDBTrust(BaseTest):
|
|
|
8bb8a7 |
mock_certdb.return_value = mock_CertDB(trust)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertNSSTrust(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
result = self.results.results[1]
|
|
|
8bb8a7 |
@@ -149,10 +146,9 @@ class TestNSSDBTrust(BaseTest):
|
|
|
8bb8a7 |
mock_cainstance.return_value = CAInstance(False)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertNSSTrust(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 0
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_nssvalidation.py b/tests/test_ipa_nssvalidation.py
|
|
|
8bb8a7 |
index 1e567d8..08135e7 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_nssvalidation.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_nssvalidation.py
|
|
|
8bb8a7 |
@@ -38,10 +38,9 @@ class TestNSSValidation(BaseTest):
|
|
|
8bb8a7 |
mock_cainstance.return_value = CAInstance()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPANSSChainValidation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -68,10 +67,9 @@ class TestNSSValidation(BaseTest):
|
|
|
8bb8a7 |
mock_cainstance.return_value = CAInstance()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPANSSChainValidation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -97,10 +95,9 @@ class TestNSSValidation(BaseTest):
|
|
|
8bb8a7 |
mock_cainstance.return_value = CAInstance(False)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPANSSChainValidation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_opensslvalidation.py b/tests/test_ipa_opensslvalidation.py
|
|
|
8bb8a7 |
index 0d334cd..e73138c 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_opensslvalidation.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_opensslvalidation.py
|
|
|
8bb8a7 |
@@ -30,10 +30,9 @@ class TestOpenSSLValidation(BaseTest):
|
|
|
8bb8a7 |
mock_run.side_effect = run
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPAOpenSSLChainValidation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -59,10 +58,9 @@ class TestOpenSSLValidation(BaseTest):
|
|
|
8bb8a7 |
mock_run.side_effect = run
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPAOpenSSLChainValidation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_revocation.py b/tests/test_ipa_revocation.py
|
|
|
8bb8a7 |
index 39cf3e7..c6423c0 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_revocation.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_revocation.py
|
|
|
8bb8a7 |
@@ -54,10 +54,9 @@ class TestRevocation(BaseTest):
|
|
|
8bb8a7 |
set_requests()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertRevocation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -84,10 +83,9 @@ class TestRevocation(BaseTest):
|
|
|
8bb8a7 |
set_requests()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertRevocation(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_roles.py b/tests/test_ipa_roles.py
|
|
|
8bb8a7 |
index 453db06..21c0069 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_roles.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_roles.py
|
|
|
8bb8a7 |
@@ -18,10 +18,9 @@ class TestCRLManagerRole(BaseTest):
|
|
|
8bb8a7 |
def test_not_crlmanager(self, mock_ca):
|
|
|
8bb8a7 |
mock_ca.return_value = CAInstance(crlgen=False)
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACRLManagerCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -36,10 +35,9 @@ class TestCRLManagerRole(BaseTest):
|
|
|
8bb8a7 |
def test_crlmanager(self, mock_ca):
|
|
|
8bb8a7 |
mock_ca.return_value = CAInstance()
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACRLManagerCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -54,7 +52,7 @@ class TestCRLManagerRole(BaseTest):
|
|
|
8bb8a7 |
class TestRenewalMaster(BaseTest):
|
|
|
8bb8a7 |
def test_renewal_master_not_set(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPARenewalMasterCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
m_api.Command.config_show.side_effect = [{
|
|
|
8bb8a7 |
@@ -62,7 +60,6 @@ class TestRenewalMaster(BaseTest):
|
|
|
8bb8a7 |
}
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -75,7 +72,7 @@ class TestRenewalMaster(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_not_renewal_master(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPARenewalMasterCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
m_api.Command.config_show.side_effect = [{
|
|
|
8bb8a7 |
@@ -84,7 +81,6 @@ class TestRenewalMaster(BaseTest):
|
|
|
8bb8a7 |
}
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -97,7 +93,7 @@ class TestRenewalMaster(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_is_renewal_master(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPARenewalMasterCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
m_api.Command.config_show.side_effect = [{
|
|
|
8bb8a7 |
@@ -106,7 +102,6 @@ class TestRenewalMaster(BaseTest):
|
|
|
8bb8a7 |
}
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_topology.py b/tests/test_ipa_topology.py
|
|
|
8bb8a7 |
index a4ff6d9..11931d9 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_topology.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_topology.py
|
|
|
8bb8a7 |
@@ -28,10 +28,9 @@ class TestTopology(BaseTest):
|
|
|
8bb8a7 |
m_api.Command.ca_is_enabled.return_value = {'result': True}
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPATopologyDomainCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -71,10 +70,9 @@ class TestTopology(BaseTest):
|
|
|
8bb8a7 |
m_api.Command.ca_is_enabled.return_value = {'result': True}
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPATopologyDomainCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 3
|
|
|
8bb8a7 |
@@ -135,10 +133,9 @@ class TestTopology(BaseTest):
|
|
|
8bb8a7 |
m_api.Command.ca_is_enabled.return_value = {'result': True}
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPATopologyDomainCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 3
|
|
|
8bb8a7 |
@@ -193,10 +190,9 @@ class TestTopology(BaseTest):
|
|
|
8bb8a7 |
m_api.Command.ca_is_enabled.return_value = {'result': True}
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPATopologyDomainCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_tracking.py b/tests/test_ipa_tracking.py
|
|
|
8bb8a7 |
index c40d8f4..4b982d0 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_tracking.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_tracking.py
|
|
|
8bb8a7 |
@@ -5,7 +5,7 @@
|
|
|
8bb8a7 |
from util import capture_results
|
|
|
8bb8a7 |
from base import BaseTest
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
-from ipahealthcheck.core import constants
|
|
|
8bb8a7 |
+from ipahealthcheck.core import constants, config
|
|
|
8bb8a7 |
from ipahealthcheck.ipa.plugin import registry
|
|
|
8bb8a7 |
from ipahealthcheck.ipa.certs import IPACertTracking
|
|
|
8bb8a7 |
from unittest.mock import Mock
|
|
|
8bb8a7 |
@@ -27,7 +27,7 @@ class TestTracking(BaseTest):
|
|
|
8bb8a7 |
set_requests()
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertTracking(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
@@ -39,7 +39,7 @@ class TestTracking(BaseTest):
|
|
|
8bb8a7 |
set_requests(remove=0)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertTracking(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
@@ -71,7 +71,7 @@ class TestTracking(BaseTest):
|
|
|
8bb8a7 |
set_requests(add=unknown)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = IPACertTracking(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
diff --git a/tests/test_ipa_trust.py b/tests/test_ipa_trust.py
|
|
|
8bb8a7 |
index 01fdf3c..cf2281c 100644
|
|
|
8bb8a7 |
--- a/tests/test_ipa_trust.py
|
|
|
8bb8a7 |
+++ b/tests/test_ipa_trust.py
|
|
|
8bb8a7 |
@@ -109,11 +109,10 @@ class SSSDConfig():
|
|
|
8bb8a7 |
class TestTrustAgent(BaseTest):
|
|
|
8bb8a7 |
def test_no_trust_agent(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = False
|
|
|
8bb8a7 |
f = IPATrustAgentCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -124,11 +123,10 @@ class TestTrustAgent(BaseTest):
|
|
|
8bb8a7 |
mock_sssd.return_value = SSSDConfig(return_domains=True,
|
|
|
8bb8a7 |
return_ipa_server_mode=True)
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustAgentCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -143,11 +141,10 @@ class TestTrustAgent(BaseTest):
|
|
|
8bb8a7 |
mock_sssd.return_value = SSSDConfig(return_domains=True,
|
|
|
8bb8a7 |
return_ipa_server_mode=False)
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustAgentCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -164,11 +161,10 @@ class TestTrustAgent(BaseTest):
|
|
|
8bb8a7 |
mock_sssd.return_value = SSSDConfig(return_domains=True,
|
|
|
8bb8a7 |
return_ipa_server_mode=None)
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustAgentCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -184,11 +180,10 @@ class TestTrustAgent(BaseTest):
|
|
|
8bb8a7 |
class TestTrustDomains(BaseTest):
|
|
|
8bb8a7 |
def test_no_trust_agent(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = False
|
|
|
8bb8a7 |
f = IPATrustDomainsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -202,11 +197,10 @@ class TestTrustDomains(BaseTest):
|
|
|
8bb8a7 |
mock_run.return_value = run_result
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustDomainsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -230,11 +224,10 @@ class TestTrustDomains(BaseTest):
|
|
|
8bb8a7 |
mock_trust.side_effect = errors.NotFound(reason='bad')
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustDomainsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# There are more than one result I just care about this particular
|
|
|
8bb8a7 |
@@ -279,11 +272,10 @@ class TestTrustDomains(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustDomainsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 3
|
|
|
8bb8a7 |
@@ -344,11 +336,10 @@ class TestTrustDomains(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustDomainsCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -374,12 +365,11 @@ class TestIPADomain(BaseTest):
|
|
|
8bb8a7 |
def test_ipa_domain_ok(self, mock_sssd):
|
|
|
8bb8a7 |
mock_sssd.return_value = SSSDConfig(provider='ipa')
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
# being a trust agent isn't mandatory, test without
|
|
|
8bb8a7 |
registry.trust_agent = False
|
|
|
8bb8a7 |
f = IPADomainCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
print(self.results.results)
|
|
|
8bb8a7 |
@@ -394,11 +384,10 @@ class TestIPADomain(BaseTest):
|
|
|
8bb8a7 |
def test_ipa_domain_ad(self, mock_sssd):
|
|
|
8bb8a7 |
mock_sssd.return_value = SSSDConfig(provider='ad')
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPADomainCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 4
|
|
|
8bb8a7 |
@@ -413,11 +402,10 @@ class TestIPADomain(BaseTest):
|
|
|
8bb8a7 |
class TestTrustCatalog(BaseTest):
|
|
|
8bb8a7 |
def test_no_trust_agent(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = False
|
|
|
8bb8a7 |
f = IPATrustCatalogCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -464,11 +452,10 @@ class TestTrustCatalog(BaseTest):
|
|
|
8bb8a7 |
}]
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustCatalogCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 6
|
|
|
8bb8a7 |
@@ -524,11 +511,10 @@ class Testsidgen(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_no_trust_agent(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = False
|
|
|
8bb8a7 |
f = IPAsidgenpluginCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -544,12 +530,11 @@ class Testsidgen(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPAsidgenpluginCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -576,12 +561,11 @@ class Testsidgen(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPAsidgenpluginCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 2
|
|
|
8bb8a7 |
@@ -607,11 +591,10 @@ class TestTrustAgentMember(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_no_trust_agent(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = False
|
|
|
8bb8a7 |
f = IPATrustAgentMemberCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -632,12 +615,11 @@ class TestTrustAgentMember(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustAgentMemberCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -660,12 +642,11 @@ class TestTrustAgentMember(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustAgentMemberCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -685,11 +666,10 @@ class TestControllerPrincipal(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_not_trust_controller(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = False
|
|
|
8bb8a7 |
f = IPATrustControllerPrincipalCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -711,12 +691,11 @@ class TestControllerPrincipal(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerPrincipalCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -740,12 +719,11 @@ class TestControllerPrincipal(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerPrincipalCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -765,11 +743,10 @@ class TestControllerService(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_not_trust_controller(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = False
|
|
|
8bb8a7 |
f = IPATrustControllerServiceCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -786,12 +763,11 @@ class TestControllerService(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerServiceCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -813,12 +789,11 @@ class TestControllerService(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerServiceCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -837,11 +812,10 @@ class TestControllerGroupSID(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_not_trust_controller(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = False
|
|
|
8bb8a7 |
f = IPATrustControllerGroupSIDCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -859,12 +833,11 @@ class TestControllerGroupSID(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerGroupSIDCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -888,12 +861,11 @@ class TestControllerGroupSID(BaseTest):
|
|
|
8bb8a7 |
ldapentry[attr] = values
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerGroupSIDCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
f.conn = mock_ldap(ldapentry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -914,11 +886,10 @@ class TestControllerConf(BaseTest):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
def test_not_trust_controller(self):
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = False
|
|
|
8bb8a7 |
f = IPATrustControllerConfCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
# Zero because the call was skipped altogether
|
|
|
8bb8a7 |
@@ -934,11 +905,10 @@ class TestControllerConf(BaseTest):
|
|
|
8bb8a7 |
mock_run.return_value = run_result
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = True
|
|
|
8bb8a7 |
f = IPATrustControllerConfCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
@@ -954,11 +924,10 @@ class TestPackageCheck(BaseTest):
|
|
|
8bb8a7 |
def test_agent_with_package(self):
|
|
|
8bb8a7 |
# Note that this test assumes the import is installed
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = False
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
f = IPATrustPackageCheck(registry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
@@ -969,14 +938,13 @@ class TestPackageCheck(BaseTest):
|
|
|
8bb8a7 |
def test_agent_without_package(self):
|
|
|
8bb8a7 |
# Note that this test assumes the import is installed
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
registry.trust_controller = False
|
|
|
8bb8a7 |
registry.trust_agent = True
|
|
|
8bb8a7 |
# Hose up the module so the import fails
|
|
|
8bb8a7 |
save = sys.modules['ipaserver.install']
|
|
|
8bb8a7 |
sys.modules['ipaserver.install'] = 'foo'
|
|
|
8bb8a7 |
f = IPATrustPackageCheck(registry)
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
assert len(self.results) == 1
|
|
|
8bb8a7 |
result = self.results.results[0]
|
|
|
8bb8a7 |
diff --git a/tests/test_meta_services.py b/tests/test_meta_services.py
|
|
|
8bb8a7 |
index 6fbea13..b7a71a4 100644
|
|
|
8bb8a7 |
--- a/tests/test_meta_services.py
|
|
|
8bb8a7 |
+++ b/tests/test_meta_services.py
|
|
|
8bb8a7 |
@@ -7,6 +7,7 @@ from base import BaseTest
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
from ipahealthcheck.ipa.plugin import registry
|
|
|
8bb8a7 |
from ipahealthcheck.meta.services import httpd
|
|
|
8bb8a7 |
+from ipahealthcheck.core import config
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
class TestServices(BaseTest):
|
|
|
8bb8a7 |
@@ -19,7 +20,7 @@ class TestServices(BaseTest):
|
|
|
8bb8a7 |
running.
|
|
|
8bb8a7 |
"""
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = httpd(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
diff --git a/tests/test_system_filesystemspace.py b/tests/test_system_filesystemspace.py
|
|
|
8bb8a7 |
index 3317f62..873b977 100644
|
|
|
8bb8a7 |
--- a/tests/test_system_filesystemspace.py
|
|
|
8bb8a7 |
+++ b/tests/test_system_filesystemspace.py
|
|
|
8bb8a7 |
@@ -28,10 +28,9 @@ class TestFileSystemNotEnoughFreeSpace(BaseTest):
|
|
|
8bb8a7 |
def test_filesystem_near_enospc(self):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = FileSystemSpaceCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
expected_results = 10 if in_container() else 12
|
|
|
8bb8a7 |
@@ -64,10 +63,9 @@ class TestFileSystemNotEnoughFreeSpacePercentage(BaseTest):
|
|
|
8bb8a7 |
def test_filesystem_risking_fragmentation(self):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = FileSystemSpaceCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
expected_results = 10 if in_container() else 12
|
|
|
8bb8a7 |
@@ -100,10 +98,9 @@ class TestFileSystemEnoughFreeSpace(BaseTest):
|
|
|
8bb8a7 |
def test_filesystem_with_enough_space(self):
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
framework = object()
|
|
|
8bb8a7 |
- registry.initialize(framework)
|
|
|
8bb8a7 |
+ registry.initialize(framework, config.Config)
|
|
|
8bb8a7 |
f = FileSystemSpaceCheck(registry)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
- f.config = config.Config()
|
|
|
8bb8a7 |
self.results = capture_results(f)
|
|
|
8bb8a7 |
|
|
|
8bb8a7 |
expected_results = 10 if in_container() else 12
|
|
|
8bb8a7 |
--
|
|
|
8bb8a7 |
2.21.0
|
|
|
8bb8a7 |
|