diff options
author | John Mulligan <jmulligan@redhat.com> | 2023-11-05 22:03:53 +0100 |
---|---|---|
committer | John Mulligan <jmulligan@redhat.com> | 2023-11-30 22:55:59 +0100 |
commit | eca9be6544d86d1ee1a384898dcc86c098405d24 (patch) | |
tree | 84daca07a94c8874a39324d22bd4b4ed048a3521 /src/cephadm/tests/test_cephadm.py | |
parent | cephadm: convert test_mon_crush_location to use funkypatch fixture (diff) | |
download | ceph-eca9be6544d86d1ee1a384898dcc86c098405d24.tar.xz ceph-eca9be6544d86d1ee1a384898dcc86c098405d24.zip |
cephadm: create deployment_utils module
Create a deployment_utils module for deployment related functions that
don't have a better home.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Diffstat (limited to 'src/cephadm/tests/test_cephadm.py')
-rw-r--r-- | src/cephadm/tests/test_cephadm.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cephadm/tests/test_cephadm.py b/src/cephadm/tests/test_cephadm.py index 6379ce28a1d..c5d8d19f26d 100644 --- a/src/cephadm/tests/test_cephadm.py +++ b/src/cephadm/tests/test_cephadm.py @@ -318,13 +318,17 @@ class TestCephAdm(object): with pytest.raises(Exception): _cephadm.prepare_dashboard(ctx, 0, 0, lambda _, extra_mounts=None, ___=None : '5', lambda : None) - @mock.patch('cephadm.logger') - @mock.patch('cephadm.fetch_custom_config_files') - @mock.patch('cephadm.get_container') - def test_to_deployment_container(self, _get_container, _get_config, _logger): + def test_to_deployment_container(self, funkypatch): """ test to_deployment_container properly makes use of extra container args and custom conf files """ + from cephadmlib.deployment_utils import to_deployment_container + + funkypatch.patch('cephadm.logger') + _get_config = funkypatch.patch( + 'cephadmlib.deployment_utils.fetch_custom_config_files' + ) + _get_container = funkypatch.patch('cephadm.get_container') ctx = _cephadm.CephadmContext() ctx.config_json = '-' @@ -358,7 +362,7 @@ class TestCephAdm(object): host_network=True, ) c = _cephadm.get_container(ctx, ident) - c = _cephadm.to_deployment_container(ctx, c) + c = to_deployment_container(ctx, c) assert '--pids-limit=12345' in c.container_args assert '--something' in c.container_args |