diff options
Diffstat (limited to 'src/python-common/ceph/tests/test_drive_group.py')
-rw-r--r-- | src/python-common/ceph/tests/test_drive_group.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/python-common/ceph/tests/test_drive_group.py b/src/python-common/ceph/tests/test_drive_group.py index 77e9b4083..cd4a238af 100644 --- a/src/python-common/ceph/tests/test_drive_group.py +++ b/src/python-common/ceph/tests/test_drive_group.py @@ -392,8 +392,12 @@ def test_ceph_volume_command_12(test_input2): drive = drive_selection.DriveSelection(spec, spec.data_devices.paths) cmds = translate.to_ceph_volume(drive, []).run() - assert (cmds[0] == 'lvm batch --no-auto /dev/sdb --crush-device-class ssd --yes --no-systemd') # noqa E501 - assert (cmds[1] == 'lvm batch --no-auto /dev/sda --crush-device-class hdd --yes --no-systemd') # noqa E501 + expected_cmds = [ + 'lvm batch --no-auto /dev/sdb --crush-device-class ssd --yes --no-systemd', + 'lvm batch --no-auto /dev/sda --crush-device-class hdd --yes --no-systemd', + ] + assert len(cmds) == len(expected_cmds), f"Expected {expected_cmds} got {cmds}" + assert all(cmd in cmds for cmd in expected_cmds), f'Expected {expected_cmds} got {cmds}' @pytest.mark.parametrize("test_input3", @@ -418,8 +422,12 @@ def test_ceph_volume_command_13(test_input3): drive = drive_selection.DriveSelection(spec, spec.data_devices.paths) cmds = translate.to_ceph_volume(drive, []).run() - assert (cmds[0] == 'lvm batch --no-auto /dev/sdb --yes --no-systemd') # noqa E501 - assert (cmds[1] == 'lvm batch --no-auto /dev/sda --crush-device-class hdd --yes --no-systemd') # noqa E501 + expected_cmds = [ + 'lvm batch --no-auto /dev/sdb --yes --no-systemd', + 'lvm batch --no-auto /dev/sda --crush-device-class hdd --yes --no-systemd', + ] + assert len(cmds) == len(expected_cmds), f"Expected {expected_cmds} got {cmds}" + assert all(cmd in cmds for cmd in expected_cmds), f'Expected {expected_cmds} got {cmds}' @pytest.mark.parametrize("test_input4", |