Repository navigation
Expand file tree
/
Copy pathdartmonkey-custom.robot
More file actions
111 lines (90 loc) · 4.6 KB
/
Copy pathdartmonkey-custom.robot
File metadata and controls
111 lines (90 loc) · 4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Custom tests, with additional run parameters or conditions
Should Run test-fpsensor.bin uart
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Run Test test-fpsensor.bin uart
Should Run test-fpsensor.bin spi
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Run Test test-fpsensor.bin spi
Should Run test-debug.bin no_debugger
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Run Test test-debug.bin no_debugger
Should Run test-system_is_locked.bin wp_on
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Run Test test-system_is_locked.bin wp_on
Should Run test-system_is_locked.bin wp_off
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Create Machine system_is_locked
${RESET_MACRO}= Catenate SEPARATOR=\n
... """
... sysbus LoadBinary $bin 0x08000000
... sysbus LoadSymbolsFrom $elf_ro
... sysbus LoadSymbolsFrom $elf_rw
... gpioPortB.GPIO_WP Press
... cpu PC 0x80002ed
... """
Execute Command macro reset${\n}${RESET_MACRO}
Execute Command machine Reset
Start Emulation
Wait For System Prompt
Write Line To Uart runtest wp_off
Wait For Line On Uart Pass!
Should Run test-flash_write_protect.bin
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Start In RO test-flash_write_protect.bin
Write Line To Uart runtest
Wait For Line On Uart Pass!
Should Run test-rollback.bin region0
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Expect MPU failure test-rollback.bin region0
Should Run test-rollback.bin region1
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Expect MPU failure test-rollback.bin region1
Should Run test-rollback_entropy.bin
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Start In RO test-rollback_entropy.bin
Write Line To Uart runtest
Wait For Line On Uart Pass!
Should Run test-benchmark.bin
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Start To Prompt test-benchmark.bin
# Reduce quantum value as this test requires more precision
Execute Command emulation SetGlobalQuantum "0.000005"
Write Line To Uart runtest
Wait For Line On Uart Pass!
Should Run spixfer test
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Create Machine fpsensor
Execute Command machine LoadPlatformDescriptionFromString 'sensor: Sensors.GenericSPISensor @ spi4'
Execute Command spi4.sensor FeedSample 0xAB
Execute Command spi4.sensor FeedSample 0xAB
Execute Command spi4.sensor FeedSample 0xCD
Execute Command spi4.sensor FeedSample 0xEF
Start Emulation
Wait For System Prompt
Write Line To Uart spixfer rlen 0 0 3
Wait For Line On Uart Data: abcdef
Execute Command spi4.sensor FeedSample 0xFE
Execute Command spi4.sensor FeedSample 0xFE
Execute Command spi4.sensor FeedSample 0xDC
Execute Command spi4.sensor FeedSample 0xBA
Write Line To Uart spixfer rlen 0 0 3
Wait For Line On Uart Data: fedcba
Should Run test-fpsensor_hw.bin
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Create Machine fpsensor_hw
Execute Command machine LoadPlatformDescriptionFromString 'sensor: Sensors.GenericSPISensor @ spi4'
# Hardware id of the expected fpsensor
Execute Command spi4.sensor FeedSample 0x00
Execute Command spi4.sensor FeedSample 0x14
# Last 4 bits are random as this is manufacturing id that should be discarded by the test
${manufacturing_id}= Generate Random String 1 [NUMBERS]ABCDEF
Execute Command spi4.sensor FeedSample 0x0${manufacturing_id}
Start Emulation
Wait For System Prompt
Write Line To Uart runtest
Wait For Line On Uart Pass!
Should Run test-sbrk.bin
Set Test Variable ${TESTS_PATH} ${TESTS_PATH}/custom
Start In RO test-sbrk.bin
Write Line To Uart runtest
Wait For Line On Uart Pass!