]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: mock subprocess calls in tests that remove iscsi daemons
authorAdam King <adking@redhat.com>
Wed, 5 May 2021 17:59:54 +0000 (13:59 -0400)
committerSage Weil <sage@newdream.net>
Fri, 7 May 2021 18:57:49 +0000 (13:57 -0500)
tests that remove iscsi daemons use subprocess.run to make
a call to rados to clear out the gateway.conf. We don't want
the tests to actually make that call.

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit c5b984b10c2d6f2eef02e9dbf74aea64bf11f19a)

src/pybind/mgr/cephadm/tests/test_cephadm.py

index e15fe409d2339a81c55bda8156947538725a9497..1fcaa44b34920ef8229c7b69a01db126182da45e 100644 (file)
@@ -770,6 +770,7 @@ class TestCephadm(object):
                 assert_rm_daemon(cephadm_module, 'nfs.name.test', 'test')
 
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
+    @mock.patch("subprocess.run", None)
     @mock.patch("cephadm.module.CephadmOrchestrator.rados", mock.MagicMock())
     def test_iscsi(self, cephadm_module):
         with with_host(cephadm_module, 'test'):
@@ -909,6 +910,7 @@ class TestCephadm(object):
         ]
     )
     @mock.patch("cephadm.serve.CephadmServe._deploy_cephadm_binary", _deploy_cephadm_binary('test'))
+    @mock.patch("subprocess.run", None)
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
     def test_apply_save(self, spec: ServiceSpec, meth, cephadm_module: CephadmOrchestrator):
         with with_host(cephadm_module, 'test'):