summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-09-04 15:02:21 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-24 14:08:40 +0200
commit407db5b8a903e64ee1f70a26bf2975b48a3db9d2 (patch)
treef292bc4b127a47c441513106a847d5757b9b156d /ipatests/test_integration
parent5a9b46c9c5fa82d3e5817fd1137a00e4d5a0f848 (diff)
downloadfreeipa-407db5b8a903e64ee1f70a26bf2975b48a3db9d2.tar.gz
freeipa-407db5b8a903e64ee1f70a26bf2975b48a3db9d2.tar.xz
freeipa-407db5b8a903e64ee1f70a26bf2975b48a3db9d2.zip
ipatests: Extend IntegrationTest with multiple AD domain support
Part of: https://fedorahosted.org/freeipa/ticket/3834
Diffstat (limited to 'ipatests/test_integration')
-rw-r--r--ipatests/test_integration/base.py28
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):