All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aniket Sahu <asahu1x@linux.ibm.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: npiggin@gmail.com, rathc@linux.ibm.com, milesg@linux.ibm.com,
	harshpb@linux.ibm.com, anushree.mathur@linux.ibm.com,
	misanjum@linux.ibm.com, adityag@linux.ibm.com,
	gautam@linux.ibm.com, thuth@redhat.com, asahu1x@linux.ibm.com
Subject: [PATCH v2 1/2] tests/functional/ppc64: extend pseries migration tests
Date: Wed, 16 Sep 2026 16:06:34 +0530	[thread overview]
Message-ID: <20260916103635.7797-2-asahu1x@linux.ibm.com> (raw)
In-Reply-To: <20260916103635.7797-1-asahu1x@linux.ibm.com>

Made a few changes to test_pseries.py to extend the migration
tests to validate exec (socat) and UNIX paths.

- Refactored test_ppc64_linux_migration to a private method
_do_linux_migration(dst_uri, src_uri=None).
- It is then called by three separate methods which exercise the
TCP, UNIX and exec paths via the migrate_vms method from
MigrationTest.
---
 tests/functional/ppc64/test_pseries.py | 41 ++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/tests/functional/ppc64/test_pseries.py b/tests/functional/ppc64/test_pseries.py
index cb6d25dc81..19f31141b1 100755
--- a/tests/functional/ppc64/test_pseries.py
+++ b/tests/functional/ppc64/test_pseries.py
@@ -8,8 +8,9 @@
 # later.  See the COPYING file in the top-level directory.
 
 from qemu_test import Asset
-from qemu_test import wait_for_console_pattern
+from qemu_test import wait_for_console_pattern, which
 from migration import MigrationTest
+from qemu_test.ports import Ports
 
 class PseriesMachine(MigrationTest):
 
@@ -88,12 +89,20 @@ 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):
+    def _do_linux_migration(self, dst_uri, src_uri=None):
+        """
+        Boot a pseries kernel on a source VM, wait until Linux is up, then
+        migrate to a destination VM over the given URI(s) and verify the boot
+        continues on the destination.
+        """
         self.set_machine('pseries')
 
         kernel_path = self.ASSET_KERNEL.fetch()
         kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
 
+        if src_uri is None:
+            src_uri = dst_uri
+
         dest_vm = self.get_vm(name="dest-qemu")
         dest_vm.add_args('-incoming', 'defer')
         dest_vm.add_args('-smp', '4')
@@ -111,16 +120,38 @@ def test_ppc64_linux_migration(self):
         source_vm.set_console()
         source_vm.launch()
 
-        # ensure the boot has reached Linux
+        # ensure the boot has reached Linux before migrating
         console_pattern = 'smp: Brought up 1 node, 4 CPUs'
         wait_for_console_pattern(self, console_pattern, self.panic_message,
                                  vm=source_vm)
 
-        self.migration_with_tcp_localhost_vms(dest_vm, source_vm)
+        self.migrate_vms(dst_uri, src_uri, dest_vm, source_vm)
 
-        # ensure the boot proceeds after migration
+        # ensure the boot continues on the destination after migration
         wait_for_console_pattern(self, self.good_message, self.panic_message,
                                  vm=dest_vm)
 
+    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')
+            self._do_linux_migration('tcp:localhost:%u' % port)
+
+    def test_ppc64_linux_migration_unix(self):
+        self._do_linux_migration(
+            'unix:%s/migration.sock' % self.socket_dir().name)
+
+    def test_ppc64_linux_migration_exec(self):
+        if not which('socat'):
+            self.skipTest('socat is not available')
+        with Ports() as ports:
+            port = ports.find_free_port()
+            if port is None:
+                self.skipTest('Failed to find a free port')
+            self._do_linux_migration(
+                'exec:socat TCP-LISTEN:%u -' % port,
+                'exec:socat - TCP:localhost:%u,forever' % port)
+
 if __name__ == '__main__':
     MigrationTest.main()
-- 
2.52.0



  reply	other threads:[~2026-09-16 10:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 10:36 [PATCH v2 0/2] tests/functional/ppc64: extend ppc64 functional tests Aniket Sahu
2026-09-16 10:36 ` Aniket Sahu [this message]
2026-09-17  6:46   ` [PATCH v2 1/2] tests/functional/ppc64: extend pseries migration tests Thomas Huth
2026-09-18 18:45   ` Amit Machhiwal
2026-09-21  5:56     ` Aniket Sahu
2026-09-21  6:41       ` Thomas Huth
2026-09-21  7:22         ` Aniket Sahu
2026-09-18 18:51   ` Amit Machhiwal
2026-09-16 10:36 ` [PATCH v2 2/2] tests/functional/ppc64: extend ppc64 powernv net device tests Aniket Sahu
2026-09-17  6:48   ` Thomas Huth
2026-09-18 18:53   ` Amit Machhiwal

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=20260916103635.7797-2-asahu1x@linux.ibm.com \
    --to=asahu1x@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=anushree.mathur@linux.ibm.com \
    --cc=gautam@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=milesg@linux.ibm.com \
    --cc=misanjum@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.