[PATCH] tests/functional/migration.py: Skip migration_with_exec() if socat is not available

Zhao Liu posted 1 patch 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260330053300.2721608-1-zhao1.liu@intel.com
Maintainers: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>
tests/functional/migration.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] tests/functional/migration.py: Skip migration_with_exec() if socat is not available
Posted by Zhao Liu 1 week ago
Commit 643a171f5668 ("tests: Replace ncat with socat in migration test
and drop ncat from containers") replaced ncat with socat, but missed to
skip related test cases if socat is not available, which will cause test
errors on the system without socat.

Fix this by checking socat instead of the original ncat.

Fixes: 643a171f5668 ("tests: Replace ncat with socat in migration test and drop ncat from containers")
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 tests/functional/migration.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/functional/migration.py b/tests/functional/migration.py
index 2395119d6c66..144f091ba8aa 100644
--- a/tests/functional/migration.py
+++ b/tests/functional/migration.py
@@ -80,8 +80,8 @@ def migration_with_unix(self):
         self.migrate(dst_uri)
 
     def migration_with_exec(self):
-        if not which('ncat'):
-            self.skipTest('ncat is not available')
+        if not which('socat'):
+            self.skipTest('socat is not available')
         with Ports() as ports:
             free_port = self._get_free_port(ports)
             dst_uri = 'exec:socat TCP-LISTEN:%u -' % free_port
-- 
2.34.1
Re: [PATCH] tests/functional/migration.py: Skip migration_with_exec() if socat is not available
Posted by Thomas Huth 6 days, 22 hours ago
On 30/03/2026 07.33, Zhao Liu wrote:
> Commit 643a171f5668 ("tests: Replace ncat with socat in migration test
> and drop ncat from containers") replaced ncat with socat, but missed to
> skip related test cases if socat is not available, which will cause test
> errors on the system without socat.
> 
> Fix this by checking socat instead of the original ncat.
> 
> Fixes: 643a171f5668 ("tests: Replace ncat with socat in migration test and drop ncat from containers")
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
>   tests/functional/migration.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/functional/migration.py b/tests/functional/migration.py
> index 2395119d6c66..144f091ba8aa 100644
> --- a/tests/functional/migration.py
> +++ b/tests/functional/migration.py
> @@ -80,8 +80,8 @@ def migration_with_unix(self):
>           self.migrate(dst_uri)
>   
>       def migration_with_exec(self):
> -        if not which('ncat'):
> -            self.skipTest('ncat is not available')
> +        if not which('socat'):
> +            self.skipTest('socat is not available')

Oops, thanks for fixing it!

Reviewed-by: Thomas Huth <thuth@redhat.com>

and queued for my next pull request.

  Thomas