Skip to content
Draft
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
1 change: 1 addition & 0 deletions feature_integration_tests/configs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exports_files(
"dlt_config_qnx_x86_64.json",
"dlt_config_x86_64.json",
"qemu_bridge_config.json",
"lifecycle_daemon_config.json",
],
)

Expand Down
103 changes: 103 additions & 0 deletions feature_integration_tests/configs/lifecycle_daemon_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"schema_version": 1,
"defaults": {
"deployment_config": {
"bin_dir": "__FIT_RUNTIME_ROOT__/bin",
"ready_timeout": 2.0,
"shutdown_timeout": 2.0,
"ready_recovery_action": {
"restart": {
"number_of_attempts": 2
}
},
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
},
"sandbox": {
"uid": 1001,
"gid": 1001,
"scheduling_policy": "SCHED_OTHER",
"scheduling_priority": 0
}
},
"component_properties": {
"application_profile": {
"application_type": "Reporting",
"is_self_terminating": false,
"alive_supervision": {
"reporting_cycle": 0.1,
"min_indications": 1,
"max_indications": 3,
"failed_cycles_tolerance": 1
}
},
"ready_condition": {
"process_state": "Running"
}
}
},
"components": {
"cpp_supervised_app": {
"component_properties": {
"binary_name": "cpp_supervised_app",
"application_profile": {
"application_type": "Reporting_And_Supervised"
},
"process_arguments": [
"-d50"
]
},
"deployment_config": {
"environmental_variables": {
"PROCESSIDENTIFIER": "cpp_supervised_app",
"IDENTIFIER": "cpp_supervised_app"
}
}
},
"rust_supervised_app": {
"component_properties": {
"binary_name": "rust_supervised_app",
"depends_on": [
"cpp_supervised_app"
],
"application_profile": {
"application_type": "Reporting_And_Supervised"
},
"process_arguments": [
"-d50"
]
},
"deployment_config": {
"environmental_variables": {
"PROCESSIDENTIFIER": "rust_supervised_app",
"IDENTIFIER": "rust_supervised_app"
}
}
}
},
"run_targets": {
"Startup": {
"depends_on": [
"cpp_supervised_app",
"rust_supervised_app"
],
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
}
}
},
"initial_run_target": "Startup",
"alive_supervision": {
"evaluation_cycle": 0.05
},
"fallback_run_target": {
"depends_on": [
"cpp_supervised_app",
"rust_supervised_app"
]
}
}
131 changes: 128 additions & 3 deletions feature_integration_tests/test_cases/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ compile_pip_requirements(
)

# Tests targets

score_py_pytest(
name = "fit_rust",
srcs = glob(["tests/**/*.py"]),
name = "fit_rust_persistency",
timeout = "long",
srcs = glob(["tests/persistency/**/*.py"]),
args = [
"-m rust",
"--traces=all",
Expand All @@ -57,21 +59,142 @@ score_py_pytest(
deps = all_requirements,
)

test_suite(
name = "fit_rust",
tests = [
":fit_rust_persistency",
],
)

score_py_pytest(
name = "fit_cpp_persistency",
timeout = "long",
srcs = glob(["tests/persistency/**/*.py"]),
args = [
"-m cpp",
"--traces=all",
"--cpp-target-path=$(rootpath //feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios)",
],
data = [
"conftest.py",
"fit_scenario.py",
"persistency_scenario.py",
"test_properties.py",
"//feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios",
],
pytest_config = "//:pyproject.toml",
deps = all_requirements,
)

test_suite(
name = "fit_cpp",
srcs = glob(["tests/**/*.py"]),
tests = [
":fit_cpp_persistency",
],
)

# Cross-module lifecycle<->persistency recovery test and the control-interface
# (activate_target) architectural test. Both parametrize on rust/cpp and need the
# scenario binaries (for the persistency probe) in addition to the daemon deps
# fit_lifecycle_daemon already needs, so they run once per language rather than
# being folded into fit_lifecycle_daemon (which is language-agnostic).
score_py_pytest(
name = "fit_rust_lifecycle_persistency",
timeout = "long",
srcs = [
"tests/lifecycle/test_lifecycle_persistency_recovery.py",
"tests/lifecycle/test_lifecycle_state_manager.py",
],
args = [
"-m rust",
"--traces=all",
"--rust-target-path=$(rootpath //feature_integration_tests/test_scenarios/rust:rust_test_scenarios)",
],
data = [
"conftest.py",
"daemon_helpers.py",
"fit_scenario.py",
"persistency_scenario.py",
"test_properties.py",
"//feature_integration_tests/configs:lifecycle_daemon_config.json",
"//feature_integration_tests/test_scenarios/rust:rust_test_scenarios",
"@flatbuffers//:flatc",
"@score_lifecycle_health//examples/control_application:control_daemon",
"@score_lifecycle_health//examples/control_application:lmcontrol",
"@score_lifecycle_health//examples/cpp_supervised_app",
"@score_lifecycle_health//examples/rust_supervised_app",
"@score_lifecycle_health//score/launch_manager",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hm_flatcfg.fbs",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hmcore_flatcfg.fbs",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:launch_manager.schema.json",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:lm_flatcfg.fbs",
"@score_lifecycle_health//scripts/config_mapping:lifecycle_config",
],
env = {
"FIT_CPP_SUPERVISED_APP_PATH": "$(rootpath @score_lifecycle_health//examples/cpp_supervised_app)",
"FIT_LAUNCH_MANAGER_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager)",
"FIT_FLATC_PATH": "$(rootpath @flatbuffers//:flatc)",
"FIT_LIFECYCLE_CONFIG_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:launch_manager.schema.json)",
"FIT_LIFECYCLE_CONFIG_TOOL_PATH": "$(rootpath @score_lifecycle_health//scripts/config_mapping:lifecycle_config)",
"FIT_LIFECYCLE_DAEMON_CONFIG_PATH": "$(rootpath //feature_integration_tests/configs:lifecycle_daemon_config.json)",
"FIT_LIFECYCLE_HMCORE_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hmcore_flatcfg.fbs)",
"FIT_LIFECYCLE_HM_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hm_flatcfg.fbs)",
"FIT_LIFECYCLE_LM_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:lm_flatcfg.fbs)",
"FIT_LMCONTROL_PATH": "$(rootpath @score_lifecycle_health//examples/control_application:lmcontrol)",
"FIT_RUST_SUPERVISED_APP_PATH": "$(rootpath @score_lifecycle_health//examples/rust_supervised_app)",
"RUST_BACKTRACE": "1",
},
env_inherit = ["FIT_ENABLE_SETCAP"],
pytest_config = "//:pyproject.toml",
deps = all_requirements,
)

score_py_pytest(
name = "fit_cpp_lifecycle_persistency",
timeout = "long",
srcs = [
"tests/lifecycle/test_lifecycle_persistency_recovery.py",
"tests/lifecycle/test_lifecycle_state_manager.py",
],
args = [
"-m cpp",
"--traces=all",
"--cpp-target-path=$(rootpath //feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios)",
],
data = [
"conftest.py",
"daemon_helpers.py",
"fit_scenario.py",
"persistency_scenario.py",
"test_properties.py",
"//feature_integration_tests/configs:lifecycle_daemon_config.json",
"//feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios",
"@flatbuffers//:flatc",
"@score_lifecycle_health//examples/control_application:control_daemon",
"@score_lifecycle_health//examples/control_application:lmcontrol",
"@score_lifecycle_health//examples/cpp_supervised_app",
"@score_lifecycle_health//examples/rust_supervised_app",
"@score_lifecycle_health//score/launch_manager",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hm_flatcfg.fbs",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hmcore_flatcfg.fbs",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:launch_manager.schema.json",
"@score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:lm_flatcfg.fbs",
"@score_lifecycle_health//scripts/config_mapping:lifecycle_config",
],
env = {
"FIT_CPP_SUPERVISED_APP_PATH": "$(rootpath @score_lifecycle_health//examples/cpp_supervised_app)",
"FIT_LAUNCH_MANAGER_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager)",
"FIT_FLATC_PATH": "$(rootpath @flatbuffers//:flatc)",
"FIT_LIFECYCLE_CONFIG_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:launch_manager.schema.json)",
"FIT_LIFECYCLE_CONFIG_TOOL_PATH": "$(rootpath @score_lifecycle_health//scripts/config_mapping:lifecycle_config)",
"FIT_LIFECYCLE_DAEMON_CONFIG_PATH": "$(rootpath //feature_integration_tests/configs:lifecycle_daemon_config.json)",
"FIT_LIFECYCLE_HMCORE_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hmcore_flatcfg.fbs)",
"FIT_LIFECYCLE_HM_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/alive_monitor/config:hm_flatcfg.fbs)",
"FIT_LIFECYCLE_LM_SCHEMA_PATH": "$(rootpath @score_lifecycle_health//score/launch_manager/src/daemon/src/configuration/config_schema:lm_flatcfg.fbs)",
"FIT_LMCONTROL_PATH": "$(rootpath @score_lifecycle_health//examples/control_application:lmcontrol)",
"FIT_RUST_SUPERVISED_APP_PATH": "$(rootpath @score_lifecycle_health//examples/rust_supervised_app)",
},
env_inherit = ["FIT_ENABLE_SETCAP"],
pytest_config = "//:pyproject.toml",
deps = all_requirements,
)
Expand All @@ -80,6 +203,8 @@ test_suite(
name = "fit",
tests = [
":fit_cpp",
":fit_cpp_lifecycle_persistency",
":fit_rust",
":fit_rust_lifecycle_persistency",
],
)
Loading
Loading