[PATCH 2/4] qemu-iotests: remove forceful execution success from library files

Cleber Rosa posted 4 patches 6 years, 1 month ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
There is a newer version of this series
[PATCH 2/4] qemu-iotests: remove forceful execution success from library files
Posted by Cleber Rosa 6 years, 1 month ago
Should not be necessary on files that are not executed standalone.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/qemu-iotests/common.config | 3 ---
 tests/qemu-iotests/common.filter | 3 ---
 tests/qemu-iotests/common.rc     | 3 ---
 3 files changed, 9 deletions(-)

diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index 6956d38d4c..0a24d960ff 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -34,6 +34,3 @@ _optstr_add()
         echo "$2"
     fi
 }
-
-# make sure this script returns success
-true
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 043c62c10c..55db15865a 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -221,6 +221,3 @@ _filter_qmp_empty_return()
 {
     grep -v '{"return": {}}'
 }
-
-# make sure this script returns success
-true
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 19bddacf11..d7e6456086 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -600,6 +600,3 @@ _require_drivers()
         fi
     done
 }
-
-# make sure this script returns success
-true
-- 
2.21.0


Re: [PATCH 2/4] qemu-iotests: remove forceful execution success from library files
Posted by Eric Blake 6 years, 1 month ago
On 9/27/19 9:17 AM, Cleber Rosa wrote:
> Should not be necessary on files that are not executed standalone.
> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   tests/qemu-iotests/common.config | 3 ---
>   tests/qemu-iotests/common.filter | 3 ---
>   tests/qemu-iotests/common.rc     | 3 ---
>   3 files changed, 9 deletions(-)
> 
> diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
> index 6956d38d4c..0a24d960ff 100644
> --- a/tests/qemu-iotests/common.config
> +++ b/tests/qemu-iotests/common.config
> @@ -34,6 +34,3 @@ _optstr_add()
>           echo "$2"
>       fi
>   }
> -
> -# make sure this script returns success
> -true

The exit status of the source command in the caller depends on the last 
command executed here.

However, you also have the point that if you delete this line, the last 
command executed is a function definition which is successful (for all 3 
files touched).  So there is no behavior change in dropping this line.

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


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org