Commit 59a55622 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

New `heptapod-ssh-user` option

This will be useful for testing on remote servers, since we
can't know it in advance.

We could probably request the API for that
but we aren't at this point (and it would slow the tests down a bit).

The default value is 'git', though.
parent 5f890c68b50c
Pipeline #2363 passed with stage
in 30 seconds
......@@ -32,6 +32,7 @@ def pytest_addoption(parser):
"in Docker mode.")
parser.addoption('--heptapod-url', default='http://heptapod:81')
parser.addoption('--heptapod-ssh-port', type=int, default=2022)
parser.addoption('--heptapod-ssh-user', default='git')
parser.addoption('--heptapod-docker-container', default='heptapod')
parser.addoption('--heptapod-root-password', default='5iveL!fe')
......@@ -56,6 +57,7 @@ def heptapod(pytestconfig):
url = pytestconfig.getoption('heptapod_url')
common = dict(
url=url,
ssh_user=pytestconfig.getoption('heptapod_ssh_user'),
ssh_port=pytestconfig.getoption('heptapod_ssh_port'),
)
if pytestconfig.getoption('heptapod_source_install'):
......
......@@ -46,17 +46,19 @@ class Heptapod:
see :class:`DockerHeptapod` for an example.
"""
def __init__(self, url, ssh_port):
def __init__(self, url, ssh_user, ssh_port):
self.parsed_url = urlparse(url)
self.url = url
self.ssh_port = ssh_port
self.ssh_user = ssh_user
self.users = {}
self.dead = None
@property
def ssh_url(self):
return 'ssh://git@{host}:{port}'.format(
return 'ssh://{user}@{host}:{port}'.format(
host=self.host,
user=self.ssh_user,
port=self.ssh_port,
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment