From 5316576bb9005ff33b15bb26cd9df4215e28be45 Mon Sep 17 00:00:00 2001 From: Simon Scatton Date: Fri, 18 Sep 2026 13:23:29 +0200 Subject: [PATCH] test(tmachine): verify SELinux in Fedora scenarios Closes #2973 Closes #2976 Signed-off-by: Simon Scatton --- tests/ansible/playbooks/selinux.yaml | 20 ++++++++++++++++++++ tests/config.nix | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 tests/ansible/playbooks/selinux.yaml diff --git a/tests/ansible/playbooks/selinux.yaml b/tests/ansible/playbooks/selinux.yaml new file mode 100644 index 0000000000..996ccba2e7 --- /dev/null +++ b/tests/ansible/playbooks/selinux.yaml @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +--- +- name: Verify SELinux + hosts: all + gather_facts: false + + tasks: + - name: Read the current SELinux mode + ansible.builtin.command: + cmd: getenforce + register: selinux_mode + changed_when: false + + - name: Verify enforcing mode + ansible.builtin.assert: + that: + - selinux_mode.stdout == "Enforcing" + fail_msg: SELinux is not enforcing. diff --git a/tests/config.nix b/tests/config.nix index b22c79f6c1..3ccccc54d3 100644 --- a/tests/config.nix +++ b/tests/config.nix @@ -63,6 +63,7 @@ let use_galaxy = false; playbooks = [ "ansible/playbooks/nextest.yaml" + "ansible/playbooks/selinux.yaml" "ansible/playbooks/podman-rootful.yaml" ]; }; @@ -87,6 +88,7 @@ let use_galaxy = false; playbooks = [ "ansible/playbooks/nextest.yaml" + "ansible/playbooks/selinux.yaml" "ansible/playbooks/podman-rootless.yaml" ]; };