From fb48889cf8d1033931ebffa02518e45b2a86c852 Mon Sep 17 00:00:00 2001 From: Anton Krivoborodov Date: Tue, 11 Nov 2025 11:02:08 +0100 Subject: [PATCH 1/2] add persistency to qnx qemu img --- qnx_qemu/BUILD | 19 ++++++++++++++ qnx_qemu/MODULE.bazel | 6 +++++ qnx_qemu/build/BUILD | 2 ++ qnx_qemu/build/system.build | 1 + qnx_qemu/test/itf/test_persistency.py | 38 +++++++++++++++++++++++++++ 5 files changed, 66 insertions(+) create mode 100644 qnx_qemu/test/itf/test_persistency.py diff --git a/qnx_qemu/BUILD b/qnx_qemu/BUILD index 030893978d..0ee32b983b 100644 --- a/qnx_qemu/BUILD +++ b/qnx_qemu/BUILD @@ -114,3 +114,22 @@ py_itf_test( "target_config.json", ], ) + +py_itf_test( + name = "test_persistency_qemu", + srcs = [ + "test/itf/test_persistency.py", + ], + args = [ + "--target_config=$(location target_config.json)", + "--ecu=s_core_ecu_qemu", + "--qemu_image=$(location //build:init)", + ], + plugins = [ + "itf.plugins.base.base_plugin", + ], + data = [ + "//build:init", + "target_config.json", + ], +) diff --git a/qnx_qemu/MODULE.bazel b/qnx_qemu/MODULE.bazel index 40d1ad9c84..5bfca95127 100644 --- a/qnx_qemu/MODULE.bazel +++ b/qnx_qemu/MODULE.bazel @@ -95,6 +95,12 @@ bazel_dep(name = "score_communication", version = "0.1.1") bazel_dep(name = "score_scrample", version = "0.1.0") +bazel_dep(name = "score_persistency", version = "0.2.0") +# local_path_override( +# module_name = "score_persistency", +# path="../../persistency" +# ) + bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") archive_override( module_name = "rules_boost", diff --git a/qnx_qemu/build/BUILD b/qnx_qemu/build/BUILD index edd5072ffb..077d30e0e9 100644 --- a/qnx_qemu/build/BUILD +++ b/qnx_qemu/build/BUILD @@ -51,9 +51,11 @@ qnx_ifs( ":configs", "@score_scrample//src:scrample", "//scrample_integration:etc_configs", + "@score_persistency//tests/cpp_test_scenarios:cpp_test_scenarios", ], ext_repo_maping = { "SCRAMPLE_PATH": "$(location @score_scrample//src:scrample)", + "CPP_TEST_SCENARIOS_PATH": "$(location @score_persistency//tests/cpp_test_scenarios:cpp_test_scenarios)", }, visibility = [ "//:__pkg__" diff --git a/qnx_qemu/build/system.build b/qnx_qemu/build/system.build index dabbd2bfa8..baab76a47f 100644 --- a/qnx_qemu/build/system.build +++ b/qnx_qemu/build/system.build @@ -280,3 +280,4 @@ pci/pci_debug2.so # Enhanced PCI debugging support [perms=777] /etc/mw_com_config.json = scrample_integration/etc/mw_com_config.json # DHCP client configuration file [perms=777] /scrample = ${SCRAMPLE_PATH} +[perms=777] /cpp_tests_persistency = ${CPP_TEST_SCENARIOS_PATH} diff --git a/qnx_qemu/test/itf/test_persistency.py b/qnx_qemu/test/itf/test_persistency.py new file mode 100644 index 0000000000..96c16fc165 --- /dev/null +++ b/qnx_qemu/test/itf/test_persistency.py @@ -0,0 +1,38 @@ +# ******************************************************************************* +# Copyright (c) 2025 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 itf.plugins.com.ping import ping +from itf.plugins.com.ssh import execute_command_output +import logging + +logger = logging.getLogger(__name__) + + +def test_persistency_test_app_is_deployed(target_fixture): + with target_fixture.sut.ssh() as ssh: + exit_code, stdout, stderr = execute_command_output( + ssh, "test -f cpp_tests_persistency" + ) + assert exit_code == 0, "SSH command failed" + +def test_persistency_test_app_is_running(target_fixture): + with target_fixture.sut.ssh() as ssh: + exit_code, stdout, stderr = execute_command_output( + ssh, "./cpp_tests_persistency --name basic.basic --input '{\"kvs_parameters\":{\"instance_id\":0}}'", + timeout = 30, max_exec_time = 180, + logger_in = logger, verbose = True, + ) + + logger.info (stdout) + logger.info (stderr) + + assert exit_code == 0, "SSH command failed" From 58f6fddafc7c7da8b5877c4db1ac5d4cdd15f9bf Mon Sep 17 00:00:00 2001 From: Alexander Lanin Date: Tue, 11 Nov 2025 18:11:08 +0100 Subject: [PATCH 2/2] update score_persistency dependency version to 0.2.1 --- qnx_qemu/MODULE.bazel | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/qnx_qemu/MODULE.bazel b/qnx_qemu/MODULE.bazel index 5bfca95127..5fa697079b 100644 --- a/qnx_qemu/MODULE.bazel +++ b/qnx_qemu/MODULE.bazel @@ -95,11 +95,7 @@ bazel_dep(name = "score_communication", version = "0.1.1") bazel_dep(name = "score_scrample", version = "0.1.0") -bazel_dep(name = "score_persistency", version = "0.2.0") -# local_path_override( -# module_name = "score_persistency", -# path="../../persistency" -# ) +bazel_dep(name = "score_persistency", version = "0.2.1") bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") archive_override(