On 20/1/23 19:48, Fabiano Rosas 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.

There was some discussions around that in the past:
https://lore.kernel.org/qemu-devel/20190621153806.13489-1-waine...@redhat.com/
https://lore.kernel.org/qemu-devel/cafeaca9nbu+l4whfkltv93wy90wjnv05ez12pt6pmljdz5h...@mail.gmail.com/

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

I'm not sure what we are aiming to test here.

Migration in general? If so, any random machine should work.
By hardcoding the 'virt' machine, at least this test is reproducible.

I'd rather fix that generically as "if a test requires a default
machine and the target doesn't provide any default, then SKIP the
test". Then adding machine-specific tests. Can be done on top, so

Acked-by: Philippe Mathieu-Daudé <phi...@linaro.org>

Signed-off-by: Fabiano Rosas <faro...@suse.de>
Reviewed-by: Richard Henderson <richard.hender...@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')


Reply via email to