def testComputeDisksInfoPlainToDrbd(self): disks = [{constants.IDISK_SIZE: d.size, constants.IDISK_MODE: d.mode, constants.IDISK_VG: d.logical_id[0], constants.IDISK_NAME: d.name} for d in self.disks] disks_info = instance_storage.ComputeDisksInfo(self.disks, constants.DT_DRBD8, self.default_vg, {}) self.assertEqual(disks, disks_info)
def testComputeDisksInfo(self): """Test instance_storage.ComputeDisksInfo() method""" disks_info = instance_storage.ComputeDisksInfo(self.disks, constants.DT_EXT, self.default_vg, self.ext_params) for disk, d in zip(disks_info, self.disks): self.assertEqual(disk.get("size"), d.size) self.assertEqual(disk.get("mode"), d.mode) self.assertEqual(disk.get("name"), d.name) self.assertEqual(disk.get("param1"), self.ext_params.get("param1")) self.assertEqual(disk.get("param2"), self.ext_params.get("param2")) self.assertEqual(disk.get("provider"), self.ext_params.get("provider"))