From: Sage Weil Date: Tue, 11 Feb 2020 16:40:46 +0000 (-0600) Subject: mgr/orch: test remove_daemons and remove_service X-Git-Tag: v15.1.1~425^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=284cf17e6702ef87e47eb0488ca78b3550ab2348;p=ceph.git mgr/orch: test remove_daemons and remove_service Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index 9b53e701881d..f555cbf6205a 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -151,7 +151,7 @@ class TestCephadm(object): with self._with_host(cephadm_module, 'test'): c = cephadm_module.list_daemons(refresh=True) wait(cephadm_module, c) - c = cephadm_module.remove_osds(['0']) + c = cephadm_module.remove_daemons(['osd.0']) out = wait(cephadm_module, c) assert out == ["Removed osd.0 from host 'test'"] @@ -253,11 +253,11 @@ class TestCephadm(object): ) ]) )) - def test_remove_rgw(self, cephadm_module): + def test_remove_service(self, cephadm_module): with self._with_host(cephadm_module, 'test'): c = cephadm_module.list_daemons(refresh=True) wait(cephadm_module, c) - c = cephadm_module.remove_rgw('myrgw') + c = cephadm_module.remove_service('rgw', 'myrgw') out = wait(cephadm_module, c) assert out == ["Removed rgw.myrgw.foobar from host 'test'"] diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 9957573ef980..4dcd847eb912 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -212,9 +212,14 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): ) - @deferred_write("remove_osds") - def remove_osds(self, osd_ids, destroy=False): - assert isinstance(osd_ids, list) + @deferred_write("remove_daemons") + def remove_daemons(self, names): + assert isinstance(names, list) + + @deferred_write("remove_service") + def remove_service(self, service_type, service_name): + assert isinstance(service_type, str) + assert isinstance(service_name, str) @deferred_write("blink_device_light") def blink_device_light(self, ident_fault, on, locations): @@ -231,10 +236,6 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): # type: (orchestrator.NFSServiceSpec) -> None assert isinstance(spec.pool, str) - @deferred_write("remove_nfs") - def remove_nfs(self, name): - pass - @deferred_write("update_nfs") def update_nfs(self, spec): pass @@ -243,19 +244,10 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): def add_mds(self, spec): pass - @deferred_write("remove_mds") - def remove_mds(self, name): - pass - @deferred_write("add_rgw") def add_rgw(self, spec): pass - @deferred_write("remove_rgw") - def remove_rgw(self, zone): - pass - - @deferred_read def get_hosts(self): if self._inventory: