From d0dc80d9e3d1d9d3aa119472c53e139f99c080c7 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..d66889ebe3 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() == "Enforcing": + 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)