1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 15:45:53 +01:00

test: Use SRPM as test code source to work with gating test (#1670)

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
This commit is contained in:
Xiaofeng Wang
2025-10-08 11:47:44 +08:00
committed by GitHub
parent de3c29fce0
commit f1dec83720
5 changed files with 34 additions and 23 deletions

View File

@@ -12,6 +12,7 @@ COPY ARTIFACTS /var/ARTIFACTS
# Copy bootc repo
COPY test-artifacts /var/share/test-artifacts
ARG GATING
RUN <<EORUN
set -xeuo pipefail
. /usr/lib/os-release
@@ -22,6 +23,12 @@ cp test-artifacts.repo /etc/yum.repos.d/
dnf -y update bootc
./provision-derived.sh
if [[ "$GATING" == true ]]; then
# Install Fedora CI/OSCI required packages for "Prepare dist-git sources" task
dnf install -y rpm-build @buildsys-build 'dnf-command(builddep)'
dnf builddep -y /var/share/test-artifacts/*.src.rpm
fi
# For test-22-logically-bound-install
cp -a lbi/usr/. /usr
for x in curl.container curl-base.image podman.image; do

View File

@@ -5,14 +5,8 @@
- name: Reboot after system-reinstall-bootc
hosts: all
tasks:
- name: Check system mode
shell: bootc status --json | jq -r '.status.type'
register: os_mode
# null type means package mode
- name: Reboot system to image mode
reboot:
when: os_mode.stdout == 'null'
- name: Wait for connection to become reachable/usable
wait_for_connection:

View File

@@ -4,16 +4,6 @@ set -exuo pipefail
# Check environment
printenv
# This script only runs on Packit and gating environment
# Do not run this script for image mode system
if command -v bootc >/dev/null && bootc status --json | grep '"type":"bootcHost"'; then
echo "This system is Image Mode."
exit 0
fi
# Install required packages
dnf install -y podman skopeo jq bootc system-reinstall-bootc expect ansible-core
# temp folder to save building files and folders
BOOTC_TEMPDIR=$(mktemp -d)
trap 'rm -rf -- "$BOOTC_TEMPDIR"' EXIT
@@ -87,6 +77,9 @@ if [[ -v KOJI_TASK_ID ]] || [[ -v CI_KOJI_TASK_ID ]]; then
echo "$TMT_SOURCE_DIR"
ls -al "$TMT_SOURCE_DIR"
ls -al "$TMT_SOURCE_DIR/SRPMS"
GATING="true"
else
GATING="false"
fi
ls -al /etc/yum.repos.d
@@ -100,7 +93,7 @@ cp /etc/yum.repos.d/test-artifacts.repo "$BOOTC_TEMPDIR"
ls -al "$BOOTC_TEMPDIR" "${BOOTC_TEMPDIR}/bin"
# Do not use just because it's only available on Fedora, not on CS and RHEL
podman build --jobs=4 --from "$BASE" -v "$BOOTC_TEMPDIR":/bootc-test:z -t localhost/bootc-integration -f "${BOOTC_TEMPDIR}/Containerfile.packit" "$BOOTC_TEMPDIR"
podman build --jobs=4 --from "$BASE" --build-arg GATING="$GATING" -v "$BOOTC_TEMPDIR":/bootc-test:z -t localhost/bootc-integration -f "${BOOTC_TEMPDIR}/Containerfile.packit" "$BOOTC_TEMPDIR"
# Keep these in sync with what's used in hack/lbi
podman pull -q --retry 5 --retry-delay 5s quay.io/curl/curl:latest quay.io/curl/curl-base:latest registry.access.redhat.com/ubi9/podman:latest