From 46e6adc3eeffd55fd43aa63de1aea74a6086a21c Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Wed, 4 Oct 2023 10:25:04 -0400 Subject: [PATCH] Packit: enable podman e2e tests and EL testing This commit enables podman's e2e tests and also enables testing for epel 8 and 9 environments. The test scripts are replaced by inline scripting in the fmf file itself making it much easier to maintain. Signed-off-by: Lokesh Mandvekar --- .packit.yaml | 30 +++++++++++++++++++----------- plans/common_setup.sh | 17 ----------------- plans/main.fmf | 35 +++++++++++++++++++++++++++++++++-- plans/podman_e2e_test.sh | 14 -------------- plans/podman_system_test.sh | 7 ------- 5 files changed, 52 insertions(+), 51 deletions(-) delete mode 100644 plans/common_setup.sh delete mode 100644 plans/podman_e2e_test.sh delete mode 100644 plans/podman_system_test.sh diff --git a/.packit.yaml b/.packit.yaml index dcd1874..6af48be 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -16,10 +16,11 @@ jobs: message: "Ephemeral COPR build failed. @containers/packit-build please check." enable_net: true # container-selinux is noarch so we only need to test on one arch - targets: &pr_copr_targets + targets: - fedora-all - - centos-stream-9 - - centos-stream-8 + - fedora-eln + - epel-9 + - epel-8 # Run on commit to main branch - job: copr_build @@ -33,17 +34,24 @@ jobs: enable_net: true # All tests specified in the `/plans/` subdir - # FIXME: uncomment e2e tests after disk space issues resolved on testing farm - #- job: tests - # trigger: pull_request - # targets: *test_targets - # identifier: podman_e2e_test - # tmt_plan: "/plans/podman_e2e_test" + - job: tests + trigger: pull_request + notifications: + failure_comment: + message: "podman e2e tests failed. @containers/packit-build please check." + targets: &pr_test_targets + - fedora-all + - epel-9 + - epel-8 + identifier: podman_e2e_test + tmt_plan: "/plans/podman_e2e_test" - job: tests trigger: pull_request - # arch assumed to be x86_64 by default. - targets: *pr_copr_targets + notifications: + failure_comment: + message: "podman system tests failed. @containers/packit-build please check." + targets: *pr_test_targets identifier: podman_system_test tmt_plan: "/plans/podman_system_test" diff --git a/plans/common_setup.sh b/plans/common_setup.sh deleted file mode 100644 index 5228ac7..0000000 --- a/plans/common_setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# Clean all prior dnf metadata -dnf clean all - -# Disable rhcontainerbot/packit-builds to avoid testing with -# packages built from unmerged content of other repos. -dnf -y copr disable rhcontainerbot/packit-builds - -# Fetch podman and other dependencies from rhcontainerbot/podman-next. -. /etc/os-release -if [ $(NAME) == "CentOS Stream" ]; then - dnf -y copr enable rhcontainerbot/podman-next centos-stream+epel-next-$(VERSION) -else - dnf -y copr enable rhcontainerbot/podman-next -fi -dnf -y --disablerepo=testing-farm-* install bats golang podman podman-tests diff --git a/plans/main.fmf b/plans/main.fmf index a11da87..41e0e0d 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -1,11 +1,42 @@ +prepare: + - name: Disable testing-farm dnf repos + how: shell + script: dnf config-manager --disable testing-farm-tag-repository + - name: Install packages + how: install + copr: rhcontainerbot/podman-next + package: + - bats + - golang + - podman + - podman-tests + /podman_e2e_test: summary: Run SELinux specific Podman e2e tests execute: how: tmt - script: bash plans/podman_e2e_test.sh + script: | + echo "Checking installed versions of golang, podman and podman-tests..." + rpm -q golang podman podman-tests + if [ -f /etc/fedora-release ]; then + echo "Resizing tmpfs..." + mount -o remount,size=10G /tmp + fi + echo "Fetching podman srpm from copr..." + dnf --disablerepo=* --enablerepo=copr:copr.fedorainfracloud.org:rhcontainerbot:podman-next download --source podman + echo "Extracting podman source from srpm..." + rpm2cpio podman*.src.rpm | cpio -di + tar zxf podman-*-dev.tar.gz + echo "Running podman e2e tests..." + cd podman-*-dev/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 /podman_system_test: summary: Run SELinux specific Podman system tests execute: how: tmt - script: bash plans/podman_system_test.sh + script: | + echo "Checking versions of podman and podman-tests..." + rpm -q podman podman-tests + echo "Running podman system tests..." + bats /usr/bin/podman /usr/share/podman/test/system/410-selinux.bats diff --git a/plans/podman_e2e_test.sh b/plans/podman_e2e_test.sh deleted file mode 100644 index 71107d6..0000000 --- a/plans/podman_e2e_test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Copr repo setup handled in common_setup.sh -. ./plans/common_setup.sh - -# Fetch and prep Podman source from latest SRPM on -# rhcontainerbot/podman-next copr -dnf --disablerepo=* --enablerepo=copr:copr.fedorainfracloud.org:rhcontainerbot:podman-next download --source podman -rpm2cpio podman*.src.rpm | cpio -di -tar zxf podman*.tar.gz -cd podman/test/e2e - -# Run SELinux specific Podman e2e tests -PODMAN_BINARY=/usr/bin/podman go test -v config.go config_amd64.go common_test.go libpod_suite_test.go run_selinux_test.go diff --git a/plans/podman_system_test.sh b/plans/podman_system_test.sh deleted file mode 100644 index ec65b7d..0000000 --- a/plans/podman_system_test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Copr repo setup handled in common_setup.sh -. ./plans/common_setup.sh - -# Run Podman's SELinux system tests -bats /usr/bin/podman /usr/share/podman/test/system/410-selinux.bats