qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Thomas Huth <thuth@redhat.com>, Fabian Vogt <fvogt@suse.de>,
	Peter Xu <peterx@redhat.com>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>
Subject: [RFC PATCH 3/4] tests/functional: Add a OS level migration test for pseries
Date: Tue, 19 Aug 2025 19:39:04 -0300	[thread overview]
Message-ID: <20250819223905.2247-4-farosas@suse.de> (raw)
In-Reply-To: <20250819223905.2247-1-farosas@suse.de>

There's currently no OS level test for ppc64le. Add one such test by
reusing the boot level tests that are already present.

The test boots the source machine, waits for it to reach a mid-boot
message, migrates and checks that the destination has reached the
final boot message (VFS error due to no disk).

Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 tests/functional/test_ppc64_pseries.py | 41 ++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/functional/test_ppc64_pseries.py b/tests/functional/test_ppc64_pseries.py
index 67057934e8..7a7e0fe8ae 100755
--- a/tests/functional/test_ppc64_pseries.py
+++ b/tests/functional/test_ppc64_pseries.py
@@ -9,6 +9,8 @@
 
 from qemu_test import QemuSystemTest, Asset
 from qemu_test import wait_for_console_pattern
+from qemu_test.migration import Migration
+from qemu_test.ports import Ports
 
 class pseriesMachine(QemuSystemTest):
 
@@ -87,5 +89,44 @@ def test_ppc64_linux_big_boot(self):
         wait_for_console_pattern(self, console_pattern, self.panic_message)
         wait_for_console_pattern(self, self.good_message, self.panic_message)
 
+    def test_ppc64_linux_migration(self):
+        with Ports() as ports:
+            port = ports.find_free_port()
+            if port is None:
+                self.skipTest('Failed to find a free port')
+        uri = 'tcp:localhost:%u' % port
+
+        kernel_path = self.ASSET_KERNEL.fetch()
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
+
+        self.set_machine('pseries')
+
+        dest_vm = self.get_vm('-incoming', uri, name="dest-qemu")
+        dest_vm.add_args('-smp', '4')
+        dest_vm.add_args('-nodefaults')
+        dest_vm.add_args('-kernel', kernel_path,
+                         '-append', kernel_command_line)
+        dest_vm.set_console()
+        dest_vm.launch()
+
+        source_vm = self.get_vm(name="source-qemu")
+        source_vm.add_args('-smp', '4')
+        source_vm.add_args('-nodefaults')
+        source_vm.add_args('-kernel', kernel_path,
+                           '-append', kernel_command_line)
+        source_vm.set_console()
+        source_vm.launch()
+
+        # ensure the boot has reached Linux
+        console_pattern = 'smp: Brought up 1 node, 4 CPUs'
+        wait_for_console_pattern(self, console_pattern, self.panic_message,
+                                 vm=source_vm)
+
+        Migration().migrate(self, source_vm, dest_vm, uri, self.timeout)
+
+        # 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()
-- 
2.35.3



  parent reply	other threads:[~2025-08-19 22:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19 22:39 [PATCH 0/4] ppc: Fix migration issues with XICS and quiesce Fabiano Rosas
2025-08-19 22:39 ` [PATCH 1/4] hw/intc/xics: Add missing call to register vmstate_icp_server Fabiano Rosas
2025-09-18 15:28   ` Gautam Menghani
2025-08-19 22:39 ` [RFC PATCH 2/4] tests/functional: Extract migration code into a new class Fabiano Rosas
2025-08-20  6:50   ` Thomas Huth
2025-08-19 22:39 ` Fabiano Rosas [this message]
2025-08-20  7:03   ` [RFC PATCH 3/4] tests/functional: Add a OS level migration test for pseries Thomas Huth
2025-08-20 15:08     ` Fabiano Rosas
2025-08-19 22:39 ` [PATCH 4/4] target/ppc: Fix env->quiesced migration Fabiano Rosas
2025-08-20  6:55   ` Thomas Huth
2025-08-20 15:07     ` Fabiano Rosas
2025-08-20 15:20       ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250819223905.2247-4-farosas@suse.de \
    --to=farosas@suse.de \
    --cc=fvogt@suse.de \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).