On 19/02/2026 12.55, Vladimir Sementsov-Ogievskiy wrote:
Add test for a new local-migration migration of virtio-net/tap, with fd
passing through UNIX socket.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
  tests/functional/x86_64/meson.build           |   1 +
  tests/functional/x86_64/test_tap_migration.py | 401 ++++++++++++++++++
  2 files changed, 402 insertions(+)
  create mode 100755 tests/functional/x86_64/test_tap_migration.py

diff --git a/tests/functional/x86_64/meson.build 
b/tests/functional/x86_64/meson.build
index f78eec5e6c..d23b0cc727 100644
--- a/tests/functional/x86_64/meson.build
+++ b/tests/functional/x86_64/meson.build
@@ -36,4 +36,5 @@ tests_x86_64_system_thorough = [
    'vfio_user_client',
    'virtio_balloon',
    'virtio_gpu',
+  'tap_migration',
  ]
diff --git a/tests/functional/x86_64/test_tap_migration.py 
b/tests/functional/x86_64/test_tap_migration.py
new file mode 100755
index 0000000000..c629b44f66
--- /dev/null
+++ b/tests/functional/x86_64/test_tap_migration.py
@@ -0,0 +1,401 @@
+#!/usr/bin/env python3
+#
+# Functional test that tests TAP local migration
+# with fd passing
+#
+# Copyright (c) Yandex Technologies LLC, 2026
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+import time
+import subprocess
+from subprocess import run
+import signal
+from typing import Tuple
+
+from qemu_test import (
+    LinuxKernelTest,
+    Asset,
+    exec_command_and_wait_for_pattern,
+)
+from qemu_test.decorators import skipWithoutSudo
+
+GUEST_IP = "10.0.1.2"
+GUEST_IP_MASK = f"{GUEST_IP}/24"
+GUEST_MAC = "d6:0d:75:f8:0f:b7"
+HOST_IP = "10.0.1.1"

Is it ok to use hard-coded IP addresses here? What if there is already another unrelated 10.0.1.x network on the host (e.g. from a libvirt setup or a VPN)?

+HOST_IP_MASK = f"{HOST_IP}/24"
+TAP_ID = "tap0"
+TAP_ID2 = "tap1"
+TAP_MAC = "e6:1d:44:b5:03:5d"
+
+
+def ip(args, check=True) -> None:
+    """Run ip command with sudo"""
+    run(["sudo", "ip"] + args, check=check)
I think you need to check for the "ip" binary somewhere and skip the test if it is not available (e.g. on a unusual Linux distro or a *BSD host).

 Thomas


Reply via email to