test_filesystemgroup.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:maas 作者: maas 项目源码 文件源码
def test_add_partition_from_another_node_to_array_fails(self):
        node = factory.make_Node()
        other_node = factory.make_Node()
        device_size = 10 * 1000 ** 4
        block_devices = [
            factory.make_PhysicalBlockDevice(node=node, size=device_size)
            for _ in range(10)
        ]
        uuid = str(uuid4())
        raid = RAID.objects.create_raid(
            name='md0',
            level=FILESYSTEM_GROUP_TYPE.RAID_5,
            uuid=uuid,
            block_devices=block_devices)
        partition = factory.make_PartitionTable(
            block_device=factory.make_PhysicalBlockDevice(
                node=other_node, size=device_size)).add_partition()
        with ExpectedException(
                ValidationError,
                re.escape(
                    "['Partition must be on a device from the same node as "
                    "the rest of the array.']")):
            raid.add_partition(partition, FILESYSTEM_TYPE.RAID)
        self.assertEqual(10, raid.filesystems.count())  # Nothing added
        self.assertEqual(9 * device_size, raid.get_size())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号