From 696dfbc1cf98eeb0de70abc87cc4984c6922e3d6 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 20 Jul 2021 23:36:20 -0400 Subject: [PATCH] mgr/cephadm: rewrite test_etc_ceph to apply to asyncssh Fixes: https://tracker.ceph.com/issues/44676 Signed-off-by: Melissa Li --- src/pybind/mgr/cephadm/tests/test_cephadm.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index f6747fd54fa..014cf050ca2 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 -- 2.39.5