Skip to content

Commit

Permalink
packit/tmt: initial enablement
Browse files Browse the repository at this point in the history
This commit adds a test to vendor HEAD into podman and check if podman
builds successfully.

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Oct 12, 2023
1 parent 09776aa commit 2fcdc71
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
34 changes: 34 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# See the documentation for more information:
# https://packit.dev/docs/configuration/

jobs:
# All tests specified in the `/plans/` subdir
# Podman build test for Fedora and CentOS Stream
- 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_build_test
skip_build: true
tmt_plan: "/plans/podman_build_test"

# Podman build test for RHEL
#- job: tests
# trigger: pull_request
# use_internal_tf: true
# # notifications:
# #failure_comment:
# # message: "podman e2e tests failed on RHEL. @containers/packit-build please check."
# targets: &pr_test_targets_rhel
# epel-9-x86_64:
# distros: [RHEL-9.2.0-Nightly]
# epel-8-x86_64:
# distros: [RHEL-8.10.0-Nightly]
# identifier: podman_e2e_test_internal
# tmt_plan: "/plans/podman_e2e_test"
46 changes: 46 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# tmt does provide the `adjust` attribute to manage distro conditionals, but
# the bash way has been rather convenient to read, manage and copy-paste
# Ref: https://tmt.readthedocs.io/en/stable/spec/core.html#adjust
prepare:
- how: shell
script: |
RHEL_RELEASE=$(rpm --eval %{?rhel})
ARCH=$(uname -m)
if [ $RHEL_RELEASE -eq 8 ]; then
echo "Disabling container-tools module..."
dnf -y module disable container-tools
fi
if [ -f /etc/centos-release ]; then
echo "Installing epel-release..."
dnf -y install epel-release
elif [ $RHEL_RELEASE -ge 8 ]; then
echo "Installing epel-release..."
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$RHEL_RELEASE.noarch.rpm
echo "Enabling epel repo..."
dnf config-manager --set-enabled epel
cat /etc/yum.repos.d/epel.repo
fi
dnf -y copr enable rhcontainerbot/podman-next
dnf config-manager --save --setopt="*:rhcontainerbot:podman-next.priority=5"
- how: install
package:
- golang

/podman_build_test:
summary: Run Podman build test
execute:
how: tmt
script: |
echo "Checking /etc/redhat-release..."
cat /etc/redhat-release
echo "Checking installed versions of required packages..."
echo "Cloning podman..."
git clone https://github.com/containers/podman
cd podman
echo "Installing dependencies..."
dnf -y builddep rpm/podman.spec
echo "Vendoring HEAD into podman..."
go mod edit -require github.com/containers/common@HEAD
make vendor
echo "Building podman..."
make binaries

0 comments on commit 2fcdc71

Please sign in to comment.