Skip to content

Commit

Permalink
Merge pull request #31523 from sebastian-philipp/ssh-make-check
Browse files Browse the repository at this point in the history
mgr/ssh: add make check integration

Reviewed-by: Thomas Bechtold <tbechtold@suse.com>
  • Loading branch information
sebastian-philipp committed Nov 15, 2019
2 parents a509729 + c7bb0ec commit 3948df8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/pybind/mgr/ssh/__init__.py
@@ -1 +1,6 @@
from .module import SSHOrchestrator
import os

if 'UNITTEST' in os.environ:
import tests

from .module import SSHOrchestrator
Empty file.
15 changes: 15 additions & 0 deletions src/pybind/mgr/ssh/tests/test_ssh.py
@@ -0,0 +1,15 @@
from orchestrator import ServiceDescription
from ..module import SSHOrchestrator
from tests import mock


@mock.patch("ssh.module.SSHOrchestrator.get_ceph_option", lambda _,key: __file__)
def test_get_unique_name():
o = SSHOrchestrator('module_name', 0, 0)
existing = [
ServiceDescription(service_instance='mon.a')
]
new_mon = o.get_unique_name(existing, 'mon')
assert new_mon.startswith('mon.')
assert new_mon != 'mon.a'

2 changes: 1 addition & 1 deletion src/pybind/mgr/tox.ini
Expand Up @@ -5,4 +5,4 @@ skipsdist = true
[testenv]
setenv = UNITTEST = true
deps = -rrequirements.txt
commands = pytest --cov --cov-append --cov-report=term --doctest-modules {posargs:mgr_util.py tests/}
commands = pytest --cov --cov-append --cov-report=term --doctest-modules {posargs:mgr_util.py tests/ ssh/}

0 comments on commit 3948df8

Please sign in to comment.