def test_cannot_save_bcache_without_cache_set(self):
node = factory.make_Node()
filesystems = [
factory.make_Filesystem(
fstype=FILESYSTEM_TYPE.BCACHE_BACKING,
block_device=factory.make_PhysicalBlockDevice(node=node)),
]
with ExpectedException(
ValidationError,
re.escape(
"{'__all__': ['Bcache requires an assigned cache "
"set.']}")):
filesystem_group = factory.make_FilesystemGroup(
group_type=FILESYSTEM_GROUP_TYPE.BCACHE,
filesystems=filesystems)
filesystem_group.cache_set = None
filesystem_group.save()
评论列表
文章目录