From: Nizamudeen A Date: Fri, 19 Jul 2024 13:44:36 +0000 (+0530) Subject: mgr/test_orchestrator: add apply_mds command in the test_orch X-Git-Tag: testing/wip-vshankar-testing-20240725.121331-debug~20^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=90bc35499eb959aa0dcbe63d89d8b6e0c5d3d8b9;p=ceph-ci.git mgr/test_orchestrator: add apply_mds command in the test_orch so that when we are testing things with test_orchestrator as the orch back-end and do volume creation, it won't raise the below error ``` 2024-07-19T13:40:46.349+0000 7f2d11a00640 0 [test_orchestrator ERROR orchestrator._interface] Traceback (most recent call last): File "/ceph/src/pybind/mgr/orchestrator/_interface.py", line 139, in wrapper return OrchResult(f(*args, **kwargs)) File "/ceph/src/pybind/mgr/orchestrator/_interface.py", line 618, in apply return raise_if_exception(reduce(merge, [fns[spec.service_type](spec) for spec in specs], OrchResult([]))) File "/ceph/src/pybind/mgr/orchestrator/_interface.py", line 618, in return raise_if_exception(reduce(merge, [fns[spec.service_type](spec) for spec in specs], OrchResult([]))) File "/ceph/src/pybind/mgr/orchestrator/_interface.py", line 762, in apply_mds raise NotImplementedError() NotImplementedError 2024-07-19T13:40:46.349+0000 7f2d11a00640 0 [volumes ERROR volumes.fs.fs_util] Failed to create MDS daemons Traceback (most recent call last): File "/ceph/src/pybind/mgr/volumes/fs/fs_util.py", line 55, in create_mds orchestrator.raise_if_exception(completion) File "/ceph/src/pybind/mgr/orchestrator/_interface.py", line 242, in raise_if_exception raise e NotImplementedError 2024-07-19T13:40:46.350+0000 7f2d11a00640 0 [volumes INFO volumes.module] Finishing _cmd_fs_volume_create(name:foo, placement:1 ) < "None" 2024-07-19T13:40:46.350+0000 7f2d11a00640 0 [dashboard ERROR exception] Internal Server Error Traceback (most recent call last): File "/ceph/src/pybind/mgr/dashboard/services/exception.py", line 47, in dashboard_exception_handler return handler(*args, **kwargs) File "/usr/lib/python3.9/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__ return self.callable(*self.args, **self.kwargs) File "/ceph/src/pybind/mgr/dashboard/controllers/_base_controller.py", line 263, in inner ret = func(*args, **kwargs) File "/ceph/src/pybind/mgr/dashboard/controllers/_rest_controller.py", line 193, in wrapper return func(*vpath, **params) File "/ceph/src/pybind/mgr/dashboard/controllers/cephfs.py", line 65, in create raise RuntimeError( RuntimeError: Error creating volume foo with placement {'placement': {}, 'unmanaged': False}: ``` Fixes: https://tracker.ceph.com/issues/67044 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index a0721250c7f..7e63eda86f7 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -304,3 +304,11 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): assert all([isinstance(h[0], str) for h in spec.placement.hosts]) assert all([isinstance(h[1], str) or h[1] is None for h in spec.placement.hosts]) return spec.one_line_str() + + @handle_orch_error + def apply_mds(self, spec): + #type: (ServiceSpec) -> str + + assert not spec.placement.hosts or len(spec.placement.hosts) == spec.placement.count + assert all([isinstance(h, str) for h in spec.placement.hosts]) + return spec.one_line_str()