Skip to content

Commit 56ba5ec

Browse files
committed
add simple itf test for scrample application
1 parent 78a94b1 commit 56ba5ec

File tree

3 files changed

+79
-10
lines changed

3 files changed

+79
-10
lines changed

qnx_qemu/BUILD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,22 @@ py_itf_test(
9595
"target_config.json",
9696
],
9797
)
98+
99+
py_itf_test(
100+
name = "test_scrample_qemu",
101+
srcs = [
102+
"test/itf/test_scrample.py",
103+
],
104+
args = [
105+
"--target_config=$(location target_config.json)",
106+
"--ecu=s_core_ecu_qemu",
107+
"--qemu_image=$(location //build:init)",
108+
],
109+
plugins = [
110+
"itf.plugins.base.base_plugin",
111+
],
112+
data = [
113+
"//build:init",
114+
"target_config.json",
115+
],
116+
)

qnx_qemu/MODULE.bazel

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,31 @@ use_repo(python)
6363

6464
###############################################################################
6565
#
66-
# LLVM Toolchains
66+
# GCC Toolchains
6767
#
6868
###############################################################################
69-
bazel_dep(name = "toolchains_llvm", version = "1.2.0")
70-
71-
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
72-
llvm.toolchain(
73-
cxx_standard = {"": "c++17"},
74-
llvm_version = "19.1.0",
69+
# Configure the host toolchain.
70+
bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=True)
71+
gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=True)
72+
gcc.toolchain(
73+
url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz",
74+
sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600",
75+
strip_prefix = "x86_64-unknown-linux-gnu",
76+
)
77+
gcc.extra_features(
78+
features = [
79+
"minimal_warnings",
80+
"treat_warnings_as_errors",
81+
],
7582
)
76-
use_repo(llvm, "llvm_toolchain")
77-
use_repo(llvm, "llvm_toolchain_llvm")
83+
gcc.warning_flags(
84+
minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations", "-Wno-error=narrowing"],
85+
strict_warnings = ["-Wextra", "-Wpedantic"],
86+
)
87+
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")
88+
89+
register_toolchains("@gcc_toolchain//:all")
7890

79-
register_toolchains("@llvm_toolchain//:all")
8091

8192
###############################################################################
8293
#

qnx_qemu/test/itf/test_scrample.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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_scrample_app_is_deployed(target_fixture):
21+
user = "qnxuser"
22+
with target_fixture.sut.ssh(username=user) as ssh:
23+
exit_code, stdout, stderr = execute_command_output(
24+
ssh, "test -f scrample"
25+
)
26+
assert exit_code == 0, "SSH command failed"
27+
28+
29+
# def test_scrample_app_is_running(target_fixture):
30+
# user = "qnxuser"
31+
# with target_fixture.sut.ssh(username=user) as ssh:
32+
# exit_code, stdout, stderr = execute_command_output(
33+
# # ssh, "./scrample -n 5 -t 100 -m recv & ./scrample -n 20 -t 100 -m send"
34+
# # ssh, "./scrample -n 20 -t 100 -m send"
35+
# ssh, "./scrample -n 10 -t 100 -m send",
36+
# timeout = 30, max_exec_time = 180,
37+
# logger_in = logger, verbose = True,
38+
# )
39+
# assert exit_code == 0, "SSH command failed"

0 commit comments

Comments
 (0)