diff mbox

[v3,5/6] qemu-iotests: Force qcow2 in error path test in 048

Message ID 1384933457-26953-6-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Nov. 20, 2013, 7:44 a.m. UTC
The "raw" doesn't always work on certain file systems (e.g. tmpfs). Use
qcow2 to make the allocation status explicit.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/048 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Stefan Hajnoczi Nov. 21, 2013, 12:41 p.m. UTC | #1
On Wed, Nov 20, 2013 at 03:44:16PM +0800, Fam Zheng wrote:
> The "raw" doesn't always work on certain file systems (e.g. tmpfs). Use
> qcow2 to make the allocation status explicit.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/qemu-iotests/048 | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
> index 9def7fc..0fb5d2c 100755
> --- a/tests/qemu-iotests/048
> +++ b/tests/qemu-iotests/048
> @@ -88,7 +88,13 @@ event = "read_aio"
>  errno = "5"
>  once ="off"
>  EOF
> -_make_test_img $size
> +if [ "$IMGFMT" = "raw" ]; then
> +    # For raw the allocation status for new image depends on file system, force
> +    # qcow2 in this case, since the tested code is in block layer
> +    IMGFMT=qcow2 _make_test_img $size | _filter_imgfmt

If it can't be tested, skip the test.  Don't silently test something
else.

Stefan
Fam Zheng Nov. 21, 2013, 12:50 p.m. UTC | #2
On 2013年11月21日 20:41, Stefan Hajnoczi wrote:
> On Wed, Nov 20, 2013 at 03:44:16PM +0800, Fam Zheng wrote:
>> The "raw" doesn't always work on certain file systems (e.g. tmpfs). Use
>> qcow2 to make the allocation status explicit.
>>
>> Signed-off-by: Fam Zheng <famz@redhat.com>
>> ---
>>   tests/qemu-iotests/048 | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
>> index 9def7fc..0fb5d2c 100755
>> --- a/tests/qemu-iotests/048
>> +++ b/tests/qemu-iotests/048
>> @@ -88,7 +88,13 @@ event = "read_aio"
>>   errno = "5"
>>   once ="off"
>>   EOF
>> -_make_test_img $size
>> +if [ "$IMGFMT" = "raw" ]; then
>> +    # For raw the allocation status for new image depends on file system, force
>> +    # qcow2 in this case, since the tested code is in block layer
>> +    IMGFMT=qcow2 _make_test_img $size | _filter_imgfmt
>
> If it can't be tested, skip the test.  Don't silently test something
> else.
>

OK. Do you think I should split the test? Since we don't have 
conditional reference output.

Fam
diff mbox

Patch

diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
index 9def7fc..0fb5d2c 100755
--- a/tests/qemu-iotests/048
+++ b/tests/qemu-iotests/048
@@ -88,7 +88,13 @@  event = "read_aio"
 errno = "5"
 once ="off"
 EOF
-_make_test_img $size
+if [ "$IMGFMT" = "raw" ]; then
+    # For raw the allocation status for new image depends on file system, force
+    # qcow2 in this case, since the tested code is in block layer
+    IMGFMT=qcow2 _make_test_img $size | _filter_imgfmt
+else
+    _make_test_img $size | _filter_imgfmt
+fi
 cp "$TEST_IMG" "$TEST_IMG2"
 io_pattern write 512 512 0 1 102
 TEST_IMG="blkdebug:$TEST_DIR/blkdebug.conf:$TEST_IMG" _compare 2>&1 |\