[PATCH RESEND v5 25/28] target/avocado: Pass parameters to migration test on aarch64

Fabiano Rosas posted 28 patches 2 years, 11 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Cleber Rosa <crosa@redhat.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH RESEND v5 25/28] target/avocado: Pass parameters to migration test on aarch64
Posted by Fabiano Rosas 2 years, 11 months ago
The migration tests are currently broken for an aarch64 host because
the tests pass no 'machine' and 'cpu' options on the QEMU command
line. Most other architectures define a default value in QEMU for
these options, but arm does not.

Add these options to the test class in case the test is being executed
in an aarch64 host.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/avocado/migration.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py
index 4b25680c50..ffd3db0f35 100644
--- a/tests/avocado/migration.py
+++ b/tests/avocado/migration.py
@@ -11,6 +11,8 @@
 
 
 import tempfile
+import os
+
 from avocado_qemu import QemuSystemTest
 from avocado import skipUnless
 
@@ -26,6 +28,14 @@ class Migration(QemuSystemTest):
 
     timeout = 10
 
+    def setUp(self):
+        super().setUp()
+
+        arch = os.uname()[4]
+        if arch == 'aarch64':
+            self.machine = 'virt'
+            self.cpu = 'max'
+
     @staticmethod
     def migration_finished(vm):
         return vm.command('query-migrate')['status'] in ('completed', 'failed')
-- 
2.35.3


Re: [PATCH RESEND v5 25/28] target/avocado: Pass parameters to migration test on aarch64
Posted by Peter Maydell 2 years, 11 months ago
On Mon, 13 Feb 2023 at 20:33, Fabiano Rosas <farosas@suse.de> wrote:
>
> The migration tests are currently broken for an aarch64 host because
> the tests pass no 'machine' and 'cpu' options on the QEMU command
> line. Most other architectures define a default value in QEMU for
> these options, but arm does not.
>
> Add these options to the test class in case the test is being executed
> in an aarch64 host.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Acked-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/avocado/migration.py | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py
> index 4b25680c50..ffd3db0f35 100644
> --- a/tests/avocado/migration.py
> +++ b/tests/avocado/migration.py
> @@ -11,6 +11,8 @@
>
>
>  import tempfile
> +import os
> +
>  from avocado_qemu import QemuSystemTest
>  from avocado import skipUnless
>
> @@ -26,6 +28,14 @@ class Migration(QemuSystemTest):
>
>      timeout = 10
>
> +    def setUp(self):
> +        super().setUp()
> +
> +        arch = os.uname()[4]
> +        if arch == 'aarch64':
> +            self.machine = 'virt'
> +            self.cpu = 'max'
> +
>      @staticmethod
>      def migration_finished(vm):
>          return vm.command('query-migrate')['status'] in ('completed', 'failed')
> --

This looks odd. Don't we run this test in our CI currently?
I'm not sure that specialcasing aarch64 here is the right
approach -- David, any opinions?

thanks
-- PMM