Skip to content
Merged
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
19 changes: 19 additions & 0 deletions qnx_qemu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
2 changes: 2 additions & 0 deletions qnx_qemu/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ 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.1")

bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
module_name = "rules_boost",
Expand Down
2 changes: 2 additions & 0 deletions qnx_qemu/build/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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__"
Expand Down
1 change: 1 addition & 0 deletions qnx_qemu/build/system.build
Original file line number Diff line number Diff line change
Expand Up @@ -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}
38 changes: 38 additions & 0 deletions qnx_qemu/test/itf/test_persistency.py
Original file line number Diff line number Diff line change
@@ -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"