From c4f958387f2dff743c649651da2c93cc51659782 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 1 Oct 2024 09:23:52 -0400 Subject: [PATCH] tests/conversion: SELinux is no longer in `images:centos/9-Stream` 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. Signed-off-by: Simon Deziel --- tests/conversion | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conversion b/tests/conversion index ee1ee0bb..7b08179d 100755 --- a/tests/conversion +++ b/tests/conversion @@ -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