diff mbox series

[v3,08/19] tests/iotests: be a little more forgiving on the size test

Message ID 20200225124710.14152-9-alex.bennee@linaro.org
State Superseded
Headers show
Series testing & plugin updates | expand

Commit Message

Alex Bennée Feb. 25, 2020, 12:46 p.m. UTC
At least on ZFS this was failing as 512 was less than or equal to 512.
I suspect the reason is additional compression done by ZFS and however
qemu-img gets the actual size.

Loosen the criteria to make sure after is not bigger than before and
also dump the values in the report.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/qemu-iotests/214 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.20.1

Comments

Robert Foley Feb. 25, 2020, 2:11 p.m. UTC | #1
On Tue, 25 Feb 2020 at 07:47, Alex Bennée <alex.bennee@linaro.org> wrote:
>

> At least on ZFS this was failing as 512 was less than or equal to 512.

> I suspect the reason is additional compression done by ZFS and however

> qemu-img gets the actual size.

>

> Loosen the criteria to make sure after is not bigger than before and

> also dump the values in the report.

>

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


Reviewed-by: Robert Foley <robert.foley@linaro.org>
Stefan Berger Feb. 25, 2020, 6:22 p.m. UTC | #2
On 2/25/20 7:46 AM, Alex Bennée wrote:
> At least on ZFS this was failing as 512 was less than or equal to 512.

> I suspect the reason is additional compression done by ZFS and however

> qemu-img gets the actual size.

>

> Loosen the criteria to make sure after is not bigger than before and

> also dump the values in the report.

>

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>   tests/qemu-iotests/214 | 4 ++--

>   1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214

> index 3500e0c47a2..6d1324cd157 100755

> --- a/tests/qemu-iotests/214

> +++ b/tests/qemu-iotests/214

> @@ -125,9 +125,9 @@ $QEMU_IO -c "write -P 0xcc $offset $data_size" "json:{\

>   sizeB=$($QEMU_IMG info --output=json "$TEST_IMG" |

>           sed -n '/"actual-size":/ s/[^0-9]//gp')

>

> -if [ $sizeA -le $sizeB ]

> +if [ $sizeA -lt $sizeB ]

>   then

> -    echo "Compression ERROR"

> +    echo "Compression ERROR ($sizeA vs $sizeB)"

>   fi


Nit: $sizeA < $sizeB ?

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>




>   $QEMU_IMG check --output=json "$TEST_IMG" |
Philippe Mathieu-Daudé Feb. 25, 2020, 6:39 p.m. UTC | #3
On 2/25/20 7:22 PM, Stefan Berger wrote:
> On 2/25/20 7:46 AM, Alex Bennée wrote:

>> At least on ZFS this was failing as 512 was less than or equal to 512.

>> I suspect the reason is additional compression done by ZFS and however

>> qemu-img gets the actual size.

>>

>> Loosen the criteria to make sure after is not bigger than before and

>> also dump the values in the report.

>>

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> ---

>>   tests/qemu-iotests/214 | 4 ++--

>>   1 file changed, 2 insertions(+), 2 deletions(-)

>>

>> diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214

>> index 3500e0c47a2..6d1324cd157 100755

>> --- a/tests/qemu-iotests/214

>> +++ b/tests/qemu-iotests/214

>> @@ -125,9 +125,9 @@ $QEMU_IO -c "write -P 0xcc $offset $data_size" 

>> "json:{\

>>   sizeB=$($QEMU_IMG info --output=json "$TEST_IMG" |

>>           sed -n '/"actual-size":/ s/[^0-9]//gp')

>>

>> -if [ $sizeA -le $sizeB ]

>> +if [ $sizeA -lt $sizeB ]

>>   then

>> -    echo "Compression ERROR"

>> +    echo "Compression ERROR ($sizeA vs $sizeB)"

>>   fi

> 

> Nit: $sizeA < $sizeB ?


Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


> 

> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>

> 

> 

> 

>>   $QEMU_IMG check --output=json "$TEST_IMG" |

> 

> 

>
diff mbox series

Patch

diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214
index 3500e0c47a2..6d1324cd157 100755
--- a/tests/qemu-iotests/214
+++ b/tests/qemu-iotests/214
@@ -125,9 +125,9 @@  $QEMU_IO -c "write -P 0xcc $offset $data_size" "json:{\
 sizeB=$($QEMU_IMG info --output=json "$TEST_IMG" |
         sed -n '/"actual-size":/ s/[^0-9]//gp')
 
-if [ $sizeA -le $sizeB ]
+if [ $sizeA -lt $sizeB ]
 then
-    echo "Compression ERROR"
+    echo "Compression ERROR ($sizeA vs $sizeB)"
 fi
 
 $QEMU_IMG check --output=json "$TEST_IMG" |