Skip to content

Commit

Permalink
Merge pull request #6119 from cliping/hooks
Browse files Browse the repository at this point in the history
libvirt_hooks: update network hooks
  • Loading branch information
dzhengfy authored Jan 13, 2025
2 parents 7077fc3 + 8153557 commit 1af4cdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libvirt/tests/src/libvirt_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import platform
import time

from avocado.utils import distro
from avocado.utils import process

from virttest import virt_vm
Expand Down Expand Up @@ -53,6 +54,9 @@ def prepare_hook_file(hook_op):
with open(hook_file, 'w') as hf:
hf.write('\n'.join(hook_lines))
os.chmod(hook_file, 0o755)
if distro.detect().name == 'rhel' and int(distro.detect().version) > 9:
process.run("restorecon -Rv /etc/libvirt/hooks", ignore_status=False, shell=True)
process.run("setsebool -P virt_hooks_unconfined on", ignore_status=False, shell=True)

# restart libvirtd
libvirtd.restart()
Expand Down

0 comments on commit 1af4cdf

Please sign in to comment.