def test_cannot_save_raid_0_with_spare_raid_devices(self):
node = factory.make_Node()
filesystems = [
factory.make_Filesystem(
fstype=FILESYSTEM_TYPE.RAID,
block_device=factory.make_PhysicalBlockDevice(node=node))
for _ in range(2)
]
filesystems.append(
factory.make_Filesystem(
fstype=FILESYSTEM_TYPE.RAID_SPARE,
block_device=factory.make_PhysicalBlockDevice(node=node)))
with ExpectedException(
ValidationError,
re.escape(
"{'__all__': ['RAID level 0 must have at least 2 raid "
"devices and no spares.']}")):
factory.make_FilesystemGroup(
group_type=FILESYSTEM_GROUP_TYPE.RAID_0,
filesystems=filesystems)
评论列表
文章目录