Skip to content

Commit 01bc5de

Browse files
authored
Add persistency to qnx qemu img (#26)
1 parent 0d827c7 commit 01bc5de

File tree

5 files changed

+62
-0
lines changed

5 files changed

+62
-0
lines changed

qnx_qemu/BUILD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,22 @@ py_itf_test(
114114
"target_config.json",
115115
],
116116
)
117+
118+
py_itf_test(
119+
name = "test_persistency_qemu",
120+
srcs = [
121+
"test/itf/test_persistency.py",
122+
],
123+
args = [
124+
"--target_config=$(location target_config.json)",
125+
"--ecu=s_core_ecu_qemu",
126+
"--qemu_image=$(location //build:init)",
127+
],
128+
plugins = [
129+
"itf.plugins.base.base_plugin",
130+
],
131+
data = [
132+
"//build:init",
133+
"target_config.json",
134+
],
135+
)

qnx_qemu/MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ bazel_dep(name = "score_communication", version = "0.1.1")
9595

9696
bazel_dep(name = "score_scrample", version = "0.1.0")
9797

98+
bazel_dep(name = "score_persistency", version = "0.2.1")
99+
98100
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
99101
archive_override(
100102
module_name = "rules_boost",

qnx_qemu/build/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ qnx_ifs(
5151
":configs",
5252
"@score_scrample//src:scrample",
5353
"//scrample_integration:etc_configs",
54+
"@score_persistency//tests/cpp_test_scenarios:cpp_test_scenarios",
5455
],
5556
ext_repo_maping = {
5657
"SCRAMPLE_PATH": "$(location @score_scrample//src:scrample)",
58+
"CPP_TEST_SCENARIOS_PATH": "$(location @score_persistency//tests/cpp_test_scenarios:cpp_test_scenarios)",
5759
},
5860
visibility = [
5961
"//:__pkg__"

qnx_qemu/build/system.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,4 @@ pci/pci_debug2.so # Enhanced PCI debugging support
280280
[perms=777] /etc/mw_com_config.json = scrample_integration/etc/mw_com_config.json # DHCP client configuration file
281281

282282
[perms=777] /scrample = ${SCRAMPLE_PATH}
283+
[perms=777] /cpp_tests_persistency = ${CPP_TEST_SCENARIOS_PATH}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
from itf.plugins.com.ping import ping
14+
from itf.plugins.com.ssh import execute_command_output
15+
import logging
16+
17+
logger = logging.getLogger(__name__)
18+
19+
20+
def test_persistency_test_app_is_deployed(target_fixture):
21+
with target_fixture.sut.ssh() as ssh:
22+
exit_code, stdout, stderr = execute_command_output(
23+
ssh, "test -f cpp_tests_persistency"
24+
)
25+
assert exit_code == 0, "SSH command failed"
26+
27+
def test_persistency_test_app_is_running(target_fixture):
28+
with target_fixture.sut.ssh() as ssh:
29+
exit_code, stdout, stderr = execute_command_output(
30+
ssh, "./cpp_tests_persistency --name basic.basic --input '{\"kvs_parameters\":{\"instance_id\":0}}'",
31+
timeout = 30, max_exec_time = 180,
32+
logger_in = logger, verbose = True,
33+
)
34+
35+
logger.info (stdout)
36+
logger.info (stderr)
37+
38+
assert exit_code == 0, "SSH command failed"

0 commit comments

Comments
 (0)