def test_create_raid_with_block_device_from_other_node_fails(self):
node1 = factory.make_Node()
node2 = factory.make_Node()
block_devices_1 = [
factory.make_PhysicalBlockDevice(node=node1)
for _ in range(5)
]
block_devices_2 = [
factory.make_PhysicalBlockDevice(node=node2)
for _ in range(5)
]
uuid = str(uuid4())
with ExpectedException(
ValidationError,
re.escape(
"{'__all__': ['All added filesystems must belong to the "
"same node.']}")):
RAID.objects.create_raid(
name='md0',
level=FILESYSTEM_GROUP_TYPE.RAID_1,
uuid=uuid,
block_devices=block_devices_1 + block_devices_2,
partitions=[],
spare_devices=[],
spare_partitions=[])
评论列表
文章目录