Skip to content

Commit

Permalink
Reinstate testing farm tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Faria <[email protected]>
  • Loading branch information
albertofaria committed Apr 25, 2024
1 parent 3a8c7b8 commit 1f43ea7
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 28 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
70 changes: 45 additions & 25 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,51 @@ srpm_build_deps:
- openssl-devel

jobs:
- job: copr_build
# - job: copr_build
# trigger: pull_request
# notifications:
# failure_comment:
# message: "Ephemeral COPR build failed. @containers/packit-build please check."
# targets:
# fedora-all-x86_64: {}
# fedora-all-aarch64: {}
# fedora-eln-x86_64:
# additional_repos:
# - "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/x86_64/"
# fedora-eln-aarch64:
# additional_repos:
# - "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/aarch64/"
# additional_repos:
# - "copr://rhcontainerbot/podman-next"
# enable_net: true

# - job: copr_build
# trigger: commit
# notifications:
# failure_comment:
# message: "podman-next COPR build failed. @containers/packit-build please check."
# branch: main
# owner: rhcontainerbot
# project: podman-next
# enable_net: true

- &tests
job: tests
trigger: pull_request
notifications:
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
targets:
fedora-all-x86_64: {}
fedora-all-aarch64: {}
fedora-eln-x86_64:
additional_repos:
- "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/x86_64/"
fedora-eln-aarch64:
additional_repos:
- "https://kojipkgs.fedoraproject.org/repos/eln-build/latest/aarch64/"
additional_repos:
- "copr://rhcontainerbot/podman-next"
skip_build: true
enable_net: true
targets:
# - fedora-all-x86_64
# - fedora-all-aarch64
- fedora-40-x86_64
- fedora-40-aarch64
identifier: docker
tmt_plan: /tests/docker

# Run on commit to main branch
- job: copr_build
trigger: commit
notifications:
failure_comment:
message: "podman-next COPR build failed. @containers/packit-build please check."
branch: main
owner: rhcontainerbot
project: podman-next
enable_net: true
# - <<: *tests
# identifier: podman
# tmt_plan: /tests/podman

# - <<: *tests
# identifier: rootful-podman
# tmt_plan: /tests/rootful-podman
59 changes: 59 additions & 0 deletions plans/tests.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
provision:
hardware:
virtualization:
is-supported: true

prepare:
- &deps
name: Install dependencies
how: install
package:
- bash
- cargo
- coreutils
- crun
- crun-krun
- docker
- genisoimage
- grep
- guestfs-tools
- libselinux-devel
- libvirt-client
- libvirt-daemon-driver-qemu
- openssh
- openssh-clients
- passt
- podman
- qemu-img
- qemu-system-aarch64-core
- qemu-system-x86-core
- sed
- util-linux
- virtiofsd

execute:
how: tmt
script: |
set -ex
export PATH=$PATH:/root/.cargo/bin
export LIBGUESTFS_BACKEND=direct
tag=$( awk -F= '/^VERSION_ID=/ {print tolower($2)}' /etc/os-release )
export CRUN_VM_TEST_ENV_BASE_IMAGE=quay.io/containerdisks/fedora:$tag
tests/env.sh build
tests/env.sh start
tests/env.sh run "$ENGINE" all

/docker:
summary: Run all tests under Docker
environment:
ENGINE: docker

/podman:
summary: Run all tests under Podman
environment:
ENGINE: podman

/rootful-podman:
summary: Run all tests under Rootful Podman
environment:
ENGINE: rootful-podman
17 changes: 14 additions & 3 deletions tests/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o errexit -o pipefail -o nounset

start_time="$( date +%s%N )"

env_image_base=quay.io/containerdisks/fedora:40
env_image_base=${CRUN_VM_TEST_ENV_BASE_IMAGE:-"quay.io/containerdisks/fedora:40"}
env_image=quay.io/crun-vm/test-env:latest
container_name=crun-vm-test-env

Expand Down Expand Up @@ -155,6 +155,12 @@ build)
;;
aarch64)
root_part=/dev/sda3

# enable nested virt
virt-customize \
--add "$temp_dir/image" \
--append-line '/etc/default/grub:GRUB_CMDLINE_LINUX_DEFAULT="kvm-arm.mode=nested"' \
--run-command 'grub2-mkconfig -o /boot/grub2/grub.cfg'
;;
esac

Expand All @@ -173,9 +179,14 @@ build)
--name "$container_name-build" \
--runtime "$runtime" \
--memory 8g \
--rm -dit \
--rm -it \
--rootfs "$temp_dir" \
--persistent
--persistent &

sleep 120
kill %1
wait
exit 42

# shellcheck disable=SC2317
__extra_cleanup() {
Expand Down

0 comments on commit 1f43ea7

Please sign in to comment.