1#-------------------------------------------------------------------------------
2# Copyright (c) 2022-2023, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8menu "TF-M regression tests"
9
10################################# Bootloader test ##############################
11
12config TEST_BL1_1
13    bool "BL1_1 tests"
14    default n
15    depends on BL1
16
17config TEST_BL1_2
18    bool "BL1_2 tests"
19    default n
20    depends on BL1
21
22config TEST_BL2
23    bool "BL2 tests"
24    default n
25    depends on BL2
26
27################################# Regression test ##############################
28
29config TEST_FRAMEWORK_S
30    bool
31    default y if EXTRA_S_TEST_SUITE_PATH != ""
32    default n
33    help
34      Whether to build S regression tests framework
35
36config TEST_FRAMEWORK_NS
37    bool
38    depends on NS
39    default y if EXTRA_NS_TEST_SUITE_PATH != ""
40    default n
41    help
42      Whether to build NS regression tests framework
43
44config TFM_S_REG_TEST
45    bool
46    default y if EXTRA_S_TEST_SUITE_PATH != ""
47    default n
48    help
49      By default all secure regression tests are disabled.
50      If TEST_S or TEST_S_XXX flag is passed via command line
51      and set to ON, selected corresponding features to support
52      secure regression tests.
53
54      TFM_S_REG_TEST is a TF-M internal cmake flag to manage building
55      tf-m-tests secure regression tests related source
56
57config TFM_NS_REG_TEST
58    bool
59    default y if EXTRA_NS_TEST_SUITE_PATH != ""
60    default n
61    help
62      By default all non-secure regression tests are disabled.
63      If TEST_NS or TEST_NS_XXX flag is passed via command line
64      and set to ON, selected corresponding features to support
65      non-secure regression tests.
66
67      TFM_NS_REG_TEST is a TF-M internal cmake flag to manage building
68      tf-m-tests non-secure regression tests related source
69
70################################# Test partition ###############################
71
72config TFM_PARTITION_IPC_TEST
73    def_bool n
74
75config TFM_PARTITION_SFN_BACKEND_TEST
76    def_bool n
77
78config TEST_PARTITION_FPU_TEST
79    def_bool n
80
81################################# Main switch ##################################
82
83config TEST_S
84    bool "Enable default secure test cases"
85    default n
86    select TEST_FRAMEWORK_S
87    select TFM_S_REG_TEST
88    imply TEST_S_ATTESTATION
89    imply TEST_S_CRYPTO
90    imply TEST_S_ITS
91    imply TEST_S_PS
92    imply TEST_S_PLATFORM
93    imply TEST_S_FWU
94    imply TEST_S_IPC
95    imply TEST_S_SFN_BACKEND
96
97config TEST_NS
98    bool "Enable default non-secure test cases"
99    default n
100    imply TEST_FRAMEWORK_NS
101    select TFM_NS_REG_TEST
102    imply TEST_NS_ATTESTATION
103    imply TEST_NS_T_COSE
104    imply TEST_NS_QCBOR
105    imply TEST_NS_CRYPTO
106    imply TEST_NS_PS
107    imply TEST_NS_ITS
108    imply TEST_NS_PLATFORM
109    imply TEST_NS_FWU
110    imply TEST_NS_MULTI_CORE
111    imply TEST_NS_MANAGE_NSID
112    imply TEST_NS_IPC
113    imply TEST_NS_SFN_BACKEND
114
115################################# Secure test ##################################
116
117menu "Secure regression tests"
118
119config TEST_S_ATTESTATION
120    bool "Attestation"
121    default n
122    imply TFM_PARTITION_INITIAL_ATTESTATION
123    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
124    imply TFM_PARTITION_CRYPTO
125    select TEST_FRAMEWORK_S
126    select TFM_S_REG_TEST
127
128config TEST_S_CRYPTO
129    bool "Crypto"
130    default n
131    imply TFM_PARTITION_CRYPTO
132    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
133    select TEST_FRAMEWORK_S
134    select TFM_S_REG_TEST
135
136config TEST_S_ITS
137    bool "ITS"
138    default n
139    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
140    select TEST_FRAMEWORK_S
141    select TFM_S_REG_TEST
142
143config TEST_S_PS
144    bool "PS"
145    default n
146    imply TFM_PARTITION_PROTECTED_STORAGE
147    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
148    imply TFM_PARTITION_CRYPTO
149    imply TFM_PARTITION_PLATFORM
150    select TEST_FRAMEWORK_S
151    select TFM_S_REG_TEST
152
153config TEST_S_PLATFORM
154    bool "Platform"
155    default n
156    imply TFM_PARTITION_PLATFORM
157    select TEST_FRAMEWORK_S
158    select TFM_S_REG_TEST
159
160config TEST_S_FWU
161    bool "FWU"
162    depends on PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT
163    imply TFM_PARTITION_FIRMWARE_UPDATE
164    imply TFM_PARTITION_CRYPTO
165    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
166    imply TFM_PARTITION_PLATFORM
167    select TEST_FRAMEWORK_S
168    select TFM_S_REG_TEST
169
170config TEST_S_IPC
171    bool "IPC"
172    depends on CONFIG_TFM_SPM_BACKEND_IPC
173    select TEST_FRAMEWORK_S
174    select TFM_S_REG_TEST
175    select TFM_PARTITION_IPC_TEST
176
177config TEST_S_SFN_BACKEND
178    bool "SFN backend"
179    depends on CONFIG_TFM_SPM_BACKEND_SFN
180    select TEST_FRAMEWORK_S
181    select TFM_S_REG_TEST
182    select TFM_PARTITION_SFN_BACKEND_TEST
183
184config TEST_S_FPU
185    bool "FPU"
186    depends on CONFIG_TFM_ENABLE_FP
187    select TEST_FRAMEWORK_S
188    select TFM_S_REG_TEST
189    select TEST_PARTITION_FPU_TEST
190endmenu
191
192################################# Non-secure test ##############################
193
194menu "Non-Secure regression tests"
195
196config TEST_NS_ATTESTATION
197    bool "Attestation"
198    default n
199    imply TFM_PARTITION_INITIAL_ATTESTATION
200    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
201    imply TFM_PARTITION_CRYPTO
202    imply TEST_FRAMEWORK_NS
203    select TFM_NS_REG_TEST
204
205config TEST_NS_T_COSE
206    bool "t_cose"
207    default n
208    imply TFM_PARTITION_INITIAL_ATTESTATION
209    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
210    imply TFM_PARTITION_CRYPTO
211    imply TEST_FRAMEWORK_NS
212    select TFM_NS_REG_TEST
213
214config TEST_NS_QCBOR
215    bool "QCBOR"
216    default n
217    imply TFM_PARTITION_INITIAL_ATTESTATION
218    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
219    imply TFM_PARTITION_CRYPTO
220    imply TEST_FRAMEWORK_NS
221    select TFM_NS_REG_TEST
222
223config TEST_NS_CRYPTO
224    bool "Crypto"
225    default n
226    imply TFM_PARTITION_CRYPTO
227    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
228    imply TEST_FRAMEWORK_NS
229    select TFM_NS_REG_TEST
230
231config TEST_NS_PS
232    bool "PS"
233    default n
234    imply TFM_PARTITION_PROTECTED_STORAGE
235    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
236    imply TFM_PARTITION_CRYPTO
237    imply TFM_PARTITION_PLATFORM
238    imply TEST_NS_ITS
239    imply TEST_FRAMEWORK_NS
240    select TFM_NS_REG_TEST
241
242config TEST_NS_ITS
243    bool "ITS"
244    default n
245    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
246    imply TEST_FRAMEWORK_NS
247    select TFM_NS_REG_TEST
248
249config TEST_NS_PLATFORM
250    bool "Platform"
251    default n
252    imply TFM_PARTITION_PLATFORM
253    imply TEST_FRAMEWORK_NS
254    select TFM_NS_REG_TEST
255
256config TEST_NS_FWU
257    bool "FWU"
258    depends on PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT
259    imply TFM_PARTITION_FIRMWARE_UPDATE
260    imply TFM_PARTITION_CRYPTO
261    imply TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
262    imply TFM_PARTITION_PLATFORM
263    imply TEST_FRAMEWORK_NS
264    select TFM_NS_REG_TEST
265
266config TEST_NS_MULTI_CORE
267    bool "Multi-core"
268    depends on TFM_MULTI_CORE_TOPOLOGY
269    imply TEST_FRAMEWORK_NS
270    select TFM_NS_REG_TEST
271
272config TEST_NS_MANAGE_NSID
273    bool "NSID management"
274    depends on TFM_NS_MANAGE_NSID
275    imply TEST_FRAMEWORK_NS
276    select TFM_NS_REG_TEST
277
278choice TEST_NS_IRQ
279    prompt "IRQ test type"
280    depends on PLATFORM_FLIH_IRQ_TEST_SUPPORT || PLATFORM_SLIH_IRQ_TEST_SUPPORT
281    optional
282
283    config TEST_NS_FLIH_IRQ
284        bool "First-Level Interrupt Handling"
285        depends on PLATFORM_FLIH_IRQ_TEST_SUPPORT
286        imply TEST_FRAMEWORK_NS
287        select TFM_NS_REG_TEST
288
289    config TEST_NS_SLIH_IRQ
290        bool "Second-Level Interrupt Handling"
291        depends on PLATFORM_SLIH_IRQ_TEST_SUPPORT
292        imply TEST_FRAMEWORK_NS
293        select TFM_NS_REG_TEST
294
295endchoice
296
297config TEST_NS_FPU
298    bool "FPU"
299    depends on CONFIG_TFM_ENABLE_FP
300    imply TEST_FRAMEWORK_NS
301    select TFM_NS_REG_TEST
302    select TEST_PARTITION_FPU_TEST
303
304config TEST_NS_IPC
305    bool "IPC"
306    depends on CONFIG_TFM_SPM_BACKEND_IPC
307    imply TEST_FRAMEWORK_NS
308    select TFM_NS_REG_TEST
309    select TFM_PARTITION_IPC_TEST
310
311config TEST_NS_SFN_BACKEND
312    bool "SFN backend"
313    depends on CONFIG_TFM_SPM_BACKEND_SFN
314    imply TEST_FRAMEWORK_NS
315    select TFM_NS_REG_TEST
316    select TFM_PARTITION_SFN_BACKEND_TEST
317
318endmenu
319
320################################# Crypto tests #################################
321
322menu "Crypto Test Configs"
323    visible if TEST_NS_CRYPTO || TEST_S_CRYPTO
324
325config TFM_CRYPTO_TEST_ALG_CBC
326    bool "Test CBC cryptography mode"
327    default y
328
329config TFM_CRYPTO_TEST_ALG_CCM
330    bool "Test CCM cryptography mode"
331    default y
332
333config TFM_CRYPTO_TEST_ALG_CFB
334    bool "Test CFB cryptography mode"
335    default y
336
337config TFM_CRYPTO_TEST_ALG_ECB
338    bool "Test ECB cryptography mode"
339    default y
340
341config TFM_CRYPTO_TEST_ALG_CTR
342    bool "Test CTR cryptography mode"
343    default y
344
345config TFM_CRYPTO_TEST_ALG_OFB
346    bool "Test OFB cryptography mode"
347    default y
348
349config TFM_CRYPTO_TEST_ALG_GCM
350    bool "Test GCM cryptography mode"
351    default y
352
353config TFM_CRYPTO_TEST_ALG_SHA_384
354    bool "Test SHA-384 cryptography algorithm"
355    default y
356
357config TFM_CRYPTO_TEST_ALG_SHA_512
358    bool "Test SHA-512 cryptography algorithm"
359    default y
360
361config TFM_CRYPTO_TEST_HKDF
362    bool "Test the HKDF key derivation algorithm"
363    default y
364
365config TFM_CRYPTO_TEST_ECDH
366    bool "Test the ECDH key agreement algorithm"
367    default y
368
369config TFM_CRYPTO_TEST_CHACHA20
370    bool "Test the ChaCha20 stream cipher"
371    default n
372
373config TFM_CRYPTO_TEST_ALG_CHACHA20_POLY1305
374    bool "Test ChaCha20-Poly1305 AEAD algorithm"
375    default n
376
377config TFM_CRYPTO_TEST_ALG_RSASSA_PSS_VERIFICATION
378    bool "Test RSASSA-PSS signature verification algorithm"
379    default y
380
381config TFM_CRYPTO_TEST_SINGLE_PART_FUNCS
382    bool "Test single-part operations in hash, MAC, AEAD and symmetric ciphers"
383    default y
384
385endmenu
386
387################################# FWU tests ####################################
388
389if TEST_NS_FWU || TEST_S_FWU
390
391menu "FWU Test Configs"
392
393config TFM_FWU_TEST_REQUEST_REBOOT
394    bool "Test psa_fwu_request_reboot"
395    default n
396
397config TFM_FWU_TEST_WRITE_WITH_NULL
398    bool "Test psa_fwu_write with data block NULL"
399    default n
400
401config TFM_FWU_TEST_QUERY_WITH_NULL
402    bool "Test psa_fwu_query with info NULL"
403    default n
404
405endmenu
406endif
407
408################################# Extra tests ##################################
409
410menu "Extra tests"
411
412config EXTRA_S_TEST_SUITE_PATH
413    string "Secure extra test suite"
414    default ""
415    help
416      An extra test suite folder contains source code, CMakeLists.txt and cmake
417      configuration file
418
419config EXTRA_NS_TEST_SUITE_PATH
420    string "Non-secure extra test suite"
421    default ""
422    help
423      An extra test suite folder contains source code, CMakeLists.txt and cmake
424      configuration file
425
426endmenu
427
428endmenu
429