Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
611a4c3
Saving current status
SimonKozik Aug 14, 2026
22d6798
Removing unneeded call to GetNewSamples
SimonKozik Aug 14, 2026
964357b
Saving fixed versions for polling and SetReceiveHandler
SimonKozik Aug 14, 2026
bfe62c7
Fix MODULE.bazel dependency
NicolasFussberger Aug 14, 2026
5a94417
Fix test case
NicolasFussberger Aug 14, 2026
6ba5340
Refactor control client test
NicolasFussberger Aug 14, 2026
842e16a
Use StartFindService API
NicolasFussberger Aug 14, 2026
4a8decb
Use mw::log macros
NicolasFussberger Aug 14, 2026
59c9f3e
Extend integration test
NicolasFussberger Aug 14, 2026
9868b59
LmControlImpl rework and UT
NicolasFussberger Aug 16, 2026
ded0df1
Drop component tests
NicolasFussberger Aug 17, 2026
636ba66
Drop integration tests
NicolasFussberger Aug 17, 2026
4cb0906
Remove connected flag
NicolasFussberger Aug 17, 2026
9cdc689
Service discovery
NicolasFussberger Aug 17, 2026
7414686
Do not stop service discovery
NicolasFussberger Aug 17, 2026
d5c0e35
init refactoring
NicolasFussberger Aug 17, 2026
55d6cec
event read refactoring
NicolasFussberger Aug 17, 2026
0539aa1
Refactor callback invocation
NicolasFussberger Aug 17, 2026
52ce0ba
Remove LmControlServer
NicolasFussberger Aug 17, 2026
faa5d86
Cleanup
NicolasFussberger Aug 17, 2026
45bfd31
Fix compiler warning and tsan failure
NicolasFussberger Aug 17, 2026
6a83681
Format fix
NicolasFussberger Aug 17, 2026
fa8d9e9
Fix compiler error
NicolasFussberger Aug 17, 2026
c812173
Fix bazel dependencies
NicolasFussberger Aug 17, 2026
adfbdfd
Fix qnx tests
NicolasFussberger Aug 17, 2026
f335a05
Cleanup
NicolasFussberger Aug 18, 2026
98e9a28
Fix test description
NicolasFussberger Aug 18, 2026
2db5298
Merge remote-tracking branch 'upstream/main' into feature/new_mw_com_…
NicolasFussberger Aug 19, 2026
78352dc
Downgrade to baselibs 0.2.10
NicolasFussberger Aug 19, 2026
630a977
drop workaroud, use latest score_qnx_unit_tests
NicolasFussberger Aug 21, 2026
f1c668f
Extend documentation
NicolasFussberger Aug 21, 2026
8f27602
introduce stream operator
NicolasFussberger Aug 21, 2026
1c5ea94
Change namespace to internal
NicolasFussberger Aug 21, 2026
d0dd184
Remove auto usage
NicolasFussberger Aug 21, 2026
fb998f3
Fixup interface comments
NicolasFussberger Aug 21, 2026
67dce36
Handle callback exceptions
NicolasFussberger Aug 21, 2026
8084005
Fix StartFindService race condition
NicolasFussberger Aug 21, 2026
c54ebd2
Drop force detault param
NicolasFussberger Aug 21, 2026
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
12 changes: 11 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ use_repo(llvm, "llvm_toolchain")

# UTs on QNX
bazel_dep(name = "score_qnx_unit_tests", version = "0.2.0", dev_dependency = True)

# TODO: drop this override once a version > 0.2.0 is published.
# Latest release (0.2.0) does not support CLI args when running tests on QNX
git_override(
module_name = "score_qnx_unit_tests",
commit = "79cc6598268d1f21cbfa75da4993facccf01edbd",
remote = "https://github.com/eclipse-score/qnx_unit_tests.git",
)

bazel_dep(name = "score_rules_imagefs", version = "0.0.4", dev_dependency = True)

imagefs = use_extension("@score_rules_imagefs//extensions:imagefs.bzl", "imagefs", dev_dependency = True)
Expand Down Expand Up @@ -175,7 +184,8 @@ oci.pull(
)
use_repo(oci, "debian-test-runtime", "debian-test-runtime_linux_amd64")

bazel_dep(name = "score_baselibs", version = "0.2.11")
bazel_dep(name = "score_baselibs", version = "0.2.10")
bazel_dep(name = "score_communication", version = "0.3.0")

# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
Expand Down
148 changes: 137 additions & 11 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions score/launch_manager/src/execution_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ enum class ExecErrc : score::result::ErrorCode
kInTransitionToSameState = 11, ///< Transition to the requested Process Group state failed because transition to
///< requested state is already in progress
kNoTimeStamp = 12, ///< DeterministicClient time stamp information is not available
kCycleOverrun = 13 ///< Deterministic activation cycle time exceeded
kCycleOverrun = 13, ///< Deterministic activation cycle time exceeded
kActivationInProgress =
14, ///< A Run Target activation is already in progress; no single Run Target is currently active
kRequestQueueIsFull = 15, ///< The activation request queue is full; the request was discarded
kRunTargetDoesntExist = 16 ///< The requested Run Target name does not exist in the current configuration
};

class ExecErrorDomain final : public score::result::ErrorDomain
Expand Down Expand Up @@ -77,18 +81,24 @@ class ExecErrorDomain final : public score::result::ErrorDomain
return "DeterministicClient time stamp information is not available";
case ExecErrc::kCycleOverrun:
return "Deterministic activation cycle time exceeded";
case ExecErrc::kActivationInProgress:
return "A Run Target activation is already in progress; no single Run Target is currently active";
case ExecErrc::kRequestQueueIsFull:
return "The activation request queue is full; the request was discarded";
case ExecErrc::kRunTargetDoesntExist:
return "The requested Run Target name does not exist in the current configuration";
default:
return "Unknown error";
}
}
};

constexpr ExecErrorDomain g_ExecErrorDomain{};
/// @brief The single ExecErrorDomain instance every ExecErrc-based Error refers to.
inline constexpr ExecErrorDomain g_ExecErrorDomain{};

constexpr score::result::Error MakeError(ExecErrc code, const std::string_view user_message = "") noexcept
{
return score::result::Error{static_cast<score::result::ErrorCode>(code), g_ExecErrorDomain, user_message};
;
}

} // namespace score::mw::lifecycle
Expand Down
70 changes: 70 additions & 0 deletions score/launch_manager/src/lm_control/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# *******************************************************************************
# 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
# *******************************************************************************
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tests/utils/bazel:unit_test.bzl", "lm_cc_test")

cc_library(
name = "lm_control",
srcs = [
"src/details/ilm_control.cpp",
],
hdrs = [
"src/details/lm_control_impl.hpp",
"src/details/lm_control_service.h",
"src/fixed_string.hpp",
"src/ilm_control.hpp",
"src/run_target_activation_source.hpp",
],
include_prefix = "score/mw/lifecycle",
strip_include_prefix = "/score/launch_manager/src/lm_control/src",
visibility = [
"//score:__subpackages__",
"//tests:__subpackages__",
],
deps = [
"//score/launch_manager:error",
"//score/launch_manager/src/daemon/src/common:log",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/language/safecpp/scoped_function:copyable_scoped_function",
"@score_baselibs//score/language/safecpp/scoped_function:scope",
"@score_baselibs//score/result",
"@score_communication//score/mw/com",
],
)

lm_cc_test(
name = "lm_control_impl_UT",
srcs = ["src/details/lm_control_impl_UT.cpp"],
deps = [
":lm_control",
"//score/launch_manager:error",
"@googletest//:gtest_main",
"@score_baselibs//score/result",
"@score_communication//score/mw/com",
],
)

lm_cc_test(
name = "ilm_control_UT",
srcs = ["src/details/ilm_control_UT.cpp"],
args = [
"--service_instance_manifest",
"$(rootpath src/details/test_lm_mw_com_config.json)",
],
data = ["src/details/test_lm_mw_com_config.json"],
deps = [
":lm_control",
"@googletest//:gtest",
"@score_communication//score/mw/com",
],
)
31 changes: 31 additions & 0 deletions score/launch_manager/src/lm_control/src/details/ilm_control.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/********************************************************************************
* 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
********************************************************************************/

#include "score/mw/lifecycle/ilm_control.hpp"
#include "score/mw/lifecycle/details/lm_control_impl.hpp"

namespace score::mw::lifecycle
{

score::Result<std::unique_ptr<ILmControl>> ILmControl::Create(std::string_view instance_specifier)
{
auto instance = std::make_unique<internal::LmControlImpl>();
const auto init_result = instance->init(instance_specifier);
if (!init_result.has_value())
{
return score::MakeUnexpected<std::unique_ptr<ILmControl>>(init_result.error());
}
return instance;
}

} // namespace score::mw::lifecycle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be good to make some sort of component test that includes actual com implementation? I think this could be good when trying to debug interactions between us and COM.

@NicolasFussberger NicolasFussberger Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree, I started something here ded0df1

but then reverted because I thought the PR scope was getting too big when introducing this at the same time.
I would propose to introduce this in a separate PR

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/********************************************************************************
* 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
********************************************************************************/

#include <gtest/gtest.h>

#include <string>
#include <string_view>

#include "score/mw/com/runtime.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused include

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is removed

#include "score/mw/lifecycle/ilm_control.hpp"

namespace score::mw::lifecycle
{
namespace
{

constexpr std::string_view kValidSpecifier = "StateManager/LaunchManager/Instance";

class ILmControlUT : public ::testing::Test
{
protected:
void SetUp() override
{
RecordProperty("TestType", "interface-test");
RecordProperty("DerivationTechnique", "equivalence-classes");

// The following two equivalence classes are tested here:
// * Return a valid instance
// * Return an error
// The different error cases are tested in the underlying impl class LmControlImpl unit tests
}
};

TEST_F(ILmControlUT, ReturnsValidInstance)
{
RecordProperty("Description", "ILmControl::Create returns a valid instance for a valid instance specifier.");

auto result = ILmControl::Create(std::string{kValidSpecifier});

ASSERT_TRUE(result.has_value());
EXPECT_NE(result.value(), nullptr);
}

TEST_F(ILmControlUT, ReturnsInitErrorForInvalidSpecifier)
{
RecordProperty(
"Description", "ILmControl::Create returns kInvalidArguments error for an invalid instance specifier.");

auto result = ILmControl::Create("");

ASSERT_FALSE(result.has_value());
EXPECT_EQ(result.error(), ExecErrc::kInvalidArguments);
}

} // namespace
} // namespace score::mw::lifecycle

int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
score::mw::com::runtime::InitializeRuntime(argc, const_cast<const char**>(argv));
return RUN_ALL_TESTS();
}
Loading
Loading