From 846ae2b3f4807f2b1897811b9fe9978103c2451a Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 5 Jun 2013 18:30:39 +0200 Subject: tests: Configure/unconfigure remote hosts Set up the hostname, /etc/resolv.conf, and /etc/hosts on remote hosts in the test setup. Undo the changes in test teardown. Part of the work for https://fedorahosted.org/freeipa/ticket/3621 --- ipatests/test_integration/base.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'ipatests/test_integration/base.py') diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py index 131db89d..934dce05 100644 --- a/ipatests/test_integration/base.py +++ b/ipatests/test_integration/base.py @@ -60,8 +60,12 @@ class IntegrationTest(object): for host in cls.get_all_hosts(): cls.prepare_host(host) - cls.install() - cls.kinit_all() + try: + cls.install() + cls.kinit_all() + except: + cls.uninstall() + raise @classmethod def get_all_hosts(cls): @@ -69,7 +73,7 @@ class IntegrationTest(object): @classmethod def prepare_host(cls, host): - log.info('Preparing host %s', host.hostname) + cls.log.info('Preparing host %s', host.hostname) env_filename = os.path.join(host.config.test_dir, 'env.sh') cls.collect_log(host, env_filename) host.mkdir_recursive(host.config.test_dir) @@ -104,14 +108,11 @@ class IntegrationTest(object): @classmethod def uninstall(cls): - cls.collect_log(cls.master, '/var/log/ipaserver-uninstall.log') - cls.master.run_command(['ipa-server-install', '--uninstall', '-U']) + tasks.uninstall_master(cls.master, collect_log=cls.collect_log) for replica in cls.replicas: - cls.collect_log(replica, '/var/log/ipaserver-uninstall.log') - replica.run_command(['ipa-server-install', '--uninstall', '-U']) + tasks.uninstall_master(replica, collect_log=cls.collect_log) for client in cls.clients: - cls.collect_log(replica, '/var/log/ipaclient-uninstall.log') - client.run_command(['ipa-client-install', '--uninstall', '-U']) + tasks.uninstall_client(client, collect_log=cls.collect_log) @classmethod def collect_log(cls, host, filename): -- cgit