From 1c2dfcbcfc19aa03b40f15927f9e5739fe2e655e Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 3 Apr 2025 16:44:47 +0530 Subject: [PATCH] gating: fetch bats from source The tests subpackage no longer dpeends on bats rpm. Resolves: RHEL-80817 Signed-off-by: Lokesh Mandvekar --- oci-seccomp-bpf-hook.spec | 4 ++-- tests/test_osbh.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/oci-seccomp-bpf-hook.spec b/oci-seccomp-bpf-hook.spec index 348d4e7..da3df70 100644 --- a/oci-seccomp-bpf-hook.spec +++ b/oci-seccomp-bpf-hook.spec @@ -62,13 +62,13 @@ the Container Pod concept popularized by Kubernetes. Summary: Tests for %{name} Requires: %{name} = %{version}-%{release} -Requires: bats Requires: podman %description tests %{summary} -This package contains system tests for %{name} +This subpackage contains system tests for %{name}. It's only meant for gating +tests. End user / customer usage cases are not supported. %prep %autosetup -Sgit -n %{name}-%{built_tag_strip} diff --git a/tests/test_osbh.sh b/tests/test_osbh.sh index 4967c2a..8584024 100755 --- a/tests/test_osbh.sh +++ b/tests/test_osbh.sh @@ -1,14 +1,22 @@ #!/bin/bash -e +# Fetch and install bats +BATS_VERSION=1.11.1 +curl -L https://github.com/bats-core/bats-core/archive/refs/tags/v$BATS_VERSION.tar.gz | tar zx +pushd bats-core-$BATS_VERSION +./install.sh /usr +popd + + # Log program and kernel versions echo "Important package versions:" ( uname -r - rpm -qa | egrep 'podman|conmon|crun|runc|iptable|slirp|systemd|container-selinux' | sort + rpm -qa | grep -E 'podman|conmon|crun|runc|iptable|slirp|systemd|container-selinux' | sort ) | sed -e 's/^/ /' # Log environment; or at least the useful bits echo "Environment:" env | grep -v LS_COLORS= | sort | sed -e 's/^/ /' -bats /usr/share/oci-seccomp-bpf-hook/test/system +/usr/bin/bats /usr/share/oci-seccomp-bpf-hook/test/system