File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,7 +451,15 @@ def test_unmount_error_does_not_cause_content_deletion(
451451 # It is assumed that the device is still mounted, since the unmounting is mocked to
452452 # fail.
453453 mounts = sdm .get_mounted_devices ()
454- mount_of_device = next (iter (mounts [str (config .map_name ())]))
454+ # In some environments (e.g. Docker) the device mapper node appears as /dev/dm-X in
455+ # the mount table rather than /dev/mapper/{UUID}. Search all mount points for the
456+ # one containing BackupRepositoryFolder instead of looking up by device path.
457+ mount_of_device = next (
458+ mount_point
459+ for mount_points in mounts .values ()
460+ for mount_point in mount_points
461+ if (mount_point / config .BackupRepositoryFolder ).exists ()
462+ )
455463 expected_backup_repository = mount_of_device / config .BackupRepositoryFolder
456464 assert expected_backup_repository .exists ()
457465 assert expected_backup_repository .is_dir ()
You can’t perform that action at this time.
0 commit comments