Files
zephyr/samples/sysbuild/hello_world/pytest/test_both_uart.py
Grzegorz Chwierut ca26f143f0 samples: sysbuild: hello_world: Skip test if no second UART
If a second UART was not configured in the hardware map, then skip
the testcase instead of failing.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2026-01-12 12:41:31 -06:00

24 lines
654 B
Python

#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
import pytest
from twister_harness import DeviceAdapter
timeout = 5
regex = "Hello world from .*"
def test_uart_in_app(dut: DeviceAdapter):
"""Verify logs from uart in application"""
dut.readlines_until(regex=regex, print_output=True, timeout=timeout)
def test_uart_in_second_core(dut: DeviceAdapter):
"""Verify logs from uart in second core"""
if len(dut.connections) < 2:
pytest.skip("Only one UART connection configured for this device")
dut.readlines_until(connection_index=1, regex=regex, print_output=True, timeout=timeout)