diff --git a/.packit.yaml b/.packit.yaml index 4b6cb92..2f048d0 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -9,6 +9,7 @@ upstream_tag_template: v{version} files_to_sync: - src: rpm/gating.yaml dest: gating.yaml + delete: true - src: plans/ dest: plans/ delete: true @@ -51,7 +52,7 @@ jobs: packages: [container-selinux-centos] notifications: *copr_build_failure_notification enable_net: true - targets: + targets: ¢os_targets - centos-stream-9 - centos-stream-10 @@ -86,15 +87,23 @@ jobs: message: "Tests failed. @containers/packit-build please check." targets: - fedora-all + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo # Tests for CentOS Stream - job: tests trigger: pull_request packages: [container-selinux-centos] notifications: *test_failure_notification - targets: - - centos-stream-9 - - centos-stream-10 + targets: *centos_targets + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/centos-stream-$releasever/rhcontainerbot-podman-next-centos-stream-$releasever.repo # Tests for RHEL - job: tests @@ -105,11 +114,13 @@ jobs: targets: epel-9-x86_64: distros: [RHEL-9.4.0-Nightly,RHEL-9-Nightly] - # Use centos-stream-10 until we have epel-10 - # TODO: Enable after RHEL-10 gets selinux-policy >= 40.13.1 which is - # already on CentOS Stream 10. - #centos-stream-10-x86_64: - # distros: [RHEL-10-Beta-Nightly] + tf_extra_params: + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/epel-$releasever/rhcontainerbot-podman-next-epel-$releasever.repo + - type: repository-file + id: https://src.fedoraproject.org/rpms/epel-release/raw/epel9/f/epel.repo - job: propose_downstream trigger: release diff --git a/plans/all.fmf b/plans/all.fmf index b6ec398..9e0d10b 100644 --- a/plans/all.fmf +++ b/plans/all.fmf @@ -12,7 +12,7 @@ execute: when: initiator is not defined or initiator != packit /downstream: - summary: Run SELinux specific Podman e2e tests on bodhi / errata and dist-git PRs + summary: Run SELinux specific Podman tests on bodhi / errata and dist-git PRs discover+: filter: tag:downstream adjust+: diff --git a/test/Makefile b/test/Makefile index 083ca93..5fee1ea 100644 --- a/test/Makefile +++ b/test/Makefile @@ -3,21 +3,13 @@ basic_check: semodule --list=full | grep container semodule -B -.PHONY: podman_e2e_test_upstream -podman_e2e_test_upstream: - bash ./podman-tests.sh e2e upstream +.PHONY: podman_e2e_test +podman_e2e_test: + bash ./podman-tests.sh e2e -.PHONY: podman_e2e_test_downstream -podman_e2e_test_downstream: - bash ./podman-tests.sh e2e downstream - -.PHONY: podman_system_test_upstream -podman_system_test_upstream: - bash ./podman-tests.sh system upstream - -.PHONY: podman_system_test_downstream -podman_system_test_downstream: - bash ./podman-tests.sh system downstream +.PHONY: podman_system_test +podman_system_test: + bash ./podman-tests.sh system clean: rm -rf podman-*dev* podman.spec diff --git a/test/main.fmf b/test/main.fmf index 6543521..8c30075 100644 --- a/test/main.fmf +++ b/test/main.fmf @@ -6,24 +6,16 @@ require: - policycoreutils /basic_check: - summary: Run basic checks tag: [ upstream, downstream ] + summary: Run basic checks test: make basic_check -/upstream: - tag: upstream -/upstream/podman_e2e_test: - summary: Run SELinux specific Podman e2e tests on upstream PRs - test: make podman_e2e_test_upstream -/upstream/podman_system_test: - summary: Run SELinux specific Podman system tests on upstream PRs - test: make podman_system_test_upstream +/podman_e2e_test: + tag: [ upstream, downstream ] + summary: Run SELinux specific Podman e2e tests + test: make podman_e2e_test -/downstream: - tag: downstream -/downstream/podman_e2e_test: - summary: Run SELinux specific Podman e2e tests on downstream bodhi / errata and dist-git PRs - test: make podman_e2e_test_downstream -/downstream/podman_system_test: - summary: Run SELinux specific Podman system tests on downstream bodhi / errata and dist-git PRs - test: make podman_system_test_downstream +/podman_system_test: + tag: [ upstream, downstream ] + summary: Run SELinux specific Podman system tests + test: make podman_system_test diff --git a/test/podman-tests.sh b/test/podman-tests.sh index 50a29e2..b758cc8 100644 --- a/test/podman-tests.sh +++ b/test/podman-tests.sh @@ -2,37 +2,19 @@ set -exo pipefail +cat /etc/redhat-release + if [[ "$(id -u)" -ne 0 ]];then echo "Please run as superuser" exit 1 fi if [[ -z "$1" ]]; then - echo -e "Usage: podman-tests.sh TEST_TYPE STREAM\nTEST_TYPE can be 'e2e' or 'system'\nSTREAM can be 'upstream' or 'downstream'" + echo -e "Usage: $(basename ${BASH_SOURCE[0]}) TEST_TYPE\nTEST_TYPE can be 'e2e' or 'system'\n" exit 1 fi TEST_TYPE=$1 -STREAM=$2 - -# `rhel` macro exists on RHEL, CentOS Stream, and Fedora ELN -# `centos` macro exists only on CentOS Stream -CENTOS_VERSION=$(rpm --eval '%{?centos}') -RHEL_VERSION=$(rpm --eval '%{?rhel}') - -# For upstream tests, we need to test with podman and other packages from the -# podman-next copr. For downstream tests (bodhi, errata), we don't need any -# additional setup -if [[ "$STREAM" == "upstream" ]]; then - # Use CentOS Stream 10 copr target for RHEL-10 until EPEL 10 becomes - # available - if [[ -n $CENTOS_VERSION || $RHEL_VERSION -ge 10 ]]; then - dnf -y copr enable rhcontainerbot/podman-next centos-stream-$CENTOS_VERSION - else - dnf -y copr enable rhcontainerbot/podman-next - fi - echo "priority=5" >> /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:rhcontainerbot:podman-next.repo -fi # Remove testing-farm repos if they exist as these interfere with the packages # we want to install, especially when podman-next copr is involved @@ -69,18 +51,11 @@ tar zxf *.tar.gz popd -# Enable EPEL on RHEL/CentOS Stream envs to fetch bats -if [[ -n $(rpm --eval '%{?rhel}') ]]; then - # Until EPEL 10 is available use epel-9 for all RHEL and CentOS Stream - dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - sed -i 's/$releasever/9/g' /etc/yum.repos.d/epel.repo -fi - # Install dependencies for running tests +# NOTE: bats will be fetched from Fedora repos on public testing-farm envs if EPEL repo is absent or disabled. dnf -y install bats golang # Print versions of distro and installed packages -cat /etc/redhat-release rpm -q bats container-selinux golang podman podman-tests selinux-policy if [[ "$TEST_TYPE" == "e2e" ]]; then