From: Joshua Blanch Date: Wed, 19 Feb 2025 23:18:50 +0000 (+0000) Subject: cephadm/tests: update daemon_action tests with force flag X-Git-Tag: testing/wip-pdonnell-testing-20250227.172146-debug~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=891225014fd58c032f9f9445eaa71725a0348086;p=ceph-ci.git cephadm/tests: update daemon_action tests with force flag Signed-off-by: Joshua Blanch --- diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index 22bd26def91..48e58d9fc78 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -394,11 +394,19 @@ class TestCephadm(object): assert wait(cephadm_module, c) == f"Scheduled to redeploy rgw.{daemon_id} on host 'test'" - for what in ('start', 'stop', 'restart'): + for what in ('start', 'stop'): c = cephadm_module.daemon_action(what, d_name) assert wait(cephadm_module, c) == F"Scheduled to {what} {d_name} on host 'test'" + for what in ('start', 'stop', 'restart'): + c = cephadm_module.daemon_action(what, d_name, force=True) + assert wait(cephadm_module, + c) == F"Scheduled to {what} {d_name} on host 'test'" + + with pytest.raises(OrchestratorError, match=f"Unable to restart daemon {d_name}"): + c = cephadm_module.daemon_action('restart', d_name) + wait(cephadm_module, c) # Make sure, _check_daemons does a redeploy due to monmap change: cephadm_module._store['_ceph_get/mon_map'] = { 'modified': datetime_to_str(datetime_now()),