From 9b06b8a040db447104860b526c473a043e767869 Mon Sep 17 00:00:00 2001 From: lcheng Date: Sun, 5 Jan 2025 19:02:35 +0800 Subject: [PATCH] virt_admin: Fix failed to connect to the admin server issue Signed-off-by: lcheng --- .../management/virt_admin_server_threadpool_set.py | 8 ++++++++ .../tests/src/virt_admin/monitor/virt_admin_srv_list.py | 8 ++++++++ .../virt_admin/monitor/virt_admin_srv_threadpool_info.py | 7 +++++++ libvirt/tests/src/virt_admin/virt_admin_itself.py | 5 +++++ 4 files changed, 28 insertions(+) diff --git a/libvirt/tests/src/virt_admin/management/virt_admin_server_threadpool_set.py b/libvirt/tests/src/virt_admin/management/virt_admin_server_threadpool_set.py index f247f614fb..40ac201625 100644 --- a/libvirt/tests/src/virt_admin/management/virt_admin_server_threadpool_set.py +++ b/libvirt/tests/src/virt_admin/management/virt_admin_server_threadpool_set.py @@ -1,4 +1,7 @@ import logging as log + +from avocado.utils import process + from virttest import virt_admin from virttest import utils_libvirtd @@ -28,6 +31,11 @@ def run(test, params, env): max_workers_gt_nworkers = params.get("max_workers_gt_nworkers") == "yes" options_test_together = params.get("options_test_together") == "yes" + process.run("systemctl status virtproxyd-admin.socket", shell=True) + process.run("systemctl status virtproxyd", shell=True) + virtproxyd_admin_socket = utils_libvirtd.DaemonSocket("virtproxyd-admin.socket") + virtproxyd_admin_socket.restart() + if not server_name: server_name = virt_admin.check_server_name() diff --git a/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_list.py b/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_list.py index 850397395e..4d23bd5a35 100644 --- a/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_list.py +++ b/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_list.py @@ -1,4 +1,8 @@ import re + +from avocado.utils import process + +from virttest import utils_libvirtd from virttest import virt_admin @@ -14,6 +18,10 @@ def run(test, params, env): if not server_name: server_name = virt_admin.check_server_name() + process.run("systemctl status virtproxyd-admin.socket", shell=True) + process.run("systemctl status virtproxyd", shell=True) + virtproxyd_admin_socket = utils_libvirtd.DaemonSocket("virtproxyd-admin.socket") + virtproxyd_admin_socket.restart() vp = virt_admin.VirtadminPersistent() result = vp.srv_list(ignore_status=True, debug=True) output = result.stdout.strip() diff --git a/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_threadpool_info.py b/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_threadpool_info.py index 730d978277..12b572e5ef 100644 --- a/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_threadpool_info.py +++ b/libvirt/tests/src/virt_admin/monitor/virt_admin_srv_threadpool_info.py @@ -1,3 +1,5 @@ +from avocado.utils import process + from virttest import virt_admin from virttest import utils_libvirtd @@ -21,6 +23,11 @@ def run(test, params, env): if not server_name: server_name = virt_admin.check_server_name() + process.run("systemctl status virtproxyd-admin.socket", shell=True) + process.run("systemctl status virtproxyd", shell=True) + virtproxyd_admin_socket = utils_libvirtd.DaemonSocket("virtproxyd-admin.socket") + virtproxyd_admin_socket.restart() + config = virt_admin.managed_daemon_config() daemon = utils_libvirtd.Libvirtd("virtproxyd") diff --git a/libvirt/tests/src/virt_admin/virt_admin_itself.py b/libvirt/tests/src/virt_admin/virt_admin_itself.py index 867b77bea5..6e0c941a4f 100644 --- a/libvirt/tests/src/virt_admin/virt_admin_itself.py +++ b/libvirt/tests/src/virt_admin/virt_admin_itself.py @@ -6,6 +6,7 @@ from avocado.utils import process from avocado.core import exceptions +from virttest import utils_libvirtd from virttest import virt_admin @@ -73,6 +74,10 @@ def run(test, params, env): pwd_status_error = params.get("pwd_status_error", "no") echo_status_error = params.get("echo_status_error", "no") + process.run("systemctl status virtproxyd-admin.socket", shell=True) + process.run("systemctl status virtproxyd", shell=True) + virtproxyd_admin_socket = utils_libvirtd.DaemonSocket("virtproxyd-admin.socket") + virtproxyd_admin_socket.restart() # Run virtadmin command in interactive mode vp = virt_admin.VirtadminPersistent()