[PATCH] tests/qemu-iotests: Fix check for existing file in _require_disk_usage()

Thomas Huth posted 1 patch 5 days, 18 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251208075320.35682-1-thuth@redhat.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
tests/qemu-iotests/common.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tests/qemu-iotests: Fix check for existing file in _require_disk_usage()
Posted by Thomas Huth 5 days, 18 hours ago
From: Thomas Huth <thuth@redhat.com>

Looks like the "$" has been forgotten here to get the contents of
the FILENAME variable.

Fixes: c49dda7254d ("iotests: Filter out ZFS in several tests")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/common.rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 10d83d8361b..c0f8f0f8dfa 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -1008,7 +1008,7 @@ _require_disk_usage()
     else
         FILENAME="$TEST_IMG_FILE"
     fi
-    if [ -e "FILENAME" ]; then
+    if [ -e "$FILENAME" ]; then
         echo "unwilling to overwrite existing file"
         exit 1
     fi
-- 
2.52.0
Re: [PATCH] tests/qemu-iotests: Fix check for existing file in _require_disk_usage()
Posted by Kevin Wolf 4 days, 15 hours ago
Am 08.12.2025 um 08:53 hat Thomas Huth geschrieben:
> From: Thomas Huth <thuth@redhat.com>
> 
> Looks like the "$" has been forgotten here to get the contents of
> the FILENAME variable.
> 
> Fixes: c49dda7254d ("iotests: Filter out ZFS in several tests")
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Thanks, applied to the block branch.

Kevin
Re: [PATCH] tests/qemu-iotests: Fix check for existing file in _require_disk_usage()
Posted by Philippe Mathieu-Daudé 4 days, 19 hours ago
On 8/12/25 08:53, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> Looks like the "$" has been forgotten here to get the contents of
> the FILENAME variable.
> 
> Fixes: c49dda7254d ("iotests: Filter out ZFS in several tests")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/common.rc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH] tests/qemu-iotests: Fix check for existing file in _require_disk_usage()
Posted by Laurent Vivier 5 days, 15 hours ago
On Mon,  8 Dec 2025 08:53:20 +0100 Thomas Huth <thuth@redhat.com> wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> Looks like the "$" has been forgotten here to get the contents of
> the FILENAME variable.
>
> Fixes: c49dda7254d ("iotests: Filter out ZFS in several tests")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qemu-iotests/common.rc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 10d83d8361b..c0f8f0f8dfa 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -1008,7 +1008,7 @@ _require_disk_usage()
>      else
>          FILENAME="$TEST_IMG_FILE"
>      fi
> -    if [ -e "FILENAME" ]; then
> +    if [ -e "$FILENAME" ]; then
>          echo "unwilling to overwrite existing file"
>          exit 1
>      fi
> -- 
> 2.52.0

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Thanks!