File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
samples/arch/mpu/mpu_test Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (c) 2023 Nordic Semiconductor ASA
2+ #
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ import logging
6+ import pytest
7+ import re
8+ from twister_harness import Shell
9+
10+ logger = logging .getLogger (__name__ )
11+
12+ TESTDATA = [
13+ ('mpu mtest 1' , 'The value is: 0x.*' ),
14+ ('mpu mtest 2' , 'The value is: 0x.*' ),
15+ ]
16+ @pytest .mark .parametrize ('command,expected' , TESTDATA )
17+ def test_shell_harness (shell : Shell , command , expected ):
18+ logger .info ('send "help" command' )
19+ lines = shell .exec_command (command )
20+ match = False
21+ for line in lines :
22+ if re .match (expected , line ):
23+ match = True
24+ break
25+
26+ assert match , 'expected response not found'
27+ logger .info ('response is valid' )
Original file line number Diff line number Diff line change 44 sample.mpu.mpu_test :
55 arch_allow : arm
66 filter : CONFIG_CPU_HAS_MPU and not CONFIG_ARM64
7- tags : mpu
8- harness : keyboard
7+ tags :
8+ - mpu
9+ harness : pytest
You can’t perform that action at this time.
0 commit comments