Skip to content

Commit f4afb05

Browse files
tests: zbus: add multidomain IPC backend test suite
Add comprehensive test suite for the zbus multidomain IPC backend. The implementation includes a mock IPC backend to enable isolated testing without requiring actual hardware communication between cores. Signed-off-by: Trond F. Christiansen <[email protected]>
1 parent e38acc8 commit f4afb05

File tree

9 files changed

+853
-0
lines changed

9 files changed

+853
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
cmake_minimum_required(VERSION 3.20.0)
3+
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(test_channel_name)
6+
7+
FILE(GLOB app_sources src/main.c src/mock_ipc.c)
8+
target_sources(app PRIVATE ${app_sources})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
fake_ipc: fake_ipc_device {
9+
compatible = "fake-ipc";
10+
status = "okay";
11+
};
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
fake_ipc: fake_ipc_device {
9+
compatible = "fake-ipc";
10+
status = "okay";
11+
};
12+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: Fake IPC backend for testing zbus multidomain
2+
3+
compatible: "fake-ipc"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
CONFIG_ZTEST=y
2+
CONFIG_ASSERT=n
3+
CONFIG_LOG=y
4+
CONFIG_ZBUS=y
5+
CONFIG_ZBUS_CHANNEL_ID=y
6+
CONFIG_ZBUS_CHANNEL_NAME=y
7+
CONFIG_ZBUS_MULTIDOMAIN=y
8+
CONFIG_ZBUS_MULTIDOMAIN_IPC=y
9+
CONFIG_ZBUS_MULTIDOMAIN_LOG_LEVEL_DBG=y
10+
11+
# Retransmission configuration for faster testing
12+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_ACK_TIMEOUT=10
13+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_ACK_TIMEOUT_MAX=100
14+
CONFIG_ZBUS_MULTIDOMAIN_MAX_TRANSMIT_ATTEMPTS=5
15+
16+
# Increase message pool size for testing multiple scenarios
17+
CONFIG_ZBUS_MULTIDOMAIN_SENT_MSG_POOL_SIZE=16
18+
19+
# FFF (Fake Function Framework) for mocking
20+
CONFIG_ZTEST_MOCKING=y
21+
22+
# IPC service support
23+
CONFIG_IPC_SERVICE=y
24+
CONFIG_MBOX=y

0 commit comments

Comments
 (0)