Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virt_admin: Fix failed to connect to the admin server issue #6108

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import logging as log

from avocado.utils import process

from virttest import virt_admin
from virttest import utils_libvirtd

Expand Down Expand Up @@ -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()

Expand Down
8 changes: 8 additions & 0 deletions libvirt/tests/src/virt_admin/monitor/virt_admin_srv_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import re

from avocado.utils import process

from virttest import utils_libvirtd
from virttest import virt_admin


Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from avocado.utils import process

from virttest import virt_admin
from virttest import utils_libvirtd

Expand All @@ -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")

Expand Down
5 changes: 5 additions & 0 deletions libvirt/tests/src/virt_admin/virt_admin_itself.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from avocado.utils import process
from avocado.core import exceptions

from virttest import utils_libvirtd
from virttest import virt_admin


Expand Down Expand Up @@ -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()

Expand Down