def test_fail_invalid_block_volume_size(self, preallocate): with self.assertRaises(se.InvalidParameterException): max_size = BlockVolume.max_size(GIB, sc.COW_FORMAT) max_size_blk = max_size // sc.BLOCK_SIZE BlockVolume.calculate_volume_alloc_size(preallocate, GIB_IN_SECTORS, max_size_blk + 1)
def test_fail_invalid_block_volume_size(self, preallocate): with self.assertRaises(se.InvalidParameterException): max_size = BlockVolume.max_size(GIB, sc.COW_FORMAT) max_size_blk = max_size // sc.BLOCK_SIZE BlockVolume.calculate_volume_alloc_size(preallocate, GIB_IN_BLOCKS, max_size_blk + 1)
def test_block_volume_size(self, args, result): size = BlockVolume.calculate_volume_alloc_size(*args) self.assertEqual(size, result)
def test_fail_invalid_block_volume_size(self, preallocate): with self.assertRaises(se.InvalidParameterException): max_size = BlockVolume.max_size(GIB, sc.COW_FORMAT) BlockVolume.calculate_volume_alloc_size(preallocate, GIB, max_size + 1)
def test_block_volume_size(self, args, result): size = BlockVolume.calculate_volume_alloc_size(*args) self.assertEqual(size, result)
def test_fail_invalid_block_volume_size(self, preallocate, vol_format): with self.assertRaises(se.InvalidParameterException): max_size = BlockVolume.max_size(GiB, vol_format) BlockVolume.calculate_volume_alloc_size(preallocate, vol_format, GiB, max_size + 1)