qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

iotests: Provide a function for checking the creation of huge files

Some tests create huge (but sparse) files, and to be able to run those
tests in certain limited environments (like CI containers), we have to
check for the possibility to create such files first. Thus let's introduce
a common function to check for large files, and replace the already
existing checks in the iotests 005 and 220 with this function.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>

authored by

Thomas Huth and committed by
Kevin Wolf
059f708d aceeaa69

+13 -8
+1 -4
tests/qemu-iotests/005
··· 59 59 # Sanity check: For raw, we require a file system that permits the creation 60 60 # of a HUGE (but very sparse) file. Check we can create it before continuing. 61 61 if [ "$IMGFMT" = "raw" ]; then 62 - if ! truncate --size=5T "$TEST_IMG"; then 63 - _notrun "file system on $TEST_DIR does not support large enough files" 64 - fi 65 - rm "$TEST_IMG" 62 + _require_large_file 5T 66 63 fi 67 64 68 65 echo
+2 -4
tests/qemu-iotests/220
··· 42 42 43 43 # Sanity check: We require a file system that permits the creation 44 44 # of a HUGE (but very sparse) file. tmpfs works, ext4 does not. 45 - if ! truncate --size=513T "$TEST_IMG"; then 46 - _notrun "file system on $TEST_DIR does not support large enough files" 47 - fi 48 - rm "$TEST_IMG" 45 + _require_large_file 513T 46 + 49 47 IMGOPTS='cluster_size=2M,refcount_bits=1' _make_test_img 513T 50 48 51 49 echo "== Populating refcounts =="
+10
tests/qemu-iotests/common.rc
··· 643 643 done 644 644 } 645 645 646 + # Check that we have a file system that allows huge (but very sparse) files 647 + # 648 + _require_large_file() 649 + { 650 + if ! truncate --size="$1" "$TEST_IMG"; then 651 + _notrun "file system on $TEST_DIR does not support large enough files" 652 + fi 653 + rm "$TEST_IMG" 654 + } 655 + 646 656 # make sure this script returns success 647 657 true