def test_initgateway_ssh_and_remotepath(self): |
option = py.test.config.option |
if option.sshtarget is None: |
-> py.test.skip("no known ssh target, use -S to set one") |
host = HostInfo("%s" % (option.sshtarget, )) |
|
|
|
host.initgateway() |
assert host.gw |
assert host.gw_remotepath.endswith(host.relpath) |
channel = host.gw.remote_exec(""" |
import os |
homedir = os.environ['HOME'] |
relpath = channel.receive() |
path = os.path.join(homedir, relpath) |
channel.send(path) |
""") |
channel.send(host.relpath) |
res = channel.receive() |
assert res == host.gw_remotepath |