|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -# Test runner |
4 |
| -# |
5 |
| -# Copyright (c) 2017 Open Source Foundries Limited |
6 |
| - |
7 |
| -# |
8 |
| -# This script can be used to execute the Zephyr test plan detailed in |
9 |
| -# docs/testplan-zephyr.md. |
10 |
| -# |
11 |
| - |
12 |
| -function ok_yn () { |
13 |
| - while true ; do |
14 |
| - read -p "Test result OK (y/n)? " -n 1 choice |
15 |
| - echo |
16 |
| - case "$choice" in |
17 |
| - y|Y ) |
18 |
| - return |
19 |
| - ;; |
20 |
| - n|N ) |
21 |
| - echo "Test failed; exiting" |
22 |
| - exit 1 |
23 |
| - ;; |
24 |
| - * ) |
25 |
| - echo Please enter y or n |
26 |
| - ;; |
27 |
| - esac |
28 |
| - done |
29 |
| -} |
30 |
| - |
31 |
| -set -e |
32 |
| - |
33 |
| -echo '--------------------------------------------------------' |
34 |
| -echo '------------------------ GOOD RSA ----------------------' |
35 |
| -make test-good-rsa |
36 |
| -pyocd erase --chip |
37 |
| -echo "Flashing bootloader" |
38 |
| -make flash_boot |
39 |
| -echo "Expected result: unable to find bootable image" |
40 |
| -ok_yn |
41 |
| -echo "Flashing hello 1" |
42 |
| -make flash_hello1 |
43 |
| -echo "Expected result: hello1 runs" |
44 |
| -ok_yn |
45 |
| -echo "Flashing hello 2" |
46 |
| -make flash_hello2 |
47 |
| -echo "Expected result: hello2 runs" |
48 |
| -ok_yn |
49 |
| -echo "Resetting" |
50 |
| -pyocd commander -c reset |
51 |
| -echo "Expected result: hello1 runs" |
52 |
| -ok_yn |
53 |
| - |
54 |
| -echo '--------------------------------------------------------' |
55 |
| -echo '------------------------ GOOD ECDSA --------------------' |
56 |
| -make test-good-ecdsa |
57 |
| -pyocd erase --chip |
58 |
| -make flash_boot |
59 |
| -echo "Expected result: unable to find bootable image" |
60 |
| -ok_yn |
61 |
| -echo "Flashing hello 1" |
62 |
| -make flash_hello1 |
63 |
| -echo "Expected result: hello1 runs" |
64 |
| -ok_yn |
65 |
| -echo "Flashing hello 2" |
66 |
| -make flash_hello2 |
67 |
| -echo "Expected result: hello2 runs" |
68 |
| -ok_yn |
69 |
| -echo "Resetting" |
70 |
| -pyocd commander -c reset |
71 |
| -echo "Expected result: hello1 runs" |
72 |
| -ok_yn |
73 |
| - |
74 |
| -echo '--------------------------------------------------------' |
75 |
| -echo '------------------------ OVERWRITE ---------------------' |
76 |
| -make test-overwrite |
77 |
| -pyocd erase --chip |
78 |
| -make flash_boot |
79 |
| -echo "Expected result: unable to find bootable image" |
80 |
| -ok_yn |
81 |
| -echo "Flashing hello 1" |
82 |
| -make flash_hello1 |
83 |
| -echo "Expected result: hello1 runs" |
84 |
| -ok_yn |
85 |
| -echo "Flashing hello 2" |
86 |
| -make flash_hello2 |
87 |
| -echo "Expected result: hello2 runs" |
88 |
| -ok_yn |
89 |
| -echo "Resetting" |
90 |
| -pyocd commander -c reset |
91 |
| -echo "Expected result: hello2 runs" |
92 |
| -ok_yn |
93 |
| - |
94 |
| -echo '--------------------------------------------------------' |
95 |
| -echo '------------------------ BAD RSA -----------------------' |
96 |
| -make test-bad-rsa-upgrade |
97 |
| -pyocd erase --chip |
98 |
| -make flash_boot |
99 |
| -echo "Expected result: unable to find bootable image" |
100 |
| -ok_yn |
101 |
| -echo "Flashing hello 1" |
102 |
| -make flash_hello1 |
103 |
| -echo "Expected result: hello1 runs" |
104 |
| -ok_yn |
105 |
| -echo "Flashing hello 2" |
106 |
| -make flash_hello2 |
107 |
| -echo "Expected result: hello1 runs" |
108 |
| -ok_yn |
109 |
| -echo "Resetting" |
110 |
| -pyocd commander -c reset |
111 |
| -echo "Expected result: hello1 runs" |
112 |
| -ok_yn |
113 |
| - |
114 |
| -echo '--------------------------------------------------------' |
115 |
| -echo '------------------------ BAD ECDSA ---------------------' |
116 |
| -make test-bad-ecdsa-upgrade |
117 |
| -pyocd erase --chip |
118 |
| -make flash_boot |
119 |
| -echo "Expected result: unable to find bootable image" |
120 |
| -ok_yn |
121 |
| -echo "Flashing hello 1" |
122 |
| -make flash_hello1 |
123 |
| -echo "Expected result: hello1 runs" |
124 |
| -ok_yn |
125 |
| -echo "Flashing hello 2" |
126 |
| -make flash_hello2 |
127 |
| -echo "Expected result: hello1 runs" |
128 |
| -ok_yn |
129 |
| -echo "Resetting" |
130 |
| -pyocd commander -c reset |
131 |
| -echo "Expected result: hello1 runs" |
132 |
| -ok_yn |
133 |
| - |
134 |
| -echo '--------------------------------------------------------' |
135 |
| -echo '------------------------ NO BOOTCHECK ------------------' |
136 |
| -make test-no-bootcheck |
137 |
| -pyocd erase --chip |
138 |
| -make flash_boot |
139 |
| -echo "Expected result: unable to find bootable image" |
140 |
| -ok_yn |
141 |
| -echo "Flashing hello 1" |
142 |
| -make flash_hello1 |
143 |
| -echo "Expected result: hello1 runs" |
144 |
| -ok_yn |
145 |
| -echo "Flashing hello 2" |
146 |
| -make flash_hello2 |
147 |
| -echo "Expected result: hello1 runs" |
148 |
| -ok_yn |
149 |
| -echo "Resetting" |
150 |
| -pyocd commander -c reset |
151 |
| -echo "Expected result: hello1 runs" |
152 |
| -ok_yn |
153 |
| - |
154 |
| -echo '--------------------------------------------------------' |
155 |
| -echo '------------------------ WRONG RSA ---------------------' |
156 |
| -make test-wrong-rsa |
157 |
| -pyocd erase --chip |
158 |
| -make flash_boot |
159 |
| -echo "Expected result: unable to find bootable image" |
160 |
| -ok_yn |
161 |
| -echo "Flashing hello 1" |
162 |
| -make flash_hello1 |
163 |
| -echo "Expected result: hello1 runs" |
164 |
| -ok_yn |
165 |
| -echo "Flashing hello 2" |
166 |
| -make flash_hello2 |
167 |
| -echo "Expected result: hello1 runs" |
168 |
| -ok_yn |
169 |
| -echo "Resetting" |
170 |
| -pyocd commander -c reset |
171 |
| -echo "Expected result: hello1 runs" |
172 |
| -ok_yn |
173 |
| - |
174 |
| -echo '--------------------------------------------------------' |
175 |
| -echo '------------------------ WRONG ECDSA -------------------' |
176 |
| -make test-wrong-ecdsa |
177 |
| -pyocd erase --chip |
178 |
| -make flash_boot |
179 |
| -echo "Expected result: unable to find bootable image" |
180 |
| -ok_yn |
181 |
| -echo "Flashing hello 1" |
182 |
| -make flash_hello1 |
183 |
| -echo "Expected result: hello1 runs" |
184 |
| -ok_yn |
185 |
| -echo "Flashing hello 2" |
186 |
| -make flash_hello2 |
187 |
| -echo "Expected result: hello1 runs" |
188 |
| -ok_yn |
189 |
| -echo "Resetting" |
190 |
| -pyocd commander -c reset |
191 |
| -echo "Expected result: hello1 runs" |
192 |
| -ok_yn |
193 |
| - |
194 |
| -echo '========================================================' |
195 |
| -echo ' ALL TESTS PASSED' |
196 |
| -echo '========================================================' |
| 3 | +echo "Please use the new test runner: go run run-tests.go" |
| 4 | +exit 1 |
0 commit comments