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
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ coverage --features=coverage
coverage --combined_report=lcov
coverage --cache_test_results=no

build:host --platforms=@score_bazel_platforms//:x86_64-linux
build:host --define=config=host
build:host --sandbox_writable_path=/opt/score

# Common Lifecycle Toolchain flags for build (do not use it in case of system toolchains!)
build:toolchain_common --incompatible_strict_action_env
build:toolchain_common --host_platform=@score_bazel_platforms//:x86_64-linux
Expand All @@ -54,6 +58,8 @@ build:x86_64-qnx --config=toolchain_common
build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix
build:x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix
build:x86_64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800
build:x86_64-qnx --extra_toolchains=@rules_python//python/runtime_env_toolchains:all
build:x86_64-qnx --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64

# Target configuration for CPU:AArch64|OS:QNX build (do not use it in case of system toolchains!)
build:arm64-qnx --config=stub
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_and_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
contents: read
pull-requests: read
with:
bazel-target: 'test //src/... //tests/... --config=x86_64-linux'
bazel-target: 'test //src/... //tests/... --config=host' # use host for now until linux qemu is available
upload-name: 'bazel-testlogs'
build-docs:
needs: run-tests
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ __pycache__/

# Rust
debug/
target/
/target/
/build/

*~
Expand Down
18 changes: 17 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ bazel_dep(name = "score_rust_policies", version = "0.0.3")

bazel_dep(name = "score_process", version = "1.4.3", dev_dependency = True)
bazel_dep(name = "score_platform", version = "0.5.3", dev_dependency = True)
bazel_dep(name = "score_toolchains_qnx", version = "0.0.6", dev_dependency = True)

toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency = True)
toolchains_qnx.sdp(
sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63",
strip_prefix = "installation",
url = "https://www.qnx.com/download/download/79858/installation.tgz",
)
use_repo(toolchains_qnx, "toolchains_qnx_ifs")

## Configure the C++ toolchain
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True)
Expand Down Expand Up @@ -117,7 +126,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_depen
pip.parse(
hub_name = "pip_score_venv_test",
python_version = PYTHON_VERSION,
requirements_lock = "//tests/integration:requirements.lock",
requirements_lock = "//tests/utils:requirements.lock",
)
use_repo(pip, "pip_score_venv_test")

Expand All @@ -134,3 +143,10 @@ git_override(
# Replace the commit hash (above) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main).
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
)

bazel_dep(name = "score_itf", version = "0.1.0")
git_override(
module_name = "score_itf",
commit = "7b99c23ccccd9a75113ab4c1ef5c22dee98316f8",
remote = "https://github.com/etas-contrib/score_itf.git",
) # Using a fork until itf is stable
858 changes: 643 additions & 215 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

34 changes: 26 additions & 8 deletions config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,40 @@
# *******************************************************************************
config_setting(
name = "x86_64-linux",
define_values = {
"config": "x86_64-linux",
},
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)

config_setting(
name = "arm64-linux",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:arm64",
],
)

config_setting(
name = "x86_64-qnx",
define_values = {
"config": "x86_64-qnx",
},
constraint_values = [
"@platforms//os:qnx",
"@platforms//cpu:x86_64",
],
)

config_setting(
name = "arm64-qnx",
constraint_values = [
"@platforms//os:qnx",
"@platforms//cpu:arm64",
],
)

config_setting(
name = "build_qnx8",
name = "host",
define_values = {
"config": "build_qnx8",
"config": "host",
},
)

Expand Down
9 changes: 1 addition & 8 deletions config/flatbuffers_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ def _flatbuffer_json_to_bin_impl(ctx):
mnemonic = "FlatcGeneration",
)

rf = ctx.runfiles(
files = [out],
root_symlinks = {
("_main/" + ctx.attr.out_dir + "/" + out_name): out,
},
)

return DefaultInfo(files = depset([out]), runfiles = rf)
return DefaultInfo(files = depset([out]))

flatbuffer_json_to_bin = rule(
implementation = _flatbuffer_json_to_bin_impl,
Expand Down
31 changes: 31 additions & 0 deletions scripts/clean_vm_network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
# *******************************************************************************
# 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
# *******************************************************************************

set -e

if [ "$(id -u)" -ne 0 ]; then
echo "Error: This script must be run as root (use sudo)" >&2
exit 1
fi

BRIDGE_DEVICE="br0"
TAP_DEVICE="tap0"

ip link set "$TAP_DEVICE" nomaster
ip link set "$TAP_DEVICE" down
ip link delete "$TAP_DEVICE"
ip link set "$BRIDGE_DEVICE" down
ip link delete "$BRIDGE_DEVICE"

echo "Network cleaned up: bridge $BRIDGE_DEVICE with $TAP_DEVICE"
34 changes: 34 additions & 0 deletions scripts/setup_vm_network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
# *******************************************************************************
# 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
# *******************************************************************************

set -e

if [ "$(id -u)" -ne 0 ]; then
echo "Error: This script must be run as root (use sudo)" >&2
exit 1
fi

IP="192.168.100.1/24"
BRIDGE_DEVICE="br0"
TAP_DEVICE="tap0"

ip link add name "$BRIDGE_DEVICE" type bridge
ip link set "$BRIDGE_DEVICE" up
ip addr add "$IP" dev "$BRIDGE_DEVICE"

ip tuntap add dev "$TAP_DEVICE" mode tap
ip link set "$TAP_DEVICE" up
ip link set "$TAP_DEVICE" master "$BRIDGE_DEVICE"

echo "Network setup complete: bridge $BRIDGE_DEVICE ($IP) with $TAP_DEVICE"
2 changes: 2 additions & 0 deletions src/launch_manager_daemon/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ load("//config:common_cc.bzl", "cc_binary_with_common_opts", "cc_library_with_co

package(default_visibility = ["//tests:__subpackages__"])

exports_files(["config/lm_flatcfg.fbs"])

filegroup(
name = "lm_flatcfg_fbs",
srcs = ["config/lm_flatcfg.fbs"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#include <cstring>
#include <string_view>
#include <score/lcm/exec_error_domain.h>

Expand Down
58 changes: 0 additions & 58 deletions tests/integration/control_interface.py

This file was deleted.

12 changes: 0 additions & 12 deletions tests/integration/readme.md

This file was deleted.

31 changes: 0 additions & 31 deletions tests/integration/requirements.lock

This file was deleted.

33 changes: 19 additions & 14 deletions tests/integration/smoke/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
load("@pip_score_venv_test//:requirements.bzl", "all_requirements")
load("@score_tooling//:defs.bzl", "score_py_pytest")
load("//config:flatbuffers_rules.bzl", "flatbuffer_json_to_bin")
load("//tests/utils:bazel/integration.bzl", "integration_test", "package_test_binaries")

flatbuffer_json_to_bin(
name = "test_lm_cfg",
Expand All @@ -36,7 +37,7 @@ cc_binary(
deps = [
"//src/control_client_lib",
"//src/launch_manager_daemon/lifecycle_client_lib:lifecycle_client",
"//tests/integration:test_helper",
"//tests/utils/test_helper",
"@googletest//:gtest_main",
],
)
Expand All @@ -47,27 +48,31 @@ cc_binary(
deps = [
"//src/control_client_lib",
"//src/launch_manager_daemon/lifecycle_client_lib:lifecycle_client",
"//tests/integration:test_helper",
"//tests/utils/test_helper",
"@googletest//:gtest_main",
],
)

score_py_pytest(
package_test_binaries(
name = "test_binaries",
binaries = {
"//src/launch_manager_daemon:launch_manager": "bin/",
":control_daemon_mock": "bin/",
":gtest_process": "bin/",
":test_lm_cfg": "bin/etc/",
":test_hm_cfg": "bin/etc/",
},
test_name = "smoke",
)

integration_test(
name = "smoke",
srcs = [
"smoke.py",
],
args = [
],
data = [
":control_daemon_mock",
":gtest_process",
"//src/launch_manager_daemon:launch_manager",
],
tags = [
"integration",
],
deps = all_requirements + [
"//tests/integration:testing_utils",
"local",
"requires-fakeroot ",
],
test_binaries = "//tests/integration/smoke:test_binaries",
)
2 changes: 1 addition & 1 deletion tests/integration/smoke/control_daemon_mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <score/lcm/lifecycle_client.h>
#include <score/lcm/control_client.h>
#include <score/lcm/identifier_hash.hpp>
#include "tests/integration/test_helper.hpp"
#include "test_helper.hpp"

score::lcm::ControlClient client([](const score::lcm::ExecutionErrorEvent& event) {
std::cerr << "Undefined state callback invoked for process group id: " << event.processGroup.data() << std::endl;
Expand Down
Loading
Loading