From 2406a76026bd9a969bd2257ab73a1fa71bcfed4e Mon Sep 17 00:00:00 2001 From: Dehan Meng Date: Fri, 13 Dec 2024 10:54:02 +0800 Subject: [PATCH] qemu_guest_agent: selinux should be optimised selinux should be permissive when call _change_bl. in case effect other cases. Signed-off-by: Dehan Meng --- qemu/tests/qemu_guest_agent.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qemu/tests/qemu_guest_agent.py b/qemu/tests/qemu_guest_agent.py index 8bef5b030a..bb44bf6a2b 100644 --- a/qemu/tests/qemu_guest_agent.py +++ b/qemu/tests/qemu_guest_agent.py @@ -1873,6 +1873,11 @@ def _change_bl(self, session): """ if self.params.get("os_type") == "linux": + error_context.context( + "Set selinux policy to 'Permissive' mode in guest.", LOG_JOB.info + ) + if session.cmd_output("getenforce").strip() != "Permissive": + session.cmd("setenforce 0") cmd_blacklist_backup = self.params["black_file_backup"] session.cmd(cmd_blacklist_backup) full_qga_ver = self._get_qga_version(session, self.vm, main_ver=False)