From 758c73e1493d8499f346c1fb7e3ca1e18ec1454e Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 17 Sep 2013 12:24:40 +0200 Subject: test_integration.host: Move transport-related functionality to a new module This will make it possible to use a different mechanism for cases like - Paramiko is not available - Hosts without SSH servers (e.g. Windows) Add BaseHost, Transport & Command base classes that define the interface and common functionality, and Host, ParamikoTransport & SSHCommand with specific details. The {get,put}_file_contents methods are left on Host for convenience; all other Transport methods must be now accessed through the transport. Part of the work for https://fedorahosted.org/freeipa/ticket/3890 --- ipatests/test_integration/test_caless.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ipatests/test_integration/test_caless.py') diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index 643c9c48..12faf296 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -103,7 +103,7 @@ class CALessBase(IntegrationTest): host.mkdir_recursive(cls.crl_path) for source in glob.glob(os.path.join(base, '*.crl')): dest = os.path.join(cls.crl_path, os.path.basename(source)) - host.put_file(source, dest) + host.transport.put_file(source, dest) @classmethod def uninstall(cls): @@ -174,8 +174,8 @@ class CALessBase(IntegrationTest): @classmethod def copy_cert(cls, host, filename): - host.put_file(os.path.join(cls.cert_dir, filename), - os.path.join(host.config.test_dir, filename)) + host.transport.put_file(os.path.join(cls.cert_dir, filename), + os.path.join(host.config.test_dir, filename)) @classmethod def uninstall_server(self, host=None): @@ -211,8 +211,9 @@ class CALessBase(IntegrationTest): if dirsrv_pkcs12_exists: files_to_copy.append(dirsrv_pkcs12) for filename in set(files_to_copy): - master.put_file(os.path.join(self.cert_dir, filename), - os.path.join(master.config.test_dir, filename)) + master.transport.put_file( + os.path.join(self.cert_dir, filename), + os.path.join(master.config.test_dir, filename)) self.collect_log(replica, '/var/log/ipareplica-install.log') self.collect_log(replica, '/var/log/ipaclient-install.log') -- cgit