Skip to content

Commit

Permalink
tests: Standardise on DockerizedSshDaemon.host & .port
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Oct 10, 2024
1 parent c45b13b commit 9859e44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/ssh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_stream_name(self):
password='has_sudo_password',
)
name = 'ssh.%s:%s' % (
self.dockerized_ssh.get_host(),
self.dockerized_ssh.host,
self.dockerized_ssh.port,
)
self.assertEqual(name, context.name)
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_verbose_enabled(self):
ssh_debug_level=3,
)
name = 'ssh.%s:%s' % (
self.dockerized_ssh.get_host(),
self.dockerized_ssh.host,
self.dockerized_ssh.port,
)
self.assertEqual(name, context.name)
Expand Down
7 changes: 2 additions & 5 deletions tests/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,11 @@ def __init__(self, distro=DISTRO, image_template=IMAGE_TEMPLATE):

self.image = image_template % d
self.start_container()
self.host = self.get_host()
self.host = get_docker_host()
self.port = self.get_port(self.container_name)

def get_host(self):
return get_docker_host()

def wait_for_sshd(self):
wait_for_port(self.get_host(), self.port, pattern='OpenSSH')
wait_for_port(self.host, self.port, pattern='OpenSSH')

def check_processes(self):
# Get Accounting name (ucomm) & command line (args) of each process
Expand Down

0 comments on commit 9859e44

Please sign in to comment.