From: Melissa Date: Wed, 21 Jul 2021 03:36:20 +0000 (-0400) Subject: mgr/cephadm: rewrite test_etc_ceph to apply to asyncssh X-Git-Tag: v17.1.0~1051^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=696dfbc1cf98eeb0de70abc87cc4984c6922e3d6;p=ceph.git mgr/cephadm: rewrite test_etc_ceph to apply to asyncssh Fixes: https://tracker.ceph.com/issues/44676 Signed-off-by: Melissa Li --- diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index f6747fd54faa..014cf050ca26 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -1131,14 +1131,15 @@ spec: assert len(cephadm_module.cache.get_daemons_by_type('mgr')) == 3 assert len(cephadm_module.cache.get_daemons_by_type('crash')) == 1 - - @mock.patch("cephadm.module.CephadmOrchestrator._get_connection") - @mock.patch("remoto.process.check") - @mock.patch("cephadm.module.CephadmServe._write_remote_file") - def test_etc_ceph(self, _write_file, _check, _get_connection, cephadm_module): - _get_connection.return_value = mock.Mock(), mock.Mock() - _check.return_value = '{}', '', 0 + @mock.patch("cephadm.ssh.SSHManager.remote_connection") + @mock.patch("cephadm.ssh.SSHManager.execute_command") + @mock.patch("cephadm.ssh.SSHManager.check_execute_command") + @mock.patch("cephadm.ssh.SSHManager.write_remote_file") + def test_etc_ceph(self, _write_file, check_execute_command, execute_command, remote_connection, cephadm_module): _write_file.return_value = None + check_execute_command.return_value = '' + execute_command.return_value = '{}', '', 0 + remote_connection.return_value = mock.Mock() assert cephadm_module.manage_etc_ceph_ceph_conf is False