]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/iotests: be a little more forgiving on the size test
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 25 Feb 2020 20:20:09 +0000 (20:20 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 25 Feb 2020 20:20:09 +0000 (20:20 +0000)
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>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200225124710.14152-9-alex.bennee@linaro.org>

tests/qemu-iotests/214

index 3500e0c47a293680f032a6b829c53c3fdeef4137..af677d90b86e189c9a379ce7949788588b52ef5a 100755 (executable)
@@ -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 < $sizeB)"
 fi
 
 $QEMU_IMG check --output=json "$TEST_IMG" |