summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/tasks.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-09-17 12:24:40 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-03 18:57:41 +0200
commit758c73e1493d8499f346c1fb7e3ca1e18ec1454e (patch)
treefd9b4bef5611baa58caf924606862b8eca885608 /ipatests/test_integration/tasks.py
parent7d2d1cb59d22eeed9ed62541299e96ea97006d0e (diff)
downloadfreeipa-758c73e1493d8499f346c1fb7e3ca1e18ec1454e.tar.gz
freeipa-758c73e1493d8499f346c1fb7e3ca1e18ec1454e.tar.xz
freeipa-758c73e1493d8499f346c1fb7e3ca1e18ec1454e.zip
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
Diffstat (limited to 'ipatests/test_integration/tasks.py')
-rw-r--r--ipatests/test_integration/tasks.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 69a34a287..7ea0ce4f1 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -40,7 +40,7 @@ log = log_mgr.get_logger(__name__)
def prepare_host(host):
env_filename = os.path.join(host.config.test_dir, 'env.sh')
host.collect_log(env_filename)
- host.mkdir_recursive(host.config.test_dir)
+ host.transport.mkdir_recursive(host.config.test_dir)
host.put_file_contents(env_filename, env_to_script(host.to_env()))
@@ -51,10 +51,10 @@ def apply_common_fixes(host):
def backup_file(host, filename):
- if host.file_exists(filename):
+ if host.transport.file_exists(filename):
backupname = os.path.join(host.config.test_dir, 'file_backup',
filename.lstrip('/'))
- host.mkdir_recursive(os.path.dirname(backupname))
+ host.transport.mkdir_recursive(os.path.dirname(backupname))
host.run_command(['cp', '-af', filename, backupname])
return True
else:
@@ -63,7 +63,7 @@ def backup_file(host, filename):
ipautil.shell_quote(filename),
ipautil.shell_quote(rmname)))
contents = host.get_file_contents(rmname)
- host.mkdir_recursive(os.path.dirname(rmname))
+ host.transport.mkdir_recursive(os.path.dirname(rmname))
return False