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 <mre...@redhat.com>
>> ---
>>   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 <vsement...@virtuozzo.com>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>

Thanks!

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to