Skip to content

Commit

Permalink
Packit: enable podman e2e tests
Browse files Browse the repository at this point in the history
The test scripts are replaced by inline scripting in the fmf file itself
making it much easier to maintain.

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Oct 4, 2023
1 parent 1a74da5 commit c5ecc30
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 51 deletions.
31 changes: 20 additions & 11 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,17 +34,25 @@ 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
# TODO: re-enable these once https://github.com/containers/podman/pull/20262 is merged.
#- 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"

Expand Down
17 changes: 0 additions & 17 deletions plans/common_setup.sh

This file was deleted.

41 changes: 39 additions & 2 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
prepare:
- name: Disable testing-farm dnf repos
how: shell
script: |
if [ $(rpm --eval %{rhel}) <= 8 ]; then
dnf -y module disable container-tools
fi
if [[ ! -f /etc/redhat-release || $(rpm --eval %{?fedora}) > 37 ]]; then
dnf config-manager --disable testing-farm-tag-repository
fi
- 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
14 changes: 0 additions & 14 deletions plans/podman_e2e_test.sh

This file was deleted.

7 changes: 0 additions & 7 deletions plans/podman_system_test.sh

This file was deleted.

0 comments on commit c5ecc30

Please sign in to comment.