From 1ac9a75bd464d1aba412a17f0812d2910af465ae Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Tue, 24 Jun 2025 16:56:41 +0200 Subject: [PATCH 1/2] config: core: rootfs: add curl to kselftest rootfs This is required to upload artifacts when enabling code coverage. Signed-off-by: Arnaud Ferraris --- config/core/rootfs-configs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/core/rootfs-configs.yaml b/config/core/rootfs-configs.yaml index f3189b3ff8..75d047dfb9 100644 --- a/config/core/rootfs-configs.yaml +++ b/config/core/rootfs-configs.yaml @@ -278,6 +278,7 @@ rootfs_configs: - bc - bpftool - ca-certificates + - curl - ethtool - iperf3 - iproute2 From fe38a2a251023dab3decad779c1c656fcc424879 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Tue, 24 Jun 2025 16:58:25 +0200 Subject: [PATCH 2/2] config: runtime: tests: kselftest*: enable coverage support When the kernel is built with GCOV support, we want to pack and upload coverage data as a job artifact. Add the following bits to the job templates to make that happen. Signed-off-by: Arnaud Ferraris --- config/runtime/tests/kselftest-platform-parameters.jinja2 | 7 ++++++- config/runtime/tests/kselftest.jinja2 | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config/runtime/tests/kselftest-platform-parameters.jinja2 b/config/runtime/tests/kselftest-platform-parameters.jinja2 index ee2c25eca6..9e09f7c28b 100644 --- a/config/runtime/tests/kselftest-platform-parameters.jinja2 +++ b/config/runtime/tests/kselftest-platform-parameters.jinja2 @@ -26,7 +26,9 @@ - tar xf main.tar.gz -C /opt/ name: platform-test-parameters-fetch path: inline/platform-test-parameters-fetch.yaml - +{% if "coverage" in node.data.config_full %} +{% include "util/gcov-reset.jinja2" %} +{% endif %} - repository: https://github.com/kernelci/test-definitions.git from: git revision: kernelci.org @@ -39,3 +41,6 @@ TST_CASENAME: '{{ tests }}' SKIP_INSTALL: True ENV: '{{ env }}' +{% if "coverage" in node.data.config_full %} +{% include "util/gcov-upload.jinja2" %} +{% endif %} diff --git a/config/runtime/tests/kselftest.jinja2 b/config/runtime/tests/kselftest.jinja2 index 05ceb15ef1..62c1ea4d9c 100644 --- a/config/runtime/tests/kselftest.jinja2 +++ b/config/runtime/tests/kselftest.jinja2 @@ -13,7 +13,9 @@ - systemctl stop systemd-timesyncd || true name: timesync-off path: inline/timesync-off.yaml - +{% if "coverage" in node.data.config_full %} +{% include "util/gcov-reset.jinja2" %} +{% endif %} - repository: https://github.com/kernelci/test-definitions.git from: git revision: kernelci.org @@ -26,3 +28,6 @@ TST_CASENAME: '{{ tests }}' SKIP_INSTALL: True ENV: '{{ env }}' +{% if "coverage" in node.data.config_full %} +{% include "util/gcov-upload.jinja2" %} +{% endif %}