Example #1
0
 def test_driveselection_to_ceph_volume(self, cephadm_module, devices, preview, exp_command):
     with with_host(cephadm_module, 'test'):
         dg = DriveGroupSpec(service_id='test.spec', placement=PlacementSpec(host_pattern='test'), data_devices=DeviceSelection(paths=devices))
         ds = DriveSelection(dg, Devices([Device(path) for path in devices]))
         preview = preview
         out = cephadm_module.osd_service.driveselection_to_ceph_volume(ds, [], preview)
         assert out in exp_command
Example #2
0
 def get_dg_spec(self, dg):
     dg_spec = DriveGroupSpec._from_json_impl(dg)
     dg_spec.validate()
     i = Inventory([])
     i.main()
     inventory = i.get_report()
     devices = [Device.from_json(i) for i in inventory]
     selection = DriveSelection(dg_spec, devices)
     return to_ceph_volume(selection)