-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
twister: pytest: Bluetooth: multi harness boards test against DuT
Add one harness_devices pytest fixture, Which will build and flash different harness apps into multi harness boards, then init all harness devices as dut for tests. Add tests for central_ht and peripehral_ht apps with this feature. Signed-off-by: Jingsai Lu <[email protected]>
- Loading branch information
Showing
8 changed files
with
147 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) 2025 NXP | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_os_boot(dut, harness_devices): | ||
dut.readlines_until('Booting Zephyr OS build', timeout=5) | ||
harness_devices[0].readlines_until('Booting Zephyr OS build', timeout=5) | ||
|
||
|
||
def test_bluetooth_boot(dut, harness_devices): | ||
dut.readlines_until('Scanning successfully started', timeout=5) | ||
harness_devices[0].readlines_until('Advertising successfully started', timeout=5) | ||
|
||
|
||
def test_bluetooth_connection(dut, harness_devices): | ||
dut.readlines_until('Connected', timeout=5) | ||
|
||
|
||
def test_match_temp_value_over_ble(dut, harness_devices): | ||
dut.readlines_until(r'Temperature \d{1,2}C', timeout=5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2025 NXP | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_os_boot(dut, harness_devices): | ||
dut.readlines_until('Booting Zephyr OS build', timeout=5) | ||
harness_devices[0].readlines_until('Booting Zephyr OS build', timeout=5) | ||
|
||
|
||
def test_bluetooth_boot(dut, harness_devices): | ||
dut.readlines_until('Advertising successfully started', timeout=5) | ||
harness_devices[0].readlines_until('Scanning successfully started', timeout=5) | ||
|
||
|
||
def test_bluetooth_connection(dut, harness_devices): | ||
harness_devices[0].readlines_until('Connected', timeout=5) | ||
|
||
|
||
def test_match_temp_value_over_ble(dut, harness_devices): | ||
dut.readlines_until('Indication success', timeout=5) | ||
harness_devices[0].readlines_until(r'Temperature \d{1,2}C', timeout=5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters