Add image-mode testing

Provide a Containerfile to build the container to test iproute, and an
ad-hoc test plan for image-mode. Use testing-farm to test it.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
This commit is contained in:
Andrea Claudi 2025-03-31 23:40:38 +02:00
parent e31d652c69
commit 99bcf6c067
4 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,34 @@
provision:
# nested virtualization supported runner required
hardware:
cpu:
processors: ">= 2"
memory: ">= 6 GB"
virtualization:
is-supported: true
prepare:
- how: install
package:
- git
- podman
- skopeo
- tmt+provision-virtual
- tmt+provision-bootc
- how: shell
script: |
systemctl start libvirtd
systemctl status libvirtd
environment:
TMT_VERBOSE: 1
execute:
how: tmt
discover:
how: fmf
test:
- /testing-farm
finish:
how: shell
script:
# move all tmt plan logs to tmt plan data folder
- mkdir -p $TMT_PLAN_DATA/test-tmt-log
- cp -r /var/tmp/tmt/run-* $TMT_PLAN_DATA/test-tmt-log

19
plans/tier0-im.fmf Normal file
View File

@ -0,0 +1,19 @@
provision:
# use bootc plugin
# plugin configuration doc: https://tmt.readthedocs.io/en/stable/plugins/provision.html#bootc
how: bootc
container-file: /tests/Containerfile
container-file-workdir: .
disk: 20
prepare:
- how: shell
script: |
rpm -q --whatprovides kernel-modules-extra || rpm-ostree install --apply-live --idempotent --allow-inactive --assumeyes kernel-modules-extra
rpm -q --whatprovides man || rpm-ostree install --apply-live --idempotent --allow-inactive --assumeyes man
summary: Execute iproute Tier0 tests
discover:
how: fmf
filter: 'tier: 0'
url: https://gitlab.cee.redhat.com/kernel-qe/networking/iproute.git
execute:
how: tmt

30
tests/Containerfile Normal file
View File

@ -0,0 +1,30 @@
# Choose nightly base image from https://images.paas.redhat.com/repository/bootc/rhel-bootc?tab=tags
FROM images.paas.redhat.com/bootc/rhel-bootc:latest-9.6
# Add nightly compose repo into container image to install iproute
RUN cat <<EOF >> /etc/yum.repos.d/rhel-9.repo
[rhel96-baseos]
name=rhel96-baseos
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.6/compose/BaseOS/\$basearch/os/
enabled=1
gpgcheck=0
repo_gpgcheck=0
[rhel96-appstream]
name=rhel96-appstream
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.6/compose/AppStream/\$basearch/os/
enabled=1
gpgcheck=0
repo_gpgcheck=0
[epel9]
name=epel9
baseurl=https://dl.fedoraproject.org/pub/epel/9/Everything/\$basearch/
enabled=1
gpgcheck=0
repo_gpgcheck=0
EOF
# Install packages from nightly compose
RUN dnf -y install iproute && \
dnf clean all

3
tests/testing-farm.fmf Normal file
View File

@ -0,0 +1,3 @@
summary: Deploy testing farm runner to run iproute tmt test
test: cd .. && tmt run -vvvvv plans --name /plans/tier0-im
duration: 10m