On 03/03/2026 14.43, Fabiano Rosas wrote:
Make the PseriesMachine class inherit from MigrationTest so the next
patch can access migration routines without needing to instantiate a
MigrationTest object. This is just for cleanliness of the code.

Note that creating a separate class for migration wouldn't work quite
well because the class attributes of PseriesMachine would then have to
be exposed to that class somehow.

Suggested-by: Peter Xu <[email protected]>
Signed-off-by: Fabiano Rosas <[email protected]>
---
  tests/functional/ppc64/test_pseries.py | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/functional/ppc64/test_pseries.py 
b/tests/functional/ppc64/test_pseries.py
index b45763c305..ce39e16a22 100755
--- a/tests/functional/ppc64/test_pseries.py
+++ b/tests/functional/ppc64/test_pseries.py
@@ -11,7 +11,7 @@
  from qemu_test import wait_for_console_pattern
  from test_migration import PpcMigrationTest
-class PseriesMachine(QemuSystemTest):
+class PseriesMachine(MigrationTest):

This patch does not work (without the following one). You only import PpcMigrationTest, but not MigrationTest, so inheriting from MigrationTest is not possible here...

      timeout = 90
      KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 '
@@ -116,11 +116,11 @@ def test_ppc64_linux_migration(self):
          wait_for_console_pattern(self, console_pattern, self.panic_message,
                                   vm=source_vm)
- PpcMigrationTest().do_migrate_ppc64_linux(source_vm, dest_vm);
+        self.do_migrate_ppc64_linux(source_vm, dest_vm);

... and do_migrate_ppc64_linux is also not a method of MigrationTest.

Easiest fix: Squash this patch with the next one. Otherwise you have to take the detour through inheriting from PpcMigrationTest here.

 Thomas


          # ensure the boot proceeds after migration
          wait_for_console_pattern(self, self.good_message, self.panic_message,
                                   vm=dest_vm)
if __name__ == '__main__':
-    QemuSystemTest.main()
+    MigrationTest.main()


Reply via email to