]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/test_orchestrator: add apply_mds command in the test_orch 58677/head
authorNizamudeen A <nia@redhat.com>
Fri, 19 Jul 2024 13:44:36 +0000 (19:14 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 19 Jul 2024 13:44:36 +0000 (19:14 +0530)
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 <listcomp>
    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 <nia@redhat.com>
src/pybind/mgr/test_orchestrator/module.py

index a0721250c7f90fb0089bca7ef68d317ebd031b9d..7e63eda86f7e73424416c06e79ba29eb6f173dcf 100644 (file)
@@ -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()