Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ build:x86_64-qnx --extra_toolchains=@score_qnx_x86_64_ifs_toolchain//:ifs-x86_64
build:arm64-qnx --config=shared
build:arm64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
build:arm64-qnx --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0
build:arm64-qnx --extra_toolchains=@score_qnx_aarch64_ifs_toolchain//:ifs-aarch64-qnx-sdp_8.0.0

# -------------------------------------------------------------------------------
# Import local user workspace file, if exists
Expand Down Expand Up @@ -131,6 +132,16 @@ test:clang-tidy --aspects=//tools/lint:linters.bzl%clang_tidy_aspect
test:clang-tidy --output_groups=+rules_lint_report
test:clang-tidy --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux

# -------------------------------------------------------------------------------
# QEMU integration tests (py_itf_test) — powered by score_itf
# -------------------------------------------------------------------------------
# Runs the test inside a user/network namespace that creates its own tap0 device,
# so no host tap device or sudo is needed. Requires access to /dev/kvm.
# Run with: bazel test --config=qemu //score/tests/feature:test_feature_qemu_linux_x86_64
test:qemu --run_under=@score_itf//scripts:run_under_qemu
# ext4 toolchain to build the disk image with the binaries under test (--qemu-disk).
build:qemu --extra_toolchains=@score_linux_x86_64_ext4_toolchain//:ext4-x86_64-linux

# -------------------------------------------------------------------------------
# CodeQL static analysis — MISRA C++:2023
# -------------------------------------------------------------------------------
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

name: Test / End-to-End (QEMU, Linux x86_64)

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# The QEMU tests are tagged "manual" (they need --config=qemu, KVM and CAP_NET_RAW), so they are
# not part of //score/... and must be named explicitly here.
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
merge_group:
types: [checks_requested]
workflow_dispatch:

jobs:
e2e-linux-x86_64:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Checkout Repository
uses: actions/checkout@v6

- name: Setup Bazel
uses: eclipse-score/cicd-actions/setup-bazel-cache@212bbf86267e9381da9d2daf962d12f6feafbc90 # v0.0.2
with:
# Cache keys cannot contain commas, and the workflow name "Test / End-to-End (QEMU, Linux x86_64)" has one.
unique-cache-name: ${{ github.job }}

- name: Install QEMU and image tooling
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends qemu-system-x86 qemu-utils cloud-image-utils

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls -l /dev/kvm

- name: Allow unprivileged user namespaces
# run_under_qemu creates its own user/network namespace; Ubuntu 24.04 restricts this via AppArmor.
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Run end-to-end tests
run: |
bazel test --config=x86_64-linux --config=qemu --verbose_failures \
//score/tests/feature:test_feature_qemu_linux_x86_64

- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-logs
path: bazel-testlogs/score/tests/**/test.log
if-no-files-found: ignore
24 changes: 23 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ use_repo(
"score_gcc_aarch64_toolchain",
"score_gcc_x86_64_toolchain",
"score_qcc_aarch64_toolchain",
"score_qcc_aarch64_toolchain_pkg",
"score_qcc_x86_64_toolchain",
"score_qcc_x86_64_toolchain_pkg",
)
Expand Down Expand Up @@ -267,6 +268,7 @@ git_override(

bazel_dep(name = "score_itf", version = "0.7.0")

bazel_dep(name = "score_os_images", version = "0.0.5", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.9.0", dev_dependency = True)

bazel_dep(name = "rules_pkg", version = "1.2.0")
Expand Down Expand Up @@ -299,7 +301,27 @@ imagefs.toolchain(
target_os = "qnx",
type = "ifs",
)
use_repo(imagefs, "score_qnx_x86_64_ifs_toolchain")
imagefs.toolchain(
name = "score_qnx_aarch64_ifs_toolchain",
sdp_to_import = "@score_qcc_aarch64_toolchain_pkg",
# See score_qnx_x86_64_ifs_toolchain for why this is 8.0.0.
sdp_version = "8.0.0",
target_cpu = "aarch64",
target_os = "qnx",
type = "ifs",
)
imagefs.toolchain(
name = "score_linux_x86_64_ext4_toolchain",
target_cpu = "x86_64",
target_os = "linux",
type = "ext4",
)
use_repo(
imagefs,
"score_linux_x86_64_ext4_toolchain",
"score_qnx_aarch64_ifs_toolchain",
"score_qnx_x86_64_ifs_toolchain",
)

## JSON Schema validation (build-time lint)

Expand Down
86 changes: 85 additions & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading