From 6a41314cd17b2ecfc7bf4f41eda01ea162a06978 Mon Sep 17 00:00:00 2001 From: Jonas Pfefferle Date: Fri, 4 Jun 2021 13:22:46 +0200 Subject: [PATCH] python-common: data_allocate_fraction translate test Add DriveGroupSpec translate test with data_allocate_fraction Signed-off-by: Jonas Pfefferle --- src/python-common/ceph/tests/test_drive_group.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/python-common/ceph/tests/test_drive_group.py b/src/python-common/ceph/tests/test_drive_group.py index 76d343edada1b..0199a45193870 100644 --- a/src/python-common/ceph/tests/test_drive_group.py +++ b/src/python-common/ceph/tests/test_drive_group.py @@ -253,3 +253,16 @@ def test_ceph_volume_command_8(): sel = drive_selection.DriveSelection(spec, inventory) cmd = translate.to_ceph_volume(sel, []).run() assert cmd == 'lvm batch --no-auto /dev/sda /dev/sdb --db-devices /dev/sdc --yes --no-systemd' + + +def test_ceph_volume_command_9(): + spec = DriveGroupSpec(placement=PlacementSpec(host_pattern='*'), + service_id='foobar', + data_devices=DeviceSelection(all=True), + data_allocate_fraction=0.8 + ) + spec.validate() + inventory = _mk_inventory(_mk_device()*2) + sel = drive_selection.DriveSelection(spec, inventory) + cmd = translate.to_ceph_volume(sel, []).run() + assert cmd == 'lvm batch --no-auto /dev/sda /dev/sdb --data-allocate-fraction 0.8 --yes --no-systemd' -- 2.39.5