]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: rewrite test_etc_ceph to apply to asyncssh
authorMelissa <li.melissa.kun@gmail.com>
Wed, 21 Jul 2021 03:36:20 +0000 (23:36 -0400)
committerMelissa Li <li.melissa.kun@gmail.com>
Fri, 20 Aug 2021 18:27:46 +0000 (14:27 -0400)
Fixes: https://tracker.ceph.com/issues/44676
Signed-off-by: Melissa Li <li.melissa.kun@gmail.com>
src/pybind/mgr/cephadm/tests/test_cephadm.py

index f6747fd54faa9b0ee9fbd3402448c928346dddcc..014cf050ca269fa3a0c628b49ffd8407f19221d4 100644 (file)
@@ -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