From 47620961fe8eb9ec859b33bd0480a698e655af69 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 27 Jul 2018 15:09:07 -0700 Subject: 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 Closes: #1199 Approved by: rhatdan --- contrib/python/podman/test/test_tunnel.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'contrib/python/podman/test/test_tunnel.py') 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) -- cgit v1.2.3-54-g00ecf