diff options
author | Tomas Babej <tbabej@redhat.com> | 2013-09-04 15:02:21 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-10-24 14:08:35 +0200 |
commit | 87267dd29721e26ce00913ad22382c7409f00b4c (patch) | |
tree | a5a3fdebe0bb0997e050a754b65e84f3decb1950 /ipatests | |
parent | 8a2c2b77871893224f6c5a1f520cbba11a2f9db4 (diff) | |
download | freeipa-87267dd29721e26ce00913ad22382c7409f00b4c.tar.gz freeipa-87267dd29721e26ce00913ad22382c7409f00b4c.tar.xz freeipa-87267dd29721e26ce00913ad22382c7409f00b4c.zip |
ipatests: Extend IntegrationTest with multiple AD domain support
Part of: https://fedorahosted.org/freeipa/ticket/3834
Diffstat (limited to 'ipatests')
-rw-r--r-- | ipatests/test_integration/base.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py index 43360a83a..1bed7d55b 100644 --- a/ipatests/test_integration/base.py +++ b/ipatests/test_integration/base.py @@ -35,10 +35,19 @@ log = log_mgr.get_logger(__name__) class IntegrationTest(object): num_replicas = 0 num_clients = 0 + num_ad_domains = 0 topology = None @classmethod def setup_class(cls): + + def get_resources(resource_container, resource_str, num_needed): + if len(resource_container) < num_needed: + raise nose.SkipTest( + 'Not enough %s available (have %s, need %s)' % + (resource_str, len(resource_container), num_needed)) + return resource_container[:num_needed] + config = get_global_config() if not config.domains: raise nose.SkipTest('Integration testing not configured') @@ -46,17 +55,15 @@ class IntegrationTest(object): cls.logs_to_collect = {} domain = config.domains[0] + cls.master = domain.master - if len(domain.replicas) < cls.num_replicas: - raise nose.SkipTest( - 'Not enough replicas available (have %s, need %s)' % - (len(domain.replicas), cls.num_replicas)) - if len(domain.clients) < cls.num_clients: - raise nose.SkipTest( - 'Not enough clients available (have %s, need %s)' % - (len(domain.clients), cls.num_clients)) - cls.replicas = domain.replicas[:cls.num_replicas] - cls.clients = domain.clients[:cls.num_clients] + cls.replicas = get_resources(domain.replicas, 'replicas', + cls.num_replicas) + cls.clients = get_resources(domain.clients, 'clients', + cls.num_clients) + cls.ad_domains = get_resources(config.ad_domains, 'AD domains', + cls.num_ad_domains) + for host in cls.get_all_hosts(): host.add_log_collector(cls.collect_log) cls.prepare_host(host) @@ -95,6 +102,7 @@ class IntegrationTest(object): del cls.master del cls.replicas del cls.clients + del cls.ad_domains @classmethod def uninstall(cls): |