From ca7816e12962e7bed526aa07e6635bb7966edd38 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Wed, 10 Dec 2025 08:55:11 +0800 Subject: [PATCH] test: Update to work with OSCI gating test Signed-off-by: Xiaofeng Wang --- hack/os-image-map.json | 2 ++ .../booted/test-soft-reboot-selinux-policy.nu | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hack/os-image-map.json b/hack/os-image-map.json index 661558b1b..80ab247c4 100644 --- a/hack/os-image-map.json +++ b/hack/os-image-map.json @@ -1,5 +1,7 @@ { "base": { + "rhel-10.2": "images.paas.redhat.com/bootc/rhel-bootc:latest-10.2", + "rhel-9.8": "images.paas.redhat.com/bootc/rhel-bootc:latest-9.8", "centos-9": "quay.io/centos-bootc/centos-bootc:stream9", "centos-10": "quay.io/centos-bootc/centos-bootc:stream10", "fedora-42": "quay.io/fedora/fedora-bootc:42", diff --git a/tmt/tests/booted/test-soft-reboot-selinux-policy.nu b/tmt/tests/booted/test-soft-reboot-selinux-policy.nu index ca06efeae..d5a057e76 100644 --- a/tmt/tests/booted/test-soft-reboot-selinux-policy.nu +++ b/tmt/tests/booted/test-soft-reboot-selinux-policy.nu @@ -32,11 +32,30 @@ def initial_build [] { bootc image copy-to-storage + # copy-to-storage does not copy repo file + # but OSCI gating test needs repo to install package + let os = open /usr/lib/os-release + | lines + | filter {|l| $l != "" and not ($l | str starts-with "#") } + | parse "{key}={value}" + | reduce {|it, acc| + $acc | upsert $it.key ($it.value | str trim -c '"') + } + mut repo_copy = "" + + if $os.ID == "rhel" { + cp /etc/yum.repos.d/rhel.repo . + $repo_copy = "COPY rhel.repo /etc/yum.repos.d/" + } + # Create a derived container that installs a custom SELinux policy module # Installing a policy module will change the compiled policy checksum # Following Colin's suggestion and the composefs-rs example # We create a minimal policy module and install it - "FROM localhost/bootc + $" +FROM localhost/bootc +($repo_copy) + # Install tools needed to build and install SELinux policy modules RUN dnf install -y selinux-policy-devel checkpolicy policycoreutils