diff options
author | John Mulligan <jmulligan@redhat.com> | 2024-11-01 19:38:11 +0100 |
---|---|---|
committer | John Mulligan <jmulligan@redhat.com> | 2024-11-04 21:38:43 +0100 |
commit | a529b234a24dceaee146907c6c3d57cc6944127b (patch) | |
tree | a3ed56c2c3a3a2c7e06dcf82dcd96360f2107d4b /src/cephadm | |
parent | cephadm: do not trigger rollback in bootstrap unit tests (diff) | |
download | ceph-a529b234a24dceaee146907c6c3d57cc6944127b.tar.xz ceph-a529b234a24dceaee146907c6c3d57cc6944127b.zip |
cephadm: mock a call to shutil.rmtree
Mock out calls to shutil.rmtree in test_deploy_and_rm_iscsi. The test
never asserts that things in the file system are removed, so making the
call a no-op is safe. Calling shutil.rmtree with the fake file system
enabled recently became a problem. In python 3.12 (or 3.11?) changes to
the shutil module function shutil.rmtree are incompatible with the fake
file system that cephadm tests rely upon heavily.
Part of an effort to get ceph tox environments passing on Python 3.12.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Diffstat (limited to 'src/cephadm')
-rw-r--r-- | src/cephadm/tests/test_deploy.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cephadm/tests/test_deploy.py b/src/cephadm/tests/test_deploy.py index 58f212beff6..c5094db335f 100644 --- a/src/cephadm/tests/test_deploy.py +++ b/src/cephadm/tests/test_deploy.py @@ -495,6 +495,7 @@ def test_deploy_ceph_exporter_container(cephadm_fs, funkypatch): def test_deploy_and_rm_iscsi(cephadm_fs, funkypatch): # Test that the deploy and remove paths for iscsi (which has sidecar container) # create and remove the correct unit files. + funkypatch.patch('shutil.rmtree') # fakefs + shutil.rmtree breaks on py3.12 mocks = _common_patches(funkypatch) _firewalld = mocks['Firewalld'] fsid = 'b01dbeef-701d-9abe-0000-e1e5a47004a7' |