diff mbox series

[v2,2/8] tests/qemu-iotests/005: Add a sanity check for large sparse file support

Message ID 20190428155451.15653-3-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/qemu-iotests: Run basic iotests during "make check" | expand

Commit Message

Thomas Huth April 28, 2019, 3:54 p.m. UTC
"check -raw 005" fails when running on ext4 filesystems - these do not
support such large sparse files. Use the same check as in test 220 to
skip the test in this case.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/005 | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Alex Bennée May 1, 2019, 11:08 a.m. UTC | #1
Thomas Huth <thuth@redhat.com> writes:

> "check -raw 005" fails when running on ext4 filesystems - these do not
> support such large sparse files. Use the same check as in test 220 to
> skip the test in this case.
>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qemu-iotests/005 | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
> index 2fef63af88..6136ced5c8 100755
> --- a/tests/qemu-iotests/005
> +++ b/tests/qemu-iotests/005
> @@ -55,6 +55,15 @@ if [ "$IMGPROTO" = "sheepdog" ]; then
>      _notrun "image protocol $IMGPROTO does not support large image sizes"
>  fi
>
> +# Sanity check: For raw, we require a file system that permits the creation
> +# of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.

Is this comment correct? Running on my ext4 home partition this test
seems to be running fine and not skipping. Indeed:

  12:06:29 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + pwd
  /home/alex/lsrc/qemu.git/builds/kvm/tests/qemu-iotests
  12:07:12 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + stat -f -c %T .
  ext2/ext3
  12:07:40 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + touch scratch/t.img
  12:07:45 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + truncate --size=5T scratch/t.img
  12:07:47 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + ls -lh scratch/t.img
  -rw-r--r-- 1 alex alex 5.0T May  1 12:07 scratch/t.img
  12:07:51 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + stat -f -c %T scratch/t.img
  ext2/ext3
  12:07:58 [alex@idun:~/l/q/b/k/t/qemu-iotests] review/iotests-fixup-v2 + du -sh scratch/
  4.0K    scratch/


> +if [ "$IMGFMT" = "raw" ]; then
> +    if ! truncate --size=5T "$TEST_IMG"; then
> +        _notrun "file system on $TEST_DIR does not support large enough files"
> +    fi
> +    rm "$TEST_IMG"
> +fi
> +
>  echo
>  echo "creating large image"
>  _make_test_img 5000G

--
Alex Bennée
Eric Blake May 1, 2019, 12:06 p.m. UTC | #2
On 5/1/19 6:08 AM, Alex Bennée wrote:
> 
> Thomas Huth <thuth@redhat.com> writes:
> 
>> "check -raw 005" fails when running on ext4 filesystems - these do not
>> support such large sparse files. Use the same check as in test 220 to
>> skip the test in this case.
>>
>> Suggested-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  tests/qemu-iotests/005 | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
>> index 2fef63af88..6136ced5c8 100755
>> --- a/tests/qemu-iotests/005
>> +++ b/tests/qemu-iotests/005
>> @@ -55,6 +55,15 @@ if [ "$IMGPROTO" = "sheepdog" ]; then
>>      _notrun "image protocol $IMGPROTO does not support large image sizes"
>>  fi
>>
>> +# Sanity check: For raw, we require a file system that permits the creation
>> +# of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
> 
> Is this comment correct? Running on my ext4 home partition this test
> seems to be running fine and not skipping. Indeed:

>> +if [ "$IMGFMT" = "raw" ]; then
>> +    if ! truncate --size=5T "$TEST_IMG"; then

5T fits on ext4 but not ext3. This is not a straight copy from 220
(where the size in question was even bigger, at 513T), so the comment is
indeed slightly inaccurate; it may be worth figuring out which file
system actually failed to update the comment. But the code change is
correct once the comments are fixed.

Reviewed-by: Eric Blake <eblake@redhat.com>
Thomas Huth May 1, 2019, 1:13 p.m. UTC | #3
On 01/05/2019 13.08, Alex Bennée wrote:
> 
> Thomas Huth <thuth@redhat.com> writes:
> 
>> "check -raw 005" fails when running on ext4 filesystems - these do not
>> support such large sparse files. Use the same check as in test 220 to
>> skip the test in this case.
>>
>> Suggested-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  tests/qemu-iotests/005 | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
>> index 2fef63af88..6136ced5c8 100755
>> --- a/tests/qemu-iotests/005
>> +++ b/tests/qemu-iotests/005
>> @@ -55,6 +55,15 @@ if [ "$IMGPROTO" = "sheepdog" ]; then
>>      _notrun "image protocol $IMGPROTO does not support large image sizes"
>>  fi
>>
>> +# Sanity check: For raw, we require a file system that permits the creation
>> +# of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
> 
> Is this comment correct? Running on my ext4 home partition this test
> seems to be running fine and not skipping.
Maybe it depends on the kernel version (I'm still using a 3.10-based
kernel here) or the way how the file system was created? It fails at
least for me on my ext4 partition.
But I can adjust a little bit for sure.

 Thomas
Thomas Huth May 1, 2019, 1:36 p.m. UTC | #4
On 01/05/2019 14.06, Eric Blake wrote:
> On 5/1/19 6:08 AM, Alex Bennée wrote:
>>
>> Thomas Huth <thuth@redhat.com> writes:
>>
>>> "check -raw 005" fails when running on ext4 filesystems - these do not
>>> support such large sparse files. Use the same check as in test 220 to
>>> skip the test in this case.
>>>
>>> Suggested-by: Eric Blake <eblake@redhat.com>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>  tests/qemu-iotests/005 | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
>>> index 2fef63af88..6136ced5c8 100755
>>> --- a/tests/qemu-iotests/005
>>> +++ b/tests/qemu-iotests/005
>>> @@ -55,6 +55,15 @@ if [ "$IMGPROTO" = "sheepdog" ]; then
>>>      _notrun "image protocol $IMGPROTO does not support large image sizes"
>>>  fi
>>>
>>> +# Sanity check: For raw, we require a file system that permits the creation
>>> +# of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
>>
>> Is this comment correct? Running on my ext4 home partition this test
>> seems to be running fine and not skipping. Indeed:
> 
>>> +if [ "$IMGFMT" = "raw" ]; then
>>> +    if ! truncate --size=5T "$TEST_IMG"; then
> 
> 5T fits on ext4 but not ext3.

It fails for me on my ext4 partition. Anyway, I'll change the comment.

 Thomas
Alex Bennée May 1, 2019, 2:23 p.m. UTC | #5
Thomas Huth <thuth@redhat.com> writes:

> On 01/05/2019 13.08, Alex Bennée wrote:
>>
>> Thomas Huth <thuth@redhat.com> writes:
>>
>>> "check -raw 005" fails when running on ext4 filesystems - these do not
>>> support such large sparse files. Use the same check as in test 220 to
>>> skip the test in this case.
>>>
>>> Suggested-by: Eric Blake <eblake@redhat.com>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>  tests/qemu-iotests/005 | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
>>> index 2fef63af88..6136ced5c8 100755
>>> --- a/tests/qemu-iotests/005
>>> +++ b/tests/qemu-iotests/005
>>> @@ -55,6 +55,15 @@ if [ "$IMGPROTO" = "sheepdog" ]; then
>>>      _notrun "image protocol $IMGPROTO does not support large image sizes"
>>>  fi
>>>
>>> +# Sanity check: For raw, we require a file system that permits the creation
>>> +# of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
>>
>> Is this comment correct? Running on my ext4 home partition this test
>> seems to be running fine and not skipping.
> Maybe it depends on the kernel version (I'm still using a 3.10-based
> kernel here) or the way how the file system was created? It fails at
> least for me on my ext4 partition.
> But I can adjust a little bit for sure.

  # Sanity check: For raw, we require a file system that permits the
  # creation of a HUGE (but very sparse) file. Check we can create such
  # a file before continuing.

?

>
>  Thomas


--
Alex Bennée
diff mbox series

Patch

diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
index 2fef63af88..6136ced5c8 100755
--- a/tests/qemu-iotests/005
+++ b/tests/qemu-iotests/005
@@ -55,6 +55,15 @@  if [ "$IMGPROTO" = "sheepdog" ]; then
     _notrun "image protocol $IMGPROTO does not support large image sizes"
 fi
 
+# Sanity check: For raw, we require a file system that permits the creation
+# of a HUGE (but very sparse) file.  tmpfs works, ext4 does not.
+if [ "$IMGFMT" = "raw" ]; then
+    if ! truncate --size=5T "$TEST_IMG"; then
+        _notrun "file system on $TEST_DIR does not support large enough files"
+    fi
+    rm "$TEST_IMG"
+fi
+
 echo
 echo "creating large image"
 _make_test_img 5000G