From 99bcf6c0670adad36b46c35a0ce81ac8007b47c3 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 | 19 +++++++++++++++++++ tests/Containerfile | 30 ++++++++++++++++++++++++++++++ tests/testing-farm.fmf | 3 +++ 4 files changed, 86 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..41cc31e --- /dev/null +++ b/plans/tier0-im.fmf @@ -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 diff --git a/tests/Containerfile b/tests/Containerfile new file mode 100644 index 0000000..aaf3706 --- /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-9.6 + +# Add nightly compose repo into container image to install iproute +RUN cat <> /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 diff --git a/tests/testing-farm.fmf b/tests/testing-farm.fmf new file mode 100644 index 0000000..ac3cf32 --- /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: 10m