tests/ceph-disk: Using dummy device mappers
When doing a make test, if your local setup was running a "dm-0" or "dm-1",
the make check was failing.
The detection of the local "dm-x" were leading to a wrong comparaison with
the expected simulated values.
The fix is using a dummy name for that "dm" to prevent any collision with the local setup.
Prior that patch, a typical output of that error looked like :
> assert expect == main.list_devices()
E assert [{'partitions...: '/dev/Xda'}] == [{'partitions'...: '/dev/Xda'}]
E At index 0 diff: {'partitions': [{'dmcrypt': {'holders': ['dm-0'], 'type': 'plain'}, 'ptype': '
4fbd7e29-9d25-41b8-afd0-
5ec00ceff05d', 'path': '/dev/Xda1', 'is_partition': True, 'mount': None, 'uuid': '
56244cf5-83ef-4984-888a-
2d8b8e0e04b2', 'type': 'data', 'state': 'unprepared', 'fs_type': None}], 'path': '/dev/Xda'} != {'partitions': [{'ptype': '
4fbd7e29-9d25-41b8-afd0-
5ec00ceff05d', 'whoami': None, 'path': '/dev/Xda1', 'is_partition': True, 'mount': '/var/cache/ccache', 'uuid': '
56244cf5-83ef-4984-888a-
2d8b8e0e04b2', 'ceph_fsid': None, 'fs_type': 'btrfs', 'dmcrypt': {'holders': ['dm-0'], 'type': 'plain'}, 'type': 'data', 'state': 'active'}], 'path': '/dev/Xda'}
E Full diff:
E - [{'partitions': [{'dmcrypt': {'holders': ['dm-0'], 'type': 'plain'},
E + [{'partitions': [{'ceph_fsid': None,
E + 'dmcrypt': {'holders': ['dm-0'], 'type': 'plain'},
E - 'fs_type': None,
E ? ^^^^
E + 'fs_type': 'btrfs',
E ? ^^^^^^^
E 'is_partition': True,
E - 'mount': None,
E + 'mount': '/var/cache/ccache',
E 'path': '/dev/Xda1',
E 'ptype': '
4fbd7e29-9d25-41b8-afd0-
5ec00ceff05d',
E - 'state': 'unprepared',
E ? ^^^^ -----
E + 'state': 'active',
E ? ^^^^^
E 'type': 'data',
E - 'uuid': '
56244cf5-83ef-4984-888a-
2d8b8e0e04b2'}],
E ? --
E + 'uuid': '
56244cf5-83ef-4984-888a-
2d8b8e0e04b2',
E + 'whoami': None}],
E 'path': '/dev/Xda'}]
tests/test_main.py:342: AssertionError
Signed-off-by: Erwan Velu <erwan@redhat.com>