diff mbox series

[1/3] iotests: Fix 125 for growth_mode = metadata

Message ID 20190925183231.11196-2-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series iotests: Fix 125 | expand

Commit Message

Max Reitz Sept. 25, 2019, 6:32 p.m. UTC
If we use growth_mode = metadata, it is very much possible that the file
uses more disk space after we have written something to the added area.
We did indeed want to test for this case, but unfortunately we evidently
just copied the code from the "Test creation preallocation" section and
forgot to replace "$create_mode" by "$growth_mode".

We never noticed because we only read the first number from qemu-img
info's "disk size" output -- and that is effectively useless, because
qemu-img prints a human-readable value (which generally includes a
decimal point).  That will be fixed in the patch after the next one.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/125 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Blake Sept. 25, 2019, 9:29 p.m. UTC | #1
On 9/25/19 1:32 PM, Max Reitz wrote:
> If we use growth_mode = metadata, it is very much possible that the file
> uses more disk space after we have written something to the added area.
> We did indeed want to test for this case, but unfortunately we evidently
> just copied the code from the "Test creation preallocation" section and
> forgot to replace "$create_mode" by "$growth_mode".
> 
> We never noticed because we only read the first number from qemu-img
> info's "disk size" output -- and that is effectively useless, because
> qemu-img prints a human-readable value (which generally includes a
> decimal point).  That will be fixed in the patch after the next one.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   tests/qemu-iotests/125 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125
> index dc4b8f5fb9..df328a63a6 100755
> --- a/tests/qemu-iotests/125
> +++ b/tests/qemu-iotests/125
> @@ -111,7 +111,7 @@ for GROWTH_SIZE in 16 48 80; do
>                   if [ $file_length_2 -gt $file_length_1 ]; then
>                       echo "ERROR (grow): Image length has grown from $file_length_1 to $file_length_2"
>                   fi
> -                if [ $create_mode != metadata ]; then
> +                if [ $growth_mode != metadata ]; then
>                       # The host size should not have grown either
>                       if [ $host_size_2 -gt $host_size_1 ]; then
>                           echo "ERROR (grow): Host size has grown from $host_size_1 to $host_size_2"
>
diff mbox series

Patch

diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125
index dc4b8f5fb9..df328a63a6 100755
--- a/tests/qemu-iotests/125
+++ b/tests/qemu-iotests/125
@@ -111,7 +111,7 @@  for GROWTH_SIZE in 16 48 80; do
                 if [ $file_length_2 -gt $file_length_1 ]; then
                     echo "ERROR (grow): Image length has grown from $file_length_1 to $file_length_2"
                 fi
-                if [ $create_mode != metadata ]; then
+                if [ $growth_mode != metadata ]; then
                     # The host size should not have grown either
                     if [ $host_size_2 -gt $host_size_1 ]; then
                         echo "ERROR (grow): Host size has grown from $host_size_1 to $host_size_2"