]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Potential fix for pull request finding
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 26 May 2026 14:22:06 +0000 (16:22 +0200)
committerGitHub <noreply@github.com>
Tue, 26 May 2026 14:22:06 +0000 (16:22 +0200)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/ceph-volume/ceph_volume/tests/util/test_disk.py

index 317b4afe4468d26916217eb2de95211978edcbf8..7082c27d179ae7fb07eb5bbb51f916465ff1dec3 100644 (file)
@@ -133,9 +133,14 @@ class TestBackingDeviceIsRotational(object):
         fake_filesystem.create_file('/sys/block/dm-0/queue/rotational', contents='0')
         assert disk.BackingDeviceRotation.is_rotational('/dev/dm-0') is True
 
+    @patch('ceph_volume.util.disk._kname_for_sysfs_walk', side_effect=lambda kname: kname)
     @patch('ceph_volume.util.disk.os.path.exists', return_value=True)
     @patch('ceph_volume.util.disk.UdevData')
-    def test_leaf_block_uses_udev_hints(self, m_udev, _m_exists):
+    def test_leaf_block_uses_udev_hints(
+            self, m_udev, _m_exists, _m_kname_for_sysfs_walk, fake_filesystem):
+        fake_filesystem.create_dir('/sys/block/sda')
+        fake_filesystem.create_dir('/sys/block/sdb')
+
         m_udev.return_value.environment = {'ID_SSD': '1'}
         assert disk.BackingDeviceRotation._leaf_block_is_rotational('sda') is False