From patchwork Thu Dec 19 13:09:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22407 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4540EC3272 for ; Thu, 19 Dec 2024 13:09:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9FA126846C; Thu, 19 Dec 2024 14:09:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="diVjwzN2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF2AE61899 for ; Thu, 19 Dec 2024 14:09:35 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 158C3161 for ; Thu, 19 Dec 2024 14:08:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734613737; bh=tn877aAlKw02GdDx0I2Qy2ud9whiaaAs4PKPK8TmpJM=; h=From:To:Subject:Date:From; b=diVjwzN2oS80wwSO/pKZCE/L5EdrlPHw1JrhmJewKwAdRezn8r0jdlD8290jjID+S P8EcEeDuQFzivPdzVNeWt3FI1F5HT+3ULEdY5JmdoZ/NG51rwtrvsl9+rCiSU9p7Xj Cb1qD+C4+6SJSOOk25ILzzzCkL0B5JC9Y1g+BSNA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v4] Add job to run lc-compliance on the virtual pipeline handler Date: Thu, 19 Dec 2024 14:09:32 +0100 Message-ID: <20241219130932.520066-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new job named `test-lc-compliance:virtual` that uses the build artifacts created by the `build-package:debug` job on amd64 to run `lc-compliance` on the "Virtual0" camera in a virtual machine. Signed-off-by: Barnabás Pőcze --- This needs libcamera changes to work and to run in reasonable time: * https://patchwork.libcamera.org/project/libcamera/list/?series=4874 * https://patchwork.libcamera.org/patch/22379/ * https://patchwork.libcamera.org/patch/22406/ Changes in v4: * add `set -x` to see the full commands run inside the virtual machine * activate installed example configuration of the virtual pipeline handler Changes in v2: * publish lc-compliance results to gitlab * add and use script to install libcamera binary package --- .gitlab-ci/test-lc-compliance.sh | 40 +++++++++++++++++++++++++++++++ .gitlab-ci/unpackage-libcamera.sh | 17 +++++++++++++ gitlab-ci.yml | 22 ++++++++++++++++- 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100755 .gitlab-ci/test-lc-compliance.sh create mode 100755 .gitlab-ci/unpackage-libcamera.sh -- 2.47.1 diff --git a/.gitlab-ci/test-lc-compliance.sh b/.gitlab-ci/test-lc-compliance.sh new file mode 100755 index 0000000..6208723 --- /dev/null +++ b/.gitlab-ci/test-lc-compliance.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2024 Google Inc. + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_compliance() { + echo "Running libcamera compliance tests in a qemu VM" + + virtme-ng \ + --verbose \ + --skip-modules \ + --force-9p \ + --rwdir "$PWD/build" \ + --run /opt/linux/bzImage \ + --exec " \ + set -x; \ + mv /usr/local/share/libcamera/pipeline/virtual/virtual.yaml.example \ + /usr/local/share/libcamera/pipeline/virtual/virtual.yaml; \ + LIBCAMERA_LOG_LEVELS=*:DEBUG \ + ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 \ + UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 \ + GTEST_OUTPUT=xml:./build/lc-compliance-report.xml \ + lc-compliance -c Virtual0; \ + echo \\\$? > ./build/.test-status; \ + " + + local status=$(cat build/.test-status) + echo "Test result exit state: $status" + rm build/.test-status + + if [[ $status != 0 ]] ; then + exit $status + fi +} + +run libcamera_compliance diff --git a/.gitlab-ci/unpackage-libcamera.sh b/.gitlab-ci/unpackage-libcamera.sh new file mode 100755 index 0000000..9eb3192 --- /dev/null +++ b/.gitlab-ci/unpackage-libcamera.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2024 Google Inc. + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_unpackage() { + echo "Unpackage libcamera binaries" + + tar -xvf libcamera-${CI_COMMIT_SHA}.tar.xz -C / + ldconfig -v +} + +run libcamera_unpackage diff --git a/gitlab-ci.yml b/gitlab-ci.yml index d268285..ec19f55 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -280,7 +280,7 @@ build-package:debug: -D b_sanitize=address,undefined -D cpp_debugstl=true -D force_fallback_for=['gtest'] - -D pipelines=['auto'] + -D pipelines=['auto','virtual'] -D auto_features=disabled -D lc-compliance=enabled -D test=false @@ -411,3 +411,23 @@ test-unit: artifacts: reports: junit: build/meson-logs/testlog.junit.xml + +test-lc-compliance:virtual: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:12 + - .libcamera-ci.scripts + stage: test + needs: + - job: build-package:debug + parallel: + matrix: + - ARCH: amd64 + tags: + - kvm + script: + - $CI_PROJECT_DIR/.gitlab-ci/unpackage-libcamera.sh + - $CI_PROJECT_DIR/.gitlab-ci/test-lc-compliance.sh + artifacts: + reports: + junit: build/lc-compliance-report.xml