Skip to content

Commit

Permalink
Debug unix connection case
Browse files Browse the repository at this point in the history
Signed-off-by: lcheng <[email protected]>
  • Loading branch information
cliping committed Nov 8, 2023
1 parent c1a4895 commit f061d62
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions virttest/utils_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from aexpect import remote

from avocado.core import exceptions
from avocado.utils import distro
from avocado.utils import path
from avocado.utils import process

Expand Down Expand Up @@ -1948,8 +1949,8 @@ def conn_recover(self):
runner("systemctl start virtqemud")
else:
runner("systemctl daemon-reload")
runner("systemctl stop libvirtd.socket")
runner("systemctl stop libvirtd")
runner("systemctl stop libvirtd.socket")
runner("systemctl start libvirtd.socket")
runner("systemctl reset-failed libvirtd")
runner("systemctl start libvirtd")
Expand Down Expand Up @@ -2139,10 +2140,20 @@ def conn_setup(self):
runner("systemctl daemon-reload")
runner("systemctl stop libvirtd")
runner("systemctl stop libvirtd.socket")
runner("systemctl start libvirtd.socket")
runner("systemctl start libvirtd.socket", ignore_status=True)
runner("journalctl -u libvirtd.socket", ignore_status=True)
utils_misc.wait_for(
lambda: process.system('systemctl status libvirtd.socket',
ignore_status=True, shell=True) == 0, 10)
if process.system('systemctl status libvirtd.socket', ignore_status=True, shell=True):
# On RHEL 8, SELinux is preventing systemd from create
# access on the sock_file libvirt-sock. We can generate
# a local policy module to allow this access.
if distro.detect().name == 'rhel' and int(distro.detect().version) == 8:
process.run("ausearch -c 'systemd' --raw | audit2allow -M my-systemd",
ignore_status=True, shell=True)
process.run("semodule -X 300 -i my-systemd.pp", ignore_status=True, shell=True)
runner("systemctl start libvirtd.socket")
runner("systemctl reset-failed libvirtd")
runner("systemctl start libvirtd")
current_session.close()
Expand Down

0 comments on commit f061d62

Please sign in to comment.