Skip to content

Commit

Permalink
tests/conversion: SELinux is no longer in images:centos/9-Stream (#298
Browse files Browse the repository at this point in the history
)

Rather than assume it is there or not, let's only disable it if the
config file is present. This should keep it working even if SElinux is
reintroduced in the image.
  • Loading branch information
simondeziel authored Oct 1, 2024
2 parents fe3b7de + c4f9583 commit 6aa5493
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/conversion
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ if hasNeededAPIExtension instance_import_conversion; then

# XXX: Disable SELinux before exporting the instance, as it will block lxd-agent
# when re-imported.
lxc exec v1 -- sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
if lxc exec v1 -- test -e /etc/selinux/config; then
lxc exec v1 -- sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
fi

# Export instance and extract raw image.
lxc stop v1
Expand Down

0 comments on commit 6aa5493

Please sign in to comment.