diff options
author | Petr Viktorin <pviktori@redhat.com> | 2013-06-27 10:40:39 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2013-07-25 12:32:33 +0200 |
commit | 4b439356b735d55c7da664bdf8d9f40468fb9c4d (patch) | |
tree | 7bd8d6868737791ee4435d58b8c6a67b53e9aced /ipatests/test_integration/base.py | |
parent | 65dfcb7cec7b641a87f9c59657eb7acbbecf911e (diff) | |
download | freeipa-4b439356b735d55c7da664bdf8d9f40468fb9c4d.tar.gz freeipa-4b439356b735d55c7da664bdf8d9f40468fb9c4d.tar.xz freeipa-4b439356b735d55c7da664bdf8d9f40468fb9c4d.zip |
test_integration: Add log collection to Host
This allows collecting logs when a test context is not available.
Diffstat (limited to 'ipatests/test_integration/base.py')
-rw-r--r-- | ipatests/test_integration/base.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py index 8b243f937..4e8521dd9 100644 --- a/ipatests/test_integration/base.py +++ b/ipatests/test_integration/base.py @@ -58,6 +58,7 @@ class IntegrationTest(object): cls.replicas = domain.replicas[:cls.num_replicas] cls.clients = domain.clients[:cls.num_clients] for host in cls.get_all_hosts(): + host.add_log_collector(cls.collect_log) cls.prepare_host(host) try: @@ -83,15 +84,17 @@ class IntegrationTest(object): if cls.topology == 'none': return elif cls.topology == 'star': - tasks.install_master(cls.master, collect_log=cls.collect_log) + tasks.install_master(cls.master) for replica in cls.replicas: - tasks.install_replica(cls.master, replica, - collect_log=cls.collect_log) + tasks.install_replica(cls.master, replica) else: raise ValueError('Unknown topology %s' % cls.topology) @classmethod def teardown_class(cls): + for host in cls.get_all_hosts(): + host.remove_log_collector(cls.collect_log) + try: cls.uninstall() finally: @@ -101,11 +104,11 @@ class IntegrationTest(object): @classmethod def uninstall(cls): - tasks.uninstall_master(cls.master, collect_log=cls.collect_log) + tasks.uninstall_master(cls.master) for replica in cls.replicas: - tasks.uninstall_master(replica, collect_log=cls.collect_log) + tasks.uninstall_master(replica) for client in cls.clients: - tasks.uninstall_client(client, collect_log=cls.collect_log) + tasks.uninstall_client(client) @classmethod def collect_log(cls, host, filename): |