diff --git a/test/gzip.bats b/test/gzip.bats index 7b7676e8..857cbb1d 100644 --- a/test/gzip.bats +++ b/test/gzip.bats @@ -128,3 +128,10 @@ EOF echo "$l2" [ "$l1" = "$l2" ] } + +@test "import various sizes" { + test_copy_buffer_size 512k tar + test_copy_buffer_size 2m tar + test_copy_buffer_size 512k tar.gz + test_copy_buffer_size 2m tar.gz +} diff --git a/test/helpers.bash b/test/helpers.bash index e2ad36ac..1ce79a3a 100644 --- a/test/helpers.bash +++ b/test/helpers.bash @@ -200,3 +200,41 @@ function zot_teardown { killall zot rm -f $TEST_TMPDIR/zot-config.json } + +function test_copy_buffer_size() { + local buffer_size=$1 + local file_type=$2 + rm -rf folder1 + mkdir folder1 + truncate -s $buffer_size folder1/file1 + if [ $file_type = "tar" ]; then + tar cvf test.$file_type folder1 + else + tar cvzf test.$file_type folder1 + fi + cat > stacker.yaml <