summaryrefslogtreecommitdiff
path: root/contrib/python/podman/test/test_tunnel.py
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2018-07-27 15:09:07 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-05 11:06:18 +0000
commit47620961fe8eb9ec859b33bd0480a698e655af69 (patch)
treebf16c8cbed80701c54971a2b420066607c973536 /contrib/python/podman/test/test_tunnel.py
parenta1e3e542fff562d885354c55f04e0b7f5097a39b (diff)
downloadpodman-47620961fe8eb9ec859b33bd0480a698e655af69.tar.gz
podman-47620961fe8eb9ec859b33bd0480a698e655af69.tar.bz2
podman-47620961fe8eb9ec859b33bd0480a698e655af69.zip
Port to MacOS
* Refactor Tunnel to support selecting port for remote sshd * Refactor ssh tunnel to support MacOS version of ssh * Refactor Tunnel.close() to find and kill off zombie siblings * Add psutil dependency * Add logging setup, letting library produce debugging records * Clean up Tunnel API * Fix test_runner.sh to propagate returncode to caller Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1199 Approved by: rhatdan
Diffstat (limited to 'contrib/python/podman/test/test_tunnel.py')
-rw-r--r--contrib/python/podman/test/test_tunnel.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/python/podman/test/test_tunnel.py b/contrib/python/podman/test/test_tunnel.py
index 719a2f9a4..ed23fd905 100644
--- a/contrib/python/podman/test/test_tunnel.py
+++ b/contrib/python/podman/test/test_tunnel.py
@@ -4,7 +4,6 @@ import time
import unittest
from unittest.mock import MagicMock, patch
-import podman
from podman.libs.tunnel import Context, Portal, Tunnel
@@ -60,20 +59,22 @@ class TestTunnel(unittest.TestCase):
'/run/podman/socket',
'user',
'hostname',
+ None,
'~/.ssh/id_rsa',
)
- tunnel = Tunnel(context).bore('unix:/01')
+ tunnel = Tunnel(context).bore()
cmd = [
'ssh',
- '-fNTq',
+ '-fNT',
+ '-q',
'-L',
'{}:{}'.format(context.local_socket, context.remote_socket),
'-i',
context.identity_file,
- 'ssh://{}@{}'.format(context.username, context.hostname),
+ '{}@{}'.format(context.username, context.hostname),
]
- mock_finalize.assert_called_once_with(tunnel, tunnel.close, 'unix:/01')
+ mock_finalize.assert_called_once_with(tunnel, tunnel.close)
mock_exists.assert_called_once_with(context.local_socket)
mock_Popen.assert_called_once_with(cmd, close_fds=True)