Browse files

tests: Add test_petabyte_file

We have introduced checking of appending data to the a 1 petabyte file.
We use sparse file so we do not need to allocate all space to perform this test.
In addition we also make sure if the sparse file is correct (returns zeros from
not allocated blocks). The last think we check is if the appended data does not
occupy more storage than one CHUNK_SIZE.

Closes #109
  • Loading branch information...
aNeutrino authored and marcinsulikowski committed Dec 6, 2013
1 parent b68386c commit 7dc407da8b53625c5d49c9040406813f5355ba5a
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/test_suites/SanityChecks/
@@ -0,0 +1,16 @@
setup_local_empty_lizardfs info

cd "${info[mount0]}"
truncate -s 1P petabyte_sparse_file
assert_equals $(parse_si_suffix 1P) $(stat --format="%s" petabyte_sparse_file)
expect_equals 0 $(mfs_dir_info realsize petabyte_sparse_file)
if ! cmp <(head -c 10000 /dev/zero) <(head -c 10000 petabyte_sparse_file); then
test_add_failure "Sparse file contains non-zero bytes"

echo -n "" >> petabyte_sparse_file
expect_equals "" $(tail -c12 petabyte_sparse_file)
expect_less_or_equal $(mfs_dir_info realsize petabyte_sparse_file) $LIZARDFS_CHUNK_SIZE

0 comments on commit 7dc407d

Please sign in to comment.