def test_cannot_save_bcache_with_multiple_backings(self):
node = factory.make_Node()
cache_set = factory.make_CacheSet(node=node)
filesystems = [
factory.make_Filesystem(
fstype=FILESYSTEM_TYPE.BCACHE_BACKING,
block_device=factory.make_PhysicalBlockDevice(node=node))
for _ in range(random.randint(2, 10))
]
with ExpectedException(
ValidationError,
re.escape(
"{'__all__': ['Bcache can only contain one backing "
"device.']}")):
factory.make_FilesystemGroup(
group_type=FILESYSTEM_GROUP_TYPE.BCACHE,
cache_set=cache_set,
filesystems=filesystems)
评论列表
文章目录