]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: data_allocate_fraction translate test 40659/head
authorJonas Pfefferle <pepperjo@japf.ch>
Fri, 4 Jun 2021 11:22:46 +0000 (13:22 +0200)
committerJonas Pfefferle <pepperjo@japf.ch>
Fri, 4 Jun 2021 14:15:51 +0000 (16:15 +0200)
Add DriveGroupSpec translate test with data_allocate_fraction

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
src/python-common/ceph/tests/test_drive_group.py

index 76d343edada1b54c1796bcede2d407d5d299faad..0199a4519387045632156c7727aa5c11e24c87c3 100644 (file)
@@ -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'