Skip to content

Commit

Permalink
Enable virt_use_nfs when selinux is enforcing
Browse files Browse the repository at this point in the history
In function setup_or_cleanup_nfs, when selinux is enforcing, it only
prints a debug message asking libvirt to enable virt_use_nfs, but
doesn't exit. This hides a bug when in CI env, the virt_use_nfs may be
set by other scripts or not, so another script using the function may
fail randomly if it doesn't set virt_use_nfs as required.

Since virt_use_nfs is a very common operation, it's fine to enable
it here.

Signed-off-by: Xiaodai Wang <[email protected]>
  • Loading branch information
xiaodwan committed Jul 1, 2024
1 parent da1f1fe commit 6eec9f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions virttest/utils_test/libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def setup_or_cleanup_nfs(
'"setsebool virt_use_nfs on" to get '
"nfs access right."
)
process.run("setsebool virt_use_nfs on", shell=True)
_nfs.setup()
nfs_mount_info = (
process.run("nfsstat -m", shell=True).stdout_text.strip().split(",")
Expand Down

0 comments on commit 6eec9f6

Please sign in to comment.