From 2f54bc86f3af0f4c26453314dc0b4ac9da63f985 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 14 Jul 2016 18:19:50 +0200 Subject: [PATCH] added stub with plan for new volume_size_accuracy test --- testing/volume_size_accuracy.py | 55 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) create mode 100644 testing/volume_size_accuracy.py diff --git a/testing/volume_size_accuracy.py b/testing/volume_size_accuracy.py new file mode 100644 index 0000000..2e8e5a4 --- /dev/null +++ b/testing/volume_size_accuracy.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +""" Check very accurately the splitting of files into volumes; not a unit test + +Check: +- behaviour for max_volume_sizes % BLOCK_SIZE != 0 +- file sizes very close to size remaining in volume + +By doing the following: +- create a multi-volume archive with max_volume_size % BLOCK_SIZE == 0 +- add a file that nearly fills the volume +- add a small file that should just fit in or not +- check expected number and size of volumes +- repeat with max_volume_size +1, -1, +2, -2, +10, -10 + +Repeat with compressed/encrypted data; for this have to find some random data +that is repeatable (--> :py:mod:`create_pseudo_random_files`) and experiment a +bit for suitable seeds and sizes + +e.g. for max_volume_size = 8 * BLOCK_SIZE: + +block | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | (8!) +------+--------+-------+-------+-------+-------+-------+-------+-------+------ +file0 fits into 5 blocks: +vol0: | Info0 | Dat00 | Dat01 | Dat02 | Dat03 | Dat04 | Info1 | Dat10 | +vol1: | Dat11 | | | | | | | | + +OR: file0 needs 6th block --> force volume0 too big: +vol0: | Info0 | Dat00 | Dat01 | Dat02 | Dat03 | Dat04 | Dat05 | Info1 | Dat10 +vol1: | Dat11 | | | | | | | | + +OR: all fit into first volume +vol0: | Info0 | Dat00 | Dat01 | Dat02 | Dat03 | Dat04 | Info1 | Dat10 | + +NOT: Info block in the end +vol0: | Info0 | Dat00 | Dat01 | Dat02 | Dat03 | Dat04 | Dat05 | Info1 | +vol1: | Dat10 | Dat11 | | | | | | | + +.. codeauthor:: Intra2net AG +""" + + +from deltatar.tarfile import TarFile + + +def main(): + """ Main function, called when running file as script + + see module doc for more info + """ + raise NotImplementedError() + + +if __name__ == '__main__': + main() -- 1.7.1