]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: mock subprocess calls in tests that remove iscsi daemons 41181/head
authorAdam King <adking@redhat.com>
Wed, 5 May 2021 17:59:54 +0000 (13:59 -0400)
committerAdam King <adking@redhat.com>
Wed, 5 May 2021 17:59:54 +0000 (13:59 -0400)
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>
src/pybind/mgr/cephadm/tests/test_cephadm.py

index 83df09ff4c7733f468d1468c5141b5fbdd486ab0..2fea77eb3cba9ad252333c7e6a674b60fa9291d7 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'):