Skip to content

Commit

Permalink
libvirt_hooks: update network hooks
Browse files Browse the repository at this point in the history
According to RHEL-41168, update case.

Signed-off-by: lcheng <[email protected]>
  • Loading branch information
cliping committed Jan 9, 2025
1 parent eca2264 commit 8153557
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 8153557

Please sign in to comment.