From f187d567c5688b4c38180ecdb5651ecbd7e3891c Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 26 Dec 2024 14:27:12 +0530 Subject: [PATCH] sync tests with upstream Resolves: RHEL-69441 Signed-off-by: Lokesh Mandvekar --- plans/main.fmf | 26 ++++++++++------- test/main.fmf | 9 ++---- test/podman-tests.sh | 60 ++-------------------------------------- test/tag-repository.repo | 10 ------- 4 files changed, 20 insertions(+), 85 deletions(-) delete mode 100644 test/tag-repository.repo diff --git a/plans/main.fmf b/plans/main.fmf index 34eb453..2e13af5 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -2,17 +2,23 @@ discover: how: fmf execute: how: tmt -prepare: - how: shell - script: cp -f $TMT_TREE/test/tag-repository.repo /etc/yum.repos.d/. adjust: - when: initiator == packit because: "We need to test with updated packages from rhcontainerbot/podman-next copr" prepare+: how: shell - script: sed -i -n '/^priority=/!p;$apriority=5' /etc/yum.repos.d/*:rhcontainerbot:podman-next.repo - - when: distro == centos-stream or distro == rhel - because: "bats package is present in epel" + script: | + sed -i -n '/^priority=/!p;$apriority=1' /etc/yum.repos.d/*podman-next*.repo + dnf -y upgrade --allowerasing + # FIXME: Use epel10 once bats is available there + - when: distro == centos-stream-10 or distro == rhel-10 + because: "bats isn't yet available on epel10" + prepare+: + how: install + copr: rhcontainerbot/bats-el10 + package: bats + - when: distro == centos-stream-9 or distro == rhel-9 + because: "bats is present on EPEL on rhel9 / c9s" prepare+: how: feature epel: enabled @@ -22,13 +28,13 @@ adjust: discover+: filter: tag:upstream adjust+: - - when: initiator is not defined or initiator != packit - enabled: false + - enabled: false + when: initiator is not defined or initiator != packit /downstream: summary: Run SELinux specific Podman tests on bodhi / errata and dist-git PRs discover+: filter: tag:downstream adjust+: - - when: initiator == packit - enabled: false + - enabled: false + when: initiator == packit diff --git a/test/main.fmf b/test/main.fmf index 4e78ba0..bded6bc 100644 --- a/test/main.fmf +++ b/test/main.fmf @@ -1,11 +1,11 @@ -# Only common dependencies that are NOT required to run podman-tests.sh are -# specified here. Everything else is in podman-tests.sh. require: - bats - container-selinux - cpio - golang - make + - podman + - podman-tests - policycoreutils /basic_check: @@ -13,11 +13,6 @@ require: summary: Run basic checks test: make basic_check -/podman_e2e_test: - tag: [ upstream, downstream ] - summary: Run SELinux specific Podman e2e tests - test: make podman_e2e_test - /podman_system_test: tag: [ upstream, downstream ] summary: Run SELinux specific Podman system tests diff --git a/test/podman-tests.sh b/test/podman-tests.sh index 7f262b6..0033d25 100644 --- a/test/podman-tests.sh +++ b/test/podman-tests.sh @@ -9,64 +9,8 @@ if [[ "$(id -u)" -ne 0 ]];then exit 1 fi -if [[ -z "$1" ]]; then - echo -e "Usage: $(basename ${BASH_SOURCE[0]}) TEST_TYPE\nTEST_TYPE can be 'e2e' or 'system'\n" - exit 1 -fi - -TEST_TYPE=$1 - -# Fetch and extract latest podman source from the highest priority dnf repo -# NOTE: On upstream pull-requests, the srpm will be fetched from the -# podman-next copr while on bodhi updates, it will be fetched from Fedora's -# official repos. -PODMAN_DIR=$(mktemp -d) -pushd $PODMAN_DIR - -# Download podman and podman-tests rpms, along with podman srpm -dnf download podman podman-tests -# Download srpm, srpm opts differ between dnf and dnf5 -rpm -q dnf5 && dnf download --srpm podman || dnf download --source podman - -# Ensure podman-tests RPM and podman SRPM version-release match -# NOTE: podman RPM and podman-tests RPM matching is ensured by podman.spec so -# matching podman-tests and podman srpm is sufficient here. -PODMAN_TESTS_VERSION=$(ls podman-tests* | sed -e "s/.$(uname -m).rpm//" -e "s/podman-tests-//") -PODMAN_SRPM_VERSION=$(ls podman*.src.rpm | sed -e "s/.src.rpm//" -e "s/podman-//") -if [[ "$PODMAN_TESTS_VERSION" != "$PODMAN_SRPM_VERSION" ]]; then - echo "podman-tests and podman srpm version-release don't match" - exit 1 -fi - -# Install downloaded podman and podman-tests rpms -dnf -y install ./podman*.$(uname -m).rpm - -# Extract and untar podman source from srpm -rpm2cpio $(ls podman*.src.rpm) | cpio -di -# podman.spec on CentOS Stream fetches multiple source tarballs -for file in *.tar.gz; do tar -zxf "$file"; done - -popd - # Print versions of distro and installed packages rpm -q bats container-selinux golang podman podman-tests selinux-policy -if [[ "$TEST_TYPE" == "e2e" ]]; then - # /tmp is often unsufficient - export TMPDIR=/var/tmp - - # dnf5 contains breaking changes - # Either of `dnf` OR `dnf5` will be installed, never both. - # To fetch srpm, dnf uses `--source`, dnf5 uses `--srpm`. - #rpm -q dnf5 && SRPM_OPTS="--srpm" || SRPM_OPTS="--source" - - # Run podman e2e tests - pushd $PODMAN_DIR/podman-*/test/e2e - PODMAN_BINARY=/usr/bin/podman go test -v config.go config_amd64.go common_test.go libpod_suite_test.go run_selinux_test.go - popd -fi - -if [[ "$TEST_TYPE" == "system" ]]; then - # Run podman system tests - bats /usr/share/podman/test/system/410-selinux.bats -fi +# Run podman system tests +bats /usr/share/podman/test/system/410-selinux.bats diff --git a/test/tag-repository.repo b/test/tag-repository.repo deleted file mode 100644 index 13c828b..0000000 --- a/test/tag-repository.repo +++ /dev/null @@ -1,10 +0,0 @@ -[testing-farm-tag-repository] -name=Tag repository for c9s-build -baseurl=https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/$basearch/ -gpgcheck=0 -enabled=1 -priority=9 -skip_if_unavailable=True -# See TFT-847 - glibc32* -# See TFT-1284 - beakerlib -exclude=glibc32* beakerlib