From 37d551ab16e88f65ccaadbfdff82098fc6984932 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Mon, 31 Mar 2025 23:40:38 +0200 Subject: [PATCH] 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 --- plans/testing-farm-iproute.fmf | 34 ++++++++++++++++++++++++++++++++++ plans/tier0-im.fmf | 18 ++++++++++++++++++ tests/Containerfile | 30 ++++++++++++++++++++++++++++++ tests/testing-farm.fmf | 3 +++ 4 files changed, 85 insertions(+) create mode 100644 plans/testing-farm-iproute.fmf create mode 100644 plans/tier0-im.fmf create mode 100644 tests/Containerfile create mode 100644 tests/testing-farm.fmf diff --git a/plans/testing-farm-iproute.fmf b/plans/testing-farm-iproute.fmf new file mode 100644 index 0000000..ece2f35 --- /dev/null +++ b/plans/testing-farm-iproute.fmf @@ -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 diff --git a/plans/tier0-im.fmf b/plans/tier0-im.fmf new file mode 100644 index 0000000..12f6d72 --- /dev/null +++ b/plans/tier0-im.fmf @@ -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 diff --git a/tests/Containerfile b/tests/Containerfile new file mode 100644 index 0000000..6fa1172 --- /dev/null +++ b/tests/Containerfile @@ -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 <> /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 diff --git a/tests/testing-farm.fmf b/tests/testing-farm.fmf new file mode 100644 index 0000000..c1404a7 --- /dev/null +++ b/tests/testing-farm.fmf @@ -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