qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v4 6/7] iotests: Test qemu-img convert --salvage


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v4 6/7] iotests: Test qemu-img convert --salvage
Date: Thu, 16 May 2019 16:51:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 16.05.19 16:40, Vladimir Sementsov-Ogievskiy wrote:
> 07.05.2019 23:35, Max Reitz wrote:
>> This test converts a simple image to another, but blkdebug injects
>> block_status and read faults at some offsets.  The resulting image
>> should be the same as the input image, except that sectors that could
>> not be read have to be 0.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>> ---
>>   tests/qemu-iotests/251     | 162 +++++++++++++++++++++++++++++++++++++
>>   tests/qemu-iotests/251.out |  43 ++++++++++
>>   tests/qemu-iotests/group   |   1 +
>>   3 files changed, 206 insertions(+)
>>   create mode 100755 tests/qemu-iotests/251
>>   create mode 100644 tests/qemu-iotests/251.out
>>
>> diff --git a/tests/qemu-iotests/251 b/tests/qemu-iotests/251
>> new file mode 100755
>> index 0000000000..508d69769f
>> --- /dev/null
>> +++ b/tests/qemu-iotests/251
>> @@ -0,0 +1,162 @@

[...]

>> +_filter_offsets() {
>> +    filters=
>> +
>> +    index=0
>> +    for ofs in $2
>> +    do
>> +        filters+=" -e s/$(printf "$1" $ofs)/status_fail_offset_$index/"
> 
> Why not just $ofs ? I've tested, it works for me as well
> 
>> +        index=$((index + 1))
>> +    done
>> +
>> +    index=0
>> +    for ofs in $3
>> +    do
>> +        filters+=" -e s/$(printf "$1" $ofs)/read_fail_offset_$index/"
> 
> and here.

Oops.  Those are artifacts from when I had to use hexadecimal offsets
because the output was in hex.  (So the $1 parameter could be either %i
or %x.)  Will fix.

[...]

>> diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
>> index 7ac9a5ea4a..dde113a552 100644
>> --- a/tests/qemu-iotests/group
>> +++ b/tests/qemu-iotests/group
>> @@ -249,3 +249,4 @@
>>   247 rw auto quick
>>   248 rw auto quick
>>   249 rw auto quick
>> +251 auto quick
> 
> why not rw? (actually, I don't know what means rw group...)

Neither do I. :-)

So I don’t mind (or care, actually).

> With simplified _filter_offsets (also, if drop $1 parameter, parameters may 
> be changed to be $1 and $2)
> (or without, if there is a reason, but I don't see it):
> Tested-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

Thanks!

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]