mgr/orch: allow MDS with explicit naming#35142
Merged
sebastian-philipp merged 4 commits intoceph:masterfrom May 25, 2020
Merged
mgr/orch: allow MDS with explicit naming#35142sebastian-philipp merged 4 commits intoceph:masterfrom
sebastian-philipp merged 4 commits intoceph:masterfrom
Conversation
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Fixes: https://tracker.ceph.com/issues/45617 Signed-off-by: Michael Fritch <mfritch@suse.com>
Signed-off-by: Michael Fritch <mfritch@suse.com>
Contributor
|
can you add this as well? diff --git a/src/pybind/mgr/cephadm/__init__.py b/src/pybind/mgr/cephadm/__init__.py
index f390f18c16..9a9f074321 100644
--- a/src/pybind/mgr/cephadm/__init__.py
+++ b/src/pybind/mgr/cephadm/__init__.py
@@ -2,5 +2,6 @@ import os
if 'UNITTEST' in os.environ:
import tests
+ tests.mock_ceph_modules() # type: ignore
from .module import CephadmOrchestrator
diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py
index 8287fbe6b7..3144c50191 100644
--- a/src/pybind/mgr/cephadm/tests/test_cephadm.py
+++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py
@@ -15,7 +15,7 @@ except ImportError:
from execnet.gateway_bootstrap import HostNotFound
from ceph.deployment.service_spec import ServiceSpec, PlacementSpec, RGWSpec, \
- NFSServiceSpec, IscsiServiceSpec
+ NFSServiceSpec, IscsiServiceSpec, HostPlacementSpec
from ceph.deployment.drive_selection.selector import DriveSelection
from ceph.deployment.inventory import Devices, Device
from orchestrator import ServiceDescription, DaemonDescription, InventoryHost, \
@@ -456,18 +456,36 @@ class TestCephadm(object):
(ServiceSpec('rbd-mirror'), CephadmOrchestrator.apply_rbd_mirror),
(ServiceSpec('mds', service_id='fsname'), CephadmOrchestrator.apply_mds),
(RGWSpec(rgw_realm='realm', rgw_zone='zone'), CephadmOrchestrator.apply_rgw),
+ (RGWSpec(
+ rgw_realm='realm', rgw_zone='zone',
+ placement=PlacementSpec(
+ hosts=[HostPlacementSpec(
+ hostname='test',
+ name='realm.zone.a',
+ network=''
+ )]
+ )
+ ), CephadmOrchestrator.apply_rgw),
(NFSServiceSpec('name', pool='pool', namespace='namespace'), CephadmOrchestrator.apply_nfs),
(IscsiServiceSpec('name', pool='pool'), CephadmOrchestrator.apply_iscsi),
]
)
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
- def test_apply_save(self, spec: ServiceSpec, meth, cephadm_module):
+ def test_apply_save(self, spec: ServiceSpec, meth, cephadm_module: CephadmOrchestrator):
with self._with_host(cephadm_module, 'test'):
- spec.placement = PlacementSpec(hosts=['test'], count=1)
+ if not spec.placement:
+ spec.placement = PlacementSpec(hosts=['test'], count=1)
c = meth(cephadm_module, spec)
assert wait(cephadm_module, c) == f'Scheduled {spec.service_name()} update...'
assert [d.spec for d in wait(cephadm_module, cephadm_module.describe_service())] == [spec]
+ cephadm_module._apply_all_services()
+
+ dds = wait(cephadm_module, cephadm_module.list_daemons())
+ for dd in dds:
+ assert dd.service_name() == spec.service_name()
+
+
assert_rm_service(cephadm_module, spec.service_name())
diff --git a/src/pybind/mgr/tests/__init__.py b/src/pybind/mgr/tests/__init__.py
index fb6d69e011..7bccfc7997 100644
--- a/src/pybind/mgr/tests/__init__.py
+++ b/src/pybind/mgr/tests/__init__.py
@@ -54,6 +54,8 @@ if 'UNITTEST' in os.environ:
self._ceph_get_version = mock.Mock()
self._ceph_get = mock.MagicMock()
self._ceph_get_option = mock.MagicMock()
+ self._ceph_get_context = mock.MagicMock()
+ self._ceph_register_client = mock.MagicMock()
self._configure_logging = lambda *_: None
self._unconfigure_logging = mock.MagicMock()
self._ceph_log = mock.MagicMock() |
Signed-off-by: Michael Fritch <mfritch@suse.com>
Contributor
Author
also added an MDS test to the applied diff |
Contributor
Author
sebastian-philipp
approved these changes
May 25, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explicitly naming an mds:
Breaks the
lscommand:Fixes: https://tracker.ceph.com/issues/45617
Signed-off-by: Michael Fritch mfritch@suse.com
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox