ci: add Testing Farm test via tmt for Konflux CI#4515
ci: add Testing Farm test via tmt for Konflux CI#4515Roshan-R wants to merge 1 commit intocoreos:mainfrom
Conversation
Add tmt test infrastructure to hook into Konflux CI via Testing Farm The new test pulls the newly built coreos-assembler container image and verifies that it can successfully build a Fedora CoreOS image from scratch using a fedora-coreos-config checkout.
There was a problem hiding this comment.
Code Review
This pull request introduces a TMT-based testing framework for coreos-assembler, including Tekton integration for Testing Farm, TMT plans, and a test script for containerized builds. The reviewer identified several improvement opportunities: replacing hardcoded Git references in the Tekton configuration with dynamic parameters, refining the list of required packages in the TMT plan to include podman, and enhancing the test script's reliability by ensuring directory existence and applying proper variable quoting.
| value: https://github.com/Roshan-R/coreos-assembler | ||
| - name: GIT_REF | ||
| value: tmt-testing |
There was a problem hiding this comment.
The GIT_URL and GIT_REF parameters are currently hardcoded to a personal fork and a specific branch (Roshan-R/coreos-assembler and tmt-testing). For integration into the main repository, these should be updated to point to the official repository or use dynamic Tekton parameters to ensure the tests are executed against the correct source code.
| - wget | ||
| - jq | ||
| - git |
There was a problem hiding this comment.
The packages wget, jq, and git are being installed in the test environment but do not appear to be used by the host-side test.sh script. The git command used in the test is executed inside the coreos-assembler container. Conversely, the script relies on podman, which should be explicitly listed if it is not guaranteed to be present in the base image.
- podman
|
|
||
| # IMAGE_URL is the coreos-assembler image that is built by konflux for each run. | ||
| export COREOS_ASSEMBLER_CONTAINER="$IMAGE_URL" | ||
| export COSA_DIR=$HOME/workspace/build |
There was a problem hiding this comment.
It is recommended to ensure that the $COSA_DIR directory exists before it is mounted as a volume. If the directory is missing, podman might create it with root ownership, which can lead to permission issues for the builder user inside the container. Additionally, quoting the path is a best practice to handle potential spaces.
| export COSA_DIR=$HOME/workspace/build | |
| export COSA_DIR="$HOME/workspace/build" | |
| mkdir -p "$COSA_DIR" |
| podman run --rm --security-opt=label=disable --privileged \ | ||
| -v=${COSA_DIR}:/srv/ --device=/dev/kvm \ | ||
| --device=/dev/fuse --tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa ${COREOS_ASSEMBLER_CONTAINER} "$@"; |
There was a problem hiding this comment.
The volume mount and image variable should be quoted to prevent word splitting or issues with special characters. Also, the trailing semicolon at the end of the command is unnecessary in a bash script.
| podman run --rm --security-opt=label=disable --privileged \ | |
| -v=${COSA_DIR}:/srv/ --device=/dev/kvm \ | |
| --device=/dev/fuse --tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa ${COREOS_ASSEMBLER_CONTAINER} "$@"; | |
| podman run --rm --security-opt=label=disable --privileged \ | |
| -v "${COSA_DIR}:/srv/" --device=/dev/kvm \ | |
| --device=/dev/fuse --tmpfs=/tmp -v /var/tmp:/var/tmp --name=cosa "${COREOS_ASSEMBLER_CONTAINER}" "$@" |
|
/retest |
Add tmt test infrastructure to hook into Konflux CI via Testing Farm
The new test pulls the newly built coreos-assembler container image and verifies that it can successfully build a Fedora CoreOS image from scratch using a fedora-coreos-config checkout.