Skip to content

Commit 36d401e

Browse files
authored
Bump ITF and adapt test cases (#158)
- update test targets to use correct plugin specification - replace legacy target config with bridge config and update test args to --qemu-config / --qemu-image - switch ITF Bazel config from build: to test:itf-qnx-x86_64 and enable --test_output=errors - add showcase ITF test, remove obsolete persistency test, and align SSH tests to target.ssh()
1 parent 35037a3 commit 36d401e

14 files changed

Lines changed: 63 additions & 154 deletions

File tree

.bazelrc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ build:qnx-x86_64 --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp
3333
build:qnx-x86_64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64
3434
build:qnx-x86_64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800
3535

36-
build:itf-qnx-x86_64 --config=qnx-x86_64
37-
build:itf-qnx-x86_64 --run_under=@score_itf//scripts:run_under_qemu
38-
build:itf-qnx-x86_64 --test_arg="--qemu"
39-
build:itf-qnx-x86_64 --test_arg="--os=qnx"
40-
41-
4236
build:linux-x86_64 --config=_common
4337
build:linux-x86_64 --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix
4438
build:linux-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
@@ -69,6 +63,10 @@ test:ferrocene-coverage --run_under=@score_tooling//coverage:llvm_profile_wrappe
6963
# Coverage needs to have all intermediate .rlibs to be able to proceed
7064
build:ferrocene-coverage --remote_download_all
7165

66+
test:itf-qnx-x86_64 --config=qnx-x86_64
67+
test:itf-qnx-x86_64 --run_under=@score_itf//scripts:run_under_qemu
68+
test:itf-qnx-x86_64 --test_output=errors
69+
7270
test:unit-tests --config=linux-x86_64
7371
test:unit-tests --build_tests_only
7472
test:unit-tests --test_tag_filters=-manual

bazel_common/score_modules_tooling.MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bazel_dep(name = "score_itf")
2525
git_override(
2626
module_name = "score_itf",
2727
remote = "https://github.com/eclipse-score/itf.git",
28-
commit = "7c87a904ec54628f57a63af8b0c364db83b735cf",
28+
commit = "1f4655af3daa85c03f91f584a3a9a1ea3ab54e62",
2929
)
3030

3131
bazel_dep(name = "score_tooling")

feature_integration_tests/configs/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# *******************************************************************************
1313
exports_files(
1414
[
15-
"qemu_target_config.json",
15+
"qemu_bridge_config.json",
1616
],
1717
)
1818

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"networks": [
3+
{
4+
"name": "tap0",
5+
"ip_address": "169.254.158.190",
6+
"gateway": "169.254.21.88"
7+
}
8+
],
9+
"ssh_port": 22,
10+
"qemu_num_cores": 2,
11+
"qemu_ram_size": "1G"
12+
}

feature_integration_tests/configs/qemu_target_config.json

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
exports_files(
2-
[
1+
filegroup(
2+
name = "all_tests",
3+
srcs = [
4+
"test_showcases.py",
35
"test_ssh.py",
4-
"test_scrample.py",
5-
"test_persistency.py",
66
],
7-
)
7+
visibility = [
8+
"//images/qnx_x86_64:__pkg__",
9+
],
10+
)

feature_integration_tests/itf/test_persistency.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

feature_integration_tests/itf/test_scrample.py renamed to feature_integration_tests/itf/test_showcases.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,22 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13-
import logging
1413

15-
from itf.plugins.com.ssh import execute_command_output
14+
import logging
1615

1716
logger = logging.getLogger(__name__)
1817

1918

20-
def test_scrample_app_is_deployed(target_fixture):
21-
with target_fixture.sut.ssh() as ssh:
22-
exit_code, stdout, stderr = execute_command_output(ssh, "test -f scrample")
19+
def test_showcase_app_is_deployed(target):
20+
with target.ssh() as ssh:
21+
exit_code, stdout, stderr = ssh.execute_command_output("test -f /showcases/bin/ipc_bridge_cpp")
2322
assert exit_code == 0, "SSH command failed"
2423

2524

26-
def test_scrample_app_is_running(target_fixture):
27-
with target_fixture.sut.ssh() as ssh:
28-
exit_code, stdout, stderr = execute_command_output(
29-
ssh,
30-
"./scrample -n 10 -t 100 -m send & ./scrample -n 5 -t 100 -m recv",
25+
def test_showcase_app_is_running(target):
26+
with target.ssh() as ssh:
27+
exit_code, stdout, stderr = ssh.execute_command_output(
28+
"cd /showcases/data/comm; /showcases/bin/ipc_bridge_cpp -n 10 -t 100 -m send & /showcases/bin/ipc_bridge_cpp -n 5 -t 100 -m recv",
3129
timeout=30,
3230
max_exec_time=180,
3331
logger_in=logger,

feature_integration_tests/itf/test_ssh.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13-
from itf.plugins.com.ping import ping
14-
from itf.plugins.com.ssh import execute_command_output
13+
# from itf.plugins.com.ping import ping
1514

1615

17-
def test_ssh_with_default_user(target_fixture):
18-
with target_fixture.sut.ssh() as ssh:
19-
exit_code, stdout, stderr = execute_command_output(
20-
ssh, "echo 'Username:' $USER && uname -a"
16+
def test_ssh_with_default_user(target):
17+
with target.ssh() as ssh:
18+
exit_code, stdout, stderr = ssh.execute_command_output(
19+
"echo 'Username:' $USER && uname -a"
2120
)
2221
assert exit_code == 0, "SSH command failed"
2322
assert "Username: root" in stdout[0], "Expected username not found in output"
@@ -27,11 +26,11 @@ def test_ssh_with_default_user(target_fixture):
2726
assert stderr == [], "Expected no error output"
2827

2928

30-
def test_ssh_with_qnx_user(target_fixture):
29+
def test_ssh_with_qnx_user(target):
3130
user = "qnxuser"
32-
with target_fixture.sut.ssh(username=user) as ssh:
33-
exit_code, stdout, stderr = execute_command_output(
34-
ssh, "echo 'Username:' $USER && uname -a"
31+
with target.ssh(username=user) as ssh:
32+
exit_code, stdout, stderr = ssh.execute_command_output(
33+
"echo 'Username:' $USER && uname -a"
3534
)
3635
assert exit_code == 0, "SSH command failed"
3736
assert f"Username: {user}" in stdout[0], "Expected username not found in output"
@@ -41,6 +40,6 @@ def test_ssh_with_qnx_user(target_fixture):
4140
assert stderr == [], "Expected no error output"
4241

4342

44-
def test_ping_ok(target_fixture):
45-
is_reachable = ping(target_fixture.sut.ip_address)
46-
assert is_reachable, "QNX Target is not reachable via ping"
43+
# def test_ping_ok(target_fixture):
44+
# is_reachable = ping(target_fixture.sut.ip_address)
45+
# assert is_reachable, "QNX Target is not reachable via ping"

images/qnx_x86_64/BUILD

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# *******************************************************************************
1313
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
1414
load("@score_itf//:defs.bzl", "py_itf_test")
15+
load("@score_itf//score/itf/plugins:plugins.bzl", "dlt", "qemu")
1516

1617
alias(
1718
name = "image",
@@ -36,58 +37,23 @@ sh_binary(
3637
# For now we keep this not in /feature_integration_tests but locally within images
3738

3839
py_itf_test(
39-
name = "test_ssh",
40+
name = "test_qnx_8_x86_64",
4041
srcs = [
41-
"//feature_integration_tests/itf:test_ssh.py",
42+
"//feature_integration_tests/itf:all_tests",
4243
],
4344
args = [
44-
"--target_config=$(location //feature_integration_tests/configs:qemu_target_config.json)",
45-
"--ecu=s_core_ecu_qemu",
46-
"--qemu_image=$(location :image)",
47-
],
48-
plugins = [
49-
"itf.plugins.base.base_plugin",
45+
"--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)",
46+
"--qemu-image=$(location :image)",
5047
],
5148
data = [
5249
":image",
53-
"//feature_integration_tests/configs:qemu_target_config.json",
54-
],
55-
)
56-
57-
py_itf_test(
58-
name = "test_scrample",
59-
srcs = [
60-
"//feature_integration_tests/itf:test_scrample.py",
61-
],
62-
args = [
63-
"--target_config=$(location //feature_integration_tests/configs:qemu_target_config.json)",
64-
"--ecu=s_core_ecu_qemu",
65-
"--qemu_image=$(location :image)",
50+
"//feature_integration_tests/configs:qemu_bridge_config.json",
6651
],
6752
plugins = [
68-
"itf.plugins.base.base_plugin",
69-
],
70-
data = [
71-
":image",
72-
"//feature_integration_tests/configs:qemu_target_config.json",
53+
qemu,
7354
],
74-
)
75-
76-
py_itf_test(
77-
name = "test_persistency",
78-
srcs = [
79-
"//feature_integration_tests/itf:test_persistency.py",
80-
],
81-
args = [
82-
"--target_config=$(location //feature_integration_tests/configs:qemu_target_config.json)",
83-
"--ecu=s_core_ecu_qemu",
84-
"--qemu_image=$(location :image)",
85-
],
86-
plugins = [
87-
"itf.plugins.base.base_plugin",
88-
],
89-
data = [
90-
":image",
91-
"//feature_integration_tests/configs:qemu_target_config.json",
55+
tags = [
56+
"local",
57+
"manual",
9258
],
9359
)

0 commit comments

Comments
 (0)