mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: Extend IntegrationTest with multiple AD domain support
Part of: https://fedorahosted.org/freeipa/ticket/3834
This commit is contained in:
parent
5a9b46c9c5
commit
407db5b8a9
@ -35,10 +35,19 @@ log = log_mgr.get_logger(__name__)
|
|||||||
class IntegrationTest(object):
|
class IntegrationTest(object):
|
||||||
num_replicas = 0
|
num_replicas = 0
|
||||||
num_clients = 0
|
num_clients = 0
|
||||||
|
num_ad_domains = 0
|
||||||
topology = None
|
topology = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_class(cls):
|
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()
|
config = get_global_config()
|
||||||
if not config.domains:
|
if not config.domains:
|
||||||
raise nose.SkipTest('Integration testing not configured')
|
raise nose.SkipTest('Integration testing not configured')
|
||||||
@ -46,17 +55,15 @@ class IntegrationTest(object):
|
|||||||
cls.logs_to_collect = {}
|
cls.logs_to_collect = {}
|
||||||
|
|
||||||
domain = config.domains[0]
|
domain = config.domains[0]
|
||||||
|
|
||||||
cls.master = domain.master
|
cls.master = domain.master
|
||||||
if len(domain.replicas) < cls.num_replicas:
|
cls.replicas = get_resources(domain.replicas, 'replicas',
|
||||||
raise nose.SkipTest(
|
cls.num_replicas)
|
||||||
'Not enough replicas available (have %s, need %s)' %
|
cls.clients = get_resources(domain.clients, 'clients',
|
||||||
(len(domain.replicas), cls.num_replicas))
|
cls.num_clients)
|
||||||
if len(domain.clients) < cls.num_clients:
|
cls.ad_domains = get_resources(config.ad_domains, 'AD domains',
|
||||||
raise nose.SkipTest(
|
cls.num_ad_domains)
|
||||||
'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]
|
|
||||||
for host in cls.get_all_hosts():
|
for host in cls.get_all_hosts():
|
||||||
host.add_log_collector(cls.collect_log)
|
host.add_log_collector(cls.collect_log)
|
||||||
cls.prepare_host(host)
|
cls.prepare_host(host)
|
||||||
@ -95,6 +102,7 @@ class IntegrationTest(object):
|
|||||||
del cls.master
|
del cls.master
|
||||||
del cls.replicas
|
del cls.replicas
|
||||||
del cls.clients
|
del cls.clients
|
||||||
|
del cls.ad_domains
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def uninstall(cls):
|
def uninstall(cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user