test_filesystemgroup.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def test_cannot_save_volume_group_if_logical_volumes_larger(self):
        node = factory.make_Node()
        filesystem_one = factory.make_Filesystem(
            fstype=FILESYSTEM_TYPE.LVM_PV,
            block_device=factory.make_PhysicalBlockDevice(node=node))
        filesystem_two = factory.make_Filesystem(
            fstype=FILESYSTEM_TYPE.LVM_PV,
            block_device=factory.make_PhysicalBlockDevice(node=node))
        filesystems = [
            filesystem_one,
            filesystem_two,
        ]
        volume_group = factory.make_FilesystemGroup(
            group_type=FILESYSTEM_GROUP_TYPE.LVM_VG,
            filesystems=filesystems)
        factory.make_VirtualBlockDevice(
            size=volume_group.get_size(), filesystem_group=volume_group)
        filesystem_two.delete()
        with ExpectedException(
                ValidationError,
                re.escape(
                    "['Volume group cannot be smaller than its "
                    "logical volumes.']")):
            volume_group.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号