Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3f00631
AZB 97324 Source files for tests 183 and 184
LorantLipcsei-ETAS May 22, 2026
50715a3
Fix build
TimoSteuerwaldETAS May 27, 2026
921c20a
Remove not needed cmp & its impl
TimoSteuerwaldETAS May 27, 2026
c85b07e
Rename: Part one, folder only
TimoSteuerwaldETAS May 27, 2026
12278a0
Rename: Part two, files and content
TimoSteuerwaldETAS May 27, 2026
a01c1a5
Update test description
TimoSteuerwaldETAS May 28, 2026
d9f446f
Drop verbose mode as it is nearly not used
TimoSteuerwaldETAS May 29, 2026
d3a0573
Code review rework: Fix Williams comments
TimoSteuerwaldETAS May 29, 2026
f9e8b78
Move test process cpp to test_helper folder
TimoSteuerwaldETAS May 29, 2026
d104503
Update list of requirements
TimoSteuerwaldETAS May 29, 2026
64dd8dc
Verify fallback run target has been activated
TimoSteuerwaldETAS May 29, 2026
a46dae6
Tiny documentation changes
TimoSteuerwaldETAS May 29, 2026
12b60ea
AZB 97324 Addressing PR comments
LorantLipcsei-ETAS Jun 3, 2026
c31d5b9
AZB 97324 Removing unnecessary code from complex_reporting_process.cpp
LorantLipcsei-ETAS Jun 4, 2026
7440100
AZB 97324 Removing feat_req__lifecycle__process_failure_react from th…
LorantLipcsei-ETAS Jun 5, 2026
ea1e2a6
AZB 97324 Fixing launch manager references in the BUILD files
LorantLipcsei-ETAS Jun 9, 2026
baa9bad
AZB 97324 Fixing source and BUILD files to reflect the used folder st…
LorantLipcsei-ETAS Jun 11, 2026
b962fc8
AZB 97324 Fixing Test Helper BUILD file to reflect the used folder st…
LorantLipcsei-ETAS Jun 11, 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
8 changes: 7 additions & 1 deletion tests/integration/crash_on_startup/crash_on_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@


@add_test_properties(
fully_verifies=["feat_req__lifecycle__failure_detect"],
fully_verifies=[
"feat_req__lifecycle__failure_detect",
"feat_req__lifecycle__recov_run_target_switch"
],
partially_verifies=[
"feat_req__lifecycle__recovery_action_support"
],
test_type="requirements-based",
derivation_technique="requirements-analysis",
)
Expand Down
79 changes: 79 additions & 0 deletions tests/integration/process_complex_rep_failure/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# *******************************************************************************
# 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_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//:defs.bzl", "launch_manager_config")
load("//tests/utils/bazel:integration.bzl", "integration_test")

launch_manager_config(
name = "lm_process_complex_rep_failure_config",
config = "//tests/integration/process_complex_rep_failure:process_complex_rep_failure.json",
flatbuffer_out_dir = "etc",
)

cc_binary(
name = "control_client_mock",
srcs = ["control_client_mock.cpp"],
deps = [
"//src/control_client_lib",

@NicolasFussberger NicolasFussberger Jun 9, 2026

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.

Suggested change
"//src/control_client_lib",
"//score/launch_manager:control_cc",

Same for other occurrences. There was a folder restructure recently.

"//src/launch_manager_daemon/lifecycle_client_lib:lifecycle_client",

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.

Suggested change
"//src/launch_manager_daemon/lifecycle_client_lib:lifecycle_client",
"//score/launch_manager:lifecycle_cc"

"//tests/utils/test_helper",
"@googletest//:gtest_main",
],
)

cc_binary(
name = "complex_reporting_process",
srcs = ["//tests/utils/test_helper:complex_reporting_process.cpp"],
visibility = ["//tests:__subpackages__"],
deps = [
"//src/launch_manager_daemon/lifecycle_client_lib:lifecycle_client",
"//src/lifecycle_client_lib",
"//tests/utils/test_helper",
"@googletest//:gtest_main",
],
)

pkg_files(
name = "process_complex_rep_failure_main_files",
srcs = [
":complex_reporting_process",
":control_client_mock",
"//src/launch_manager_daemon:launch_manager",

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.

Suggested change
"//src/launch_manager_daemon:launch_manager",
"//score/launch_manager",

"//tests/utils/test_helper:verification_process",
],
attributes = pkg_attributes(mode = "0755"),
prefix = "tests/process_complex_rep_failure",
)

pkg_files(
name = "process_complex_rep_failure_etc_files",
srcs = [":lm_process_complex_rep_failure_config"],
prefix = "tests/process_complex_rep_failure",
)

pkg_tar(
name = "process_complex_rep_failure_binaries",
srcs = [
":process_complex_rep_failure_etc_files",
":process_complex_rep_failure_main_files",
],
)

integration_test(
name = "process_complex_rep_failure",
srcs = ["process_complex_rep_failure.py"],
tags = ["integration"],
test_binaries = ":process_complex_rep_failure_binaries",
deps = ["//tests/utils/testing_utils"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/********************************************************************************
* 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 "tests/utils/test_helper/test_helper.hpp"
#include <score/lcm/control_client.h>
#include <score/lcm/lifecycle_client.h>

// Given a correct configuration with:
// - An initial Run Target named "Startup" containing component named
// "control_client_mock"
// - A Run Target named "run_target_app_does_report_krunning_in_time"
// containing "control_client_mock" and
// "component_does_report_krunning_in_time"
// - A Run Target named "run_target_app_does_not_report_krunning_in_time"
// containing "control_client_mock" and
// "component_does_not_report_krunning_in_time"

TEST(RecoveryActionComplexRepFailure, ControlClientMock) {
score::lcm::ControlClient client;

ASSERT_TRUE(check_clean({test_end_location, fallback_file}));

// Establish communication with launch manager
TEST_STEP("Report kRunning from ControlClientMock") {
auto result = score::lcm::LifecycleClient{}.ReportExecutionState(
score::lcm::ExecutionState::kRunning);
ASSERT_TRUE(result.has_value())
<< "ReportExecutionState() failed: " << result.error().Message();
}
// Start the run target run_target_app_does_report_krunning_in_time
TEST_STEP("Activate RunTarget run_target_app_does_report_krunning_in_time") {
score::cpp::stop_token stop_token;
auto result =
client.ActivateRunTarget("run_target_app_does_report_krunning_in_time")
.Get(stop_token);
EXPECT_TRUE(result.has_value())
<< "Activating target run_target_app_does_report_krunning_in_time "
"failed: "
<< result.error().Message();
}
// Limitation: we cannot wait for the transition to fallback to complete
sleep(1);
// Then, the LM should continue without triggering the fallback
TEST_STEP("Verify fallback run target has not been activated") {
EXPECT_FALSE(std::filesystem::exists(fallback_file))
<< "Fallback run target should have not been activated";
}
// Start the run target run_target_app_does_not_report_krunning_in_time
TEST_STEP(
"Activate RunTarget run_target_app_does_not_report_krunning_in_time") {
score::cpp::stop_token stop_token;
auto result = client
.ActivateRunTarget(
"run_target_app_does_not_report_krunning_in_time")
.Get(stop_token);
EXPECT_FALSE(result.has_value())
<< "Activating target run_target_app_does_not_report_krunning_in_time "
"did not fail as expected.";
}
// Limitation: we cannot wait for the transition to fallback to complete
sleep(1);
// Then, the LM should exhaust retries and trigger the fallback
TEST_STEP("Verify fallback run target was activated") {
EXPECT_TRUE(std::filesystem::exists(fallback_file))
<< "Fallback run target should have been activated";
}

TEST_STEP("Activate RunTarget Off") { client.ActivateRunTarget("Off"); }
}

int main(int argc, char **argv) {
return TestRunner(__FILE__, TerminationBehavior::kContinue,
TerminationNotification::kTestEnd)
.RunTests();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"schema_version": 1,
"defaults": {
"deployment_config": {
"bin_dir": "/tmp/tests/process_complex_rep_failure",
"ready_timeout": 1.0,
"shutdown_timeout": 1.0,
"ready_recovery_action": {
"restart": {
"number_of_attempts": 0
}
},
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
},
"environmental_variables": {
"LD_LIBRARY_PATH": "/opt/lib"
},
"sandbox": {
"uid": 0,
"gid": 0,
"scheduling_policy": "SCHED_OTHER",
"scheduling_priority": 0
}
},
"component_properties": {
"application_profile": {
"application_type": "Reporting",
"is_self_terminating": true,
"alive_supervision": {
"reporting_cycle": 0.1,
"min_indications": 1,
"max_indications": 3,
"failed_cycles_tolerance": 1
}
},
"ready_condition": {
"process_state": "Running"
}
}
},
"components": {
"control_client_mock": {
"component_properties": {
"binary_name": "control_client_mock",
"application_profile": {
"application_type": "State_Manager",
"alive_supervision": {
"min_indications": 0
}
}
},
"deployment_config": {
"ready_timeout": 1.0,
"shutdown_timeout": 1.0,
"environmental_variables": {
"PROCESSIDENTIFIER": "control_client_mock"
}
}
},
"component_does_report_krunning_in_time": {
"component_properties": {
"binary_name": "complex_reporting_process",
"process_arguments": [
"500.0"
]
},
"deployment_config": {
"ready_timeout": 1.0,
"shutdown_timeout": 1.0,
"environmental_variables": {
"PROCESSIDENTIFIER": "component_does_report_krunning_in_time"
}
}
},
"component_does_not_report_krunning_in_time": {
"component_properties": {
"binary_name": "process_complex_reporting",
"process_arguments": [
"1500.0"
]
},
"deployment_config": {
"ready_timeout": 1.0,
"shutdown_timeout": 1.0,
"environmental_variables": {
"PROCESSIDENTIFIER": "component_does_not_report_krunning_in_time"
}
}
},
"verification_component": {
"component_properties": {
"binary_name": "verification_process",
"application_profile": {
"application_type": "Native",
"is_self_terminating": true
},
"ready_condition": {
"process_state": "Terminated"
}
}
}
},
"run_targets": {
"Startup": {
"depends_on": [
"control_client_mock"
],
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
}
},
"run_target_app_does_report_krunning_in_time": {
"depends_on": [
"control_client_mock",
"component_does_report_krunning_in_time"
],
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
}
},
"run_target_app_does_not_report_krunning_in_time": {
"depends_on": [
"control_client_mock",
"component_does_not_report_krunning_in_time"
],
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
}
},
"Off": {
"depends_on": []
}
},
"initial_run_target": "Startup",
"alive_supervision": {
"evaluation_cycle": 0.05
},
"fallback_run_target": {
"depends_on": [
"control_client_mock",
"verification_component"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# *******************************************************************************
# 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
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties


@add_test_properties(
partially_verifies=[
"feat_req__lifecycle__recov_run_target_switch",
"feat_req__lifecycle__recovery_action_support"
],
fully_verifies=[
"feat_req__lifecycle__failure_detect",
],
test_type="requirements-based",
derivation_technique="requirements-analysis",
)
def test_recovery_action_complex_rep_failure(target, setup_test, assert_test_results, remote_test_dir):
"""
Objective: Verifies that recovery action is executed when the reporting of kRunning via mw::lifecycle library (named "complex reporting" in the following) is not happening in time and vice versa.

Case 1: Using complex reporting, the process does report kRunning in time (500ms below boundary)
Expected Behaviour: Reporting kRunning is successful, recovery action is not executed.

Case 2: Using complex reporting, the process does not report kRunning in time (500ms above boundary)
Expected Behaviour: Reporting kRunning is not successful, recovery action is executed.
The recovery action switches to the fallback run target, the activation of the fallback run target is verified in the test.
"""

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
cwd=str(remote_test_dir),
timeout_s=10.0,
)

assert_test_results({"control_client_mock.xml", "complex_reporting_process.xml"})
Loading
Loading