Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 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
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
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ oci.pull(
use_repo(oci, "debian-test-runtime", "debian-test-runtime_linux_amd64")

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
78 changes: 78 additions & 0 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
76 changes: 76 additions & 0 deletions score/launch_manager/src/lm_control/BUILD
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
# *******************************************************************************
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tests/utils/bazel:runfiles.bzl", "runfiles_at")
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/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",
],
)

# mw::com reads its manifest from the working-directory-relative default path
# ./etc/mw_com_config.json unless told otherwise via CLI args.
# CLI args are currently not supported with score_qnx_unit_tests, so
# making sure the file is available at the default path in the runfiles of the test.
runfiles_at(
name = "default_mw_com_config",
testonly = True,
src = "src/details/test_lm_mw_com_config.json",
path = "etc/mw_com_config.json",
)

lm_cc_test(
name = "ilm_control_UT",
srcs = ["src/details/ilm_control_UT.cpp"],
data = [":default_mw_com_config"],
deps = [
":lm_control",
"@googletest//:gtest_main",
"@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<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
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/********************************************************************************
* 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"
#include "score/mw/lifecycle/ilm_control.hpp"

namespace score::mw::lifecycle
{
namespace
{

// Present in the test manifest (lm_mw_com_config.json).
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
Loading
Loading