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 ed6f676095
commit 37d551ab16
4 changed files with 85 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

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

@ -0,0 +1,18 @@
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 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-10.0
# Add nightly compose repo into container image to install iproute
RUN cat <<EOF >> /etc/yum.repos.d/rhel-10.repo
[rhel10-baseos]
name=rhel10-baseos
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-10/nightly/RHEL-10/latest-RHEL-10.0/compose/BaseOS/\$basearch/os/
enabled=1
gpgcheck=0
repo_gpgcheck=0
[rhel10-appstream]
name=rhel10-appstream
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-10/nightly/RHEL-10/latest-RHEL-10.0/compose/AppStream/\$basearch/os/
enabled=1
gpgcheck=0
repo_gpgcheck=0
[epel10]
name=epel10
baseurl=https://dl.fedoraproject.org/pub/epel/10/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: 20m