Skip to content

Commit d591de1

Browse files
committed
Added ITF SSH tests
1 parent e45a42b commit d591de1

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

qnx_qemu/BUILD

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
1313
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
14+
load("@score_itf//:defs.bzl", "py_itf_test")
1415

1516

1617
sh_binary(
@@ -75,3 +76,22 @@ sh_binary(
7576
"@toolchains_qnx_sdp//:host_dir",
7677
],
7778
)
79+
80+
py_itf_test(
81+
name = "test_ssh_qemu",
82+
srcs = [
83+
"test/itf/test_ssh.py",
84+
],
85+
args = [
86+
"--target_config=$(location target_config.json)",
87+
"--ecu=s_core_ecu_qemu",
88+
"--qemu_image=$(location //build:init)",
89+
],
90+
plugins = [
91+
"itf.plugins.base.base_plugin",
92+
],
93+
data = [
94+
"//build:init",
95+
"target_config.json",
96+
],
97+
)

qnx_qemu/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ bazel run --config=x86_64-qnx //:test_qemu_bridge
128128

129129
# Run integration tests for port forwarding
130130
bazel run --config=x86_64-qnx //:test_qemu_portforward
131+
132+
# Run ITF tests for ssh
133+
bazel test --config=qemu-integration //:test_ssh_qemu --test_output=streamed
131134
```
132135

133136
In order to provide credentials for qnx.com pass to bazel command:

qnx_qemu/target_config.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"S_CORE_ECU_QEMU": {
3+
"performance_processor": {
4+
"name": "S_CORE_ECU_QEMU_PP",
5+
"ip_address": "169.254.158.190",
6+
"ext_ip_address": "169.254.158.190",
7+
"ssh_port": 22,
8+
"diagnostic_ip_address": "169.254.158.190",
9+
"diagnostic_address": "0x91",
10+
"serial_device": "",
11+
"network_interfaces": [],
12+
"ecu_name": "s_core_ecu_qemu_pp",
13+
"data_router_config": {
14+
"vlan_address": "127.0.0.1",
15+
"multicast_addresses": []
16+
},
17+
"qemu_num_cores": 2,
18+
"qemu_ram_size": "1G"
19+
},
20+
"safety_processor": {
21+
"name": "S_CORE_ECU_QEMU_SC",
22+
"ip_address": "169.254.158.190",
23+
"diagnostic_ip_address": "169.254.158.190",
24+
"diagnostic_address": "0x90",
25+
"serial_device": "",
26+
"use_doip": true
27+
},
28+
"other_processors": {}
29+
}
30+
}

qnx_qemu/test/itf/test_ssh.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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.ssh import execute_command
14+
15+
16+
def test_ssh_with_default_user(target_fixture):
17+
with target_fixture.sut.ssh() as ssh:
18+
execute_command(ssh, "echo 'Username:' $USER && uname -a")
19+
20+
21+
def test_ssh_with_qnx_user(target_fixture):
22+
with target_fixture.sut.ssh(username="qnxuser") as ssh:
23+
execute_command(ssh, "echo 'Username:' $USER && uname -a")

0 commit comments

Comments
 (0)