-
Notifications
You must be signed in to change notification settings - Fork 13
QNX8 QEMU x86_64 Integration tests #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 34 commits
40329f1
fdcc905
f8de33b
0df5e9b
5affffc
b35d951
128cfb8
4e75fd4
bb70f92
ebbdd65
db971ff
2915a07
05f317e
ce061e2
c12b49f
4ef6e72
a920ffe
92e4730
f815597
8fc1bfe
897f38b
73dc8e0
08ff0e4
8f4447f
a8b5bb1
0ffb175
6613fad
2cc5f03
e377469
4589bac
4a6f50e
8bc16d4
905fca8
2b8f18f
75f77df
83e3d3b
8dd5f55
d5ec295
4b31637
de9dedc
05ab324
d7a70fb
fa911e5
8381329
fc18cc1
44d60ec
61a08de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,9 @@ | |||||
| "dockerfile": "Dockerfile" | ||||||
| }, | ||||||
| "runArgs": [ | ||||||
| "--privileged" | ||||||
| "--privileged", | ||||||
| "--add-host=host.docker.internal:host-gateway", | ||||||
| "--device=/dev/kvm" | ||||||
| ], | ||||||
| "mounts": [ | ||||||
| { | ||||||
|
|
@@ -31,5 +33,7 @@ | |||||
| "streetsidesoftware.code-spell-checker" | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "postCreateCommand": "sudo apt-get update && sudo apt-get install -y software-properties-common && sudo add-apt-repository -y universe && sudo apt-get update && sudo apt-get install -y qemu-system-x86 iputils-ping tcpdump iptables", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add that to the Dockerfile instead? Then it would be one step. Also we are installing way too much stuff (icon themes etc.). I guess you should add
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||||||
| "postStartCommand": "sudo chmod 666 /dev/kvm" | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,3 @@ | ||||||
|
|
||||||
| # SOME/IP Gateway | ||||||
|
|
||||||
| The gateway is divided into a gateway daemon (gatewayd) which contains the network-independent logic (payload serialization, etc.) and the SOME/IP daemon (someipd) which binds to the concrete SOME/IP stack. | ||||||
|
|
@@ -41,42 +40,37 @@ bazel run //examples/car_window_sim:car_window_controller | |||||
| If you type `open` or `close` the command will be sent via network. | ||||||
|
|
||||||
|
|
||||||
| ### Dockerized integration test POC | ||||||
| ### QEMU x86_64 - based integration test and unit tests | ||||||
|
|
||||||
| For integration tests where the communication between two QEMU instances is required, a custom implementation is used to start and manage the QEMU instances within the test logic. This is because ITF does not support starting multiple QEMU instances in parallel yet. | ||||||
|
|
||||||
| For integration tests, a docker based approach was taken. | ||||||
| As a proof of concept `docker compose` can be used to build, setup and run the containers. | ||||||
| In the future a pytest based setup can be implemented to orchestrate the containers. | ||||||
| For the QEMU QNX x864 image to run on host please run the script deployment/qemu/setup_bridge.sh with sudo privileges to setup the required network bridge and tap interfaces. | ||||||
| It is stronly recommended to run all tests with `--nocache_test_results` which is the best way on development cycles to ensure you are always running the latest version of the tests and not accidentally running cached results. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||||||
|
|
||||||
| Build the docker containers: | ||||||
| Tu run all tests (will take around 2 minutes) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||||||
|
|
||||||
| ```sh | ||||||
| docker compose --project-directory tests/integration/docker_setup/ build | ||||||
| bazel test //tests/... --test_output=all --nocache_test_results --config=x86_64-qnx | ||||||
| ``` | ||||||
|
|
||||||
| Start up the containers: | ||||||
| For Integration SOMEIP Service Discovery tests: | ||||||
|
|
||||||
| ```sh | ||||||
| docker compose --project-directory tests/integration/docker_setup/ up | ||||||
| bazel test //tests/integration/... --test_output=all --config=x86_64-qnx | ||||||
| ``` | ||||||
|
|
||||||
| Those containers are pre-configured (IP adresses, multicast route, ...). | ||||||
| The someipd-1 container already starts up the `gatewayd` and the `someipd`. | ||||||
|
|
||||||
| In Wireshark the network traffic can be seen by capturing on `any` with `ip.addr== 192.168.87.2 || ip.addr ==192.168.87.3`. | ||||||
|
|
||||||
| On the client side, start up the `sample_client` in another shell: | ||||||
| Run a specific integration test `test_negative_only_qemu1_with_services` for SOMEIP Service Discovery test suite: | ||||||
|
|
||||||
| ```sh | ||||||
| docker exec -it --env VSOMEIP_CONFIGURATION=/home/source/tests/integration/sample_client/vsomeip.json docker_setup-client-1 /home/source/bazel-bin/tests/integration/sample_client/sample_client | ||||||
| bazel test //tests/integration:test_someip_sd --test_output=all --config=x86_64-qnx --test_arg='-k' --test_arg='test_negative_only_qemu1_with_services' | ||||||
| ``` | ||||||
|
|
||||||
| Finally start the benchmark on the someipd-1 container in a third shell: | ||||||
| To run the QNX tests using dev containers please execute the shell command: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only needed in devcontainer or also when running locally?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First question : is needed independent if its host or docker containers . |
||||||
|
|
||||||
| ```sh | ||||||
| docker exec -it docker_setup-someipd-1 /home/source/bazel-bin/tests/performance_benchmarks/ipc_benchmarks | ||||||
| sudo deployment/qemu/setup_bridge.sh | ||||||
| ``` | ||||||
|
|
||||||
|
|
||||||
| ## 📝 Configuration | ||||||
|
|
||||||
| ### Gatewayd Config Schema Validation | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 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 | ||
| # ******************************************************************************* | ||
|
|
||
| # ============================================================================= | ||
| # QNX QEMU Image for SOME/IP Gateway | ||
| # | ||
| # Builds a bootable QNX IFS (Image File System) containing the someipd and | ||
| # gatewayd daemons, then provides a target to run it under QEMU. | ||
| # | ||
| # Usage: | ||
| # # Build the IFS image | ||
| # bazel build //deployment/qemu:someip_gateway_ifs --config=x86_64-qnx | ||
| # ============================================================================= | ||
|
|
||
| load("@rules_pkg//pkg:tar.bzl", "pkg_tar") | ||
| load("@score_toolchains_qnx//rules/fs:ifs.bzl", "qnx_ifs") | ||
|
|
||
| # Export scripts for use as data dependencies in tests | ||
| exports_files( | ||
| [ | ||
| "run_qemu.sh", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check visibility
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| ) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Package all gateway binaries + configs into a single tar for IFS inclusion | ||
| # --------------------------------------------------------------------------- | ||
| pkg_tar( | ||
| name = "gateway_binaries_pkg", | ||
| srcs = [ | ||
| "//src/gatewayd", | ||
| "//src/someipd", | ||
| "//tests/integration/sample_client", | ||
| ], | ||
| include_runfiles = True, | ||
| package_dir = "/", | ||
| ) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Package shared libraries (.so) for /usr/lib in the IFS | ||
| # --------------------------------------------------------------------------- | ||
| pkg_tar( | ||
| name = "gateway_libs_pkg", | ||
| srcs = [ | ||
| "@vsomeip", | ||
| ], | ||
| include_runfiles = True, | ||
| package_dir = "/", | ||
| ) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Package gateway config files for the IFS | ||
| # --------------------------------------------------------------------------- | ||
| pkg_tar( | ||
| name = "gateway_configs_pkg", | ||
| srcs = [ | ||
| "//src/gatewayd:config_file", | ||
| "//src/gatewayd:etc/mw_com_config.json", | ||
| ], | ||
| strip_prefix = "/src/gatewayd/etc", | ||
| ) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Package someipd config files for the IFS | ||
| # --------------------------------------------------------------------------- | ||
| pkg_tar( | ||
| name = "someipd_configs_pkg", | ||
| srcs = [ | ||
| "//src/someipd:etc/mw_com_config.json", | ||
| "//tests/integration:vsomeip.json", | ||
| ], | ||
| remap_paths = { | ||
| "/src/someipd/etc/mw_com_config.json": "mw_com_config.json", | ||
| "/tests/integration/vsomeip.json": "vsomeip.json", | ||
| }, | ||
| ) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Package sample_client config files for the IFS | ||
| # --------------------------------------------------------------------------- | ||
| pkg_tar( | ||
| name = "sample_client_configs_pkg", | ||
| srcs = [ | ||
| "//tests/integration/sample_client:vsomeip.json", | ||
| ], | ||
| remap_paths = { | ||
| "/tests/integration/sample_client/vsomeip.json": "vsomeip.json", | ||
| }, | ||
| ) | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # QNX IFS image: boots QNX 8.0 with someipd + gatewayd inside with networking | ||
| # --------------------------------------------------------------------------- | ||
| qnx_ifs( | ||
| name = "someip_gateway_ifs", | ||
| testonly = True, | ||
| srcs = [ | ||
| "//deployment/qemu/configs:network_configs", | ||
| "//deployment/qemu/configs:ssh_configs", | ||
| ], | ||
| out = "someip_gateway_x86_64.ifs", | ||
| build_file = "init_x86_64.build", | ||
| target_compatible_with = [ | ||
| "@platforms//cpu:x86_64", | ||
| "@platforms//os:qnx", | ||
| ], | ||
| tars = { | ||
| "GATEWAY_BINS": ":gateway_binaries_pkg", | ||
| "GATEWAY_LIBS": ":gateway_libs_pkg", | ||
| "GATEWAY_CONFIGS": ":gateway_configs_pkg", | ||
| "SOMEIPD_CONFIGS": ":someipd_configs_pkg", | ||
| "SAMPLE_CLIENT_CONFIGS": ":sample_client_configs_pkg", | ||
| }, | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add that strategy to those tests which need to be executed locally. At the very least it should be limited to the
testcommand and not incommonUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to test only form qnx arm anx x86_64