Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Run e2e test on Packit #638

Merged
merged 13 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions .github/workflows/integration.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
---
specfile_path: contrib/packaging/bootc.spec

files_to_sync:
- contrib/packaging/bootc.spec
- .packit.yaml

upstream_tag_template: v{version}

upstream_package_name: bootc
downstream_package_name: bootc

srpm_build_deps:
- cargo
- git
- zstd
- libzstd-devel
- ostree-devel
- openssl-devel

actions:
# The last setp here is required by Packit to return the archive name
# https://packit.dev/docs/configuration/actions#create-archive
create-archive:
- bash -c "cargo install cargo-vendor-filterer"
- bash -c "cargo xtask spec"
- bash -c "cat target/bootc.spec"
- bash -c "cp target/bootc* contrib/packaging/"
- bash -c "ls -1 target/bootc*.tar.zstd | grep -v 'vendor'"
# Do nothing with spec file. Two steps here are for debugging
fix-spec-file:
- bash -c "cat contrib/packaging/bootc.spec"
- bash -c "ls -al contrib/packaging/"

jobs:
# Only add CS10 and RHEL-9 RPM build test
# But no e2e test on CS10 and RHEL-9
- job: copr_build
trigger: pull_request
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-9-ppc64le
- fedora-40-x86_64
- fedora-40-aarch64
- fedora-40-ppc64le
- fedora-rawhide-x86_64
- fedora-rawhide-aarch64
- fedora-rawhide-ppc64le
- rhel-9-x86_64
- rhel-9-aarch64

- job: tests
trigger: pull_request
targets:
Expand All @@ -8,3 +58,21 @@ jobs:
tmt_plan: /integration-build
skip_build: true
identifier: integration-test

- job: tests
trigger: pull_request
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- fedora-40-x86_64
tmt_plan: /to-existing-root
identifier: e2e-test-to-existing-root

- job: tests
trigger: pull_request
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- fedora-40-aarch64
tmt_plan: /to-disk
identifier: e2e-test-to-disk
59 changes: 59 additions & 0 deletions plans/e2e.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
discover:
how: fmf
test: e2e
adjust:
- when: arch == x86_64 or arch == aarch64
provision:
hardware:
cpu:
processors: ">= 2"
memory: ">= 6 GB"
virtualization:
is-supported: true
prepare:
- how: shell
script: |
source /etc/os-release
if [[ "$ID" == "centos" ]]; then
# EPEL for genisoimage
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
fi
- how: install
package:
- ansible-core
- firewalld
- podman
- skopeo
- jq
- openssl
- qemu-img
- qemu-kvm
- libvirt
- virt-install
- genisoimage
- how: shell
script: ansible-galaxy collection install https://ansible-collection.s3.amazonaws.com/ansible-posix-1.5.4.tar.gz https://ansible-collection.s3.amazonaws.com/community-general-8.5.0.tar.gz
execute:
how: tmt

/to-existing-root:
summary: Run bootc install to-existing-root and bootc switch test locally (nested)
environment+:
TEST_CASE: to-existing-root
discover+:
test:
- /to-existing-root
adjust+:
- when: arch == ppc64le
enabled: false
Comment on lines +39 to +48
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This syntax is YAML sorcery to me...is there any description of what the / and + do in particular?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When configure tmt plan or test, it supports regular expression, starting with / to avoid regular expression, but just a string match. The / comes from plan or test name, for example:

➜ tmt test ls
/tests/e2e/e2e/to-disk
/tests/e2e/e2e/to-existing-root
/tests-integration/build-image

The + means adding addition configuration based on top level configuration. In this case, The top level has adjust configured already.


/to-disk:
summary: Run bootc install to-disk and bootc upgrade test locally (nested)
environment+:
TEST_CASE: to-disk
discover+:
test:
- /to-disk
adjust+:
- when: arch == ppc64le
enabled: false
101 changes: 0 additions & 101 deletions plans/install-upgrade.fmf

This file was deleted.

11 changes: 11 additions & 0 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## End to end (e2e) Test

### Scenarios

End to end (e2e) test includes `bootc install to-existing-root`, `bootc install to-disk`, `bootc upgrade`, and `bootc switch` tests

* bootc install/upgrade/switch scenario will install, upgrade, and switch bootc image and have some system checking, such as check mount point/permission, run podman with root and rootless, check persistent log, etc.

### Run end to end Test

Test run is drived by [Packit](https://packit.dev/) and running on [Testing-farm](https://docs.testing-farm.io/).
Loading
Loading