summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/base.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-06-05 18:30:39 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-07-15 15:49:11 +0200
commit846ae2b3f4807f2b1897811b9fe9978103c2451a (patch)
tree29613e865d58f298029d89bad22116ed90ce4a5e /ipatests/test_integration/base.py
parentd84e10347eb42ffca7d5d761e0f7af447f3e2ef7 (diff)
downloadfreeipa-846ae2b3f4807f2b1897811b9fe9978103c2451a.tar.gz
freeipa-846ae2b3f4807f2b1897811b9fe9978103c2451a.tar.xz
freeipa-846ae2b3f4807f2b1897811b9fe9978103c2451a.zip
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
Diffstat (limited to 'ipatests/test_integration/base.py')
-rw-r--r--ipatests/test_integration/base.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py
index 131db89d8..934dce056 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):