Skip to content

Commit dcc8a1c

Browse files
gbrtthPatater
authored andcommitted
test: Add support to run tests on Musca-S1
Add support to run both TF-M regression tests and PSA compliance tests on Musca-S1 using `test_psa_target.py`. Signed-off-by: Gabor Toth <[email protected]>
1 parent 20de7c4 commit dcc8a1c

File tree

7 files changed

+72
-8
lines changed

7 files changed

+72
-8
lines changed

test/logs/ARM_MUSCA_S1/CRYPTO.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Crypto Suite Report
2+
TOTAL TESTS : [0-9]+
3+
TOTAL PASSED : [0-9]+
4+
TOTAL SIM ERROR : 0
5+
TOTAL FAILED : 27
6+
TOTAL SKIPPED : 0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Attestation Suite Report
2+
TOTAL TESTS : [0-9]+
3+
TOTAL PASSED : [0-9]+
4+
TOTAL SIM ERROR : 0
5+
TOTAL FAILED : 0
6+
TOTAL SKIPPED : 0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Storage Suite Report
2+
TOTAL TESTS : [0-9]+
3+
TOTAL PASSED : [0-9]+
4+
TOTAL SIM ERROR : 0
5+
TOTAL FAILED : 0
6+
TOTAL SKIPPED : 0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Storage Suite Report
2+
TOTAL TESTS : [0-9]+
3+
TOTAL PASSED : [0-9]+
4+
TOTAL SIM ERROR : 0
5+
TOTAL FAILED : 0
6+
TOTAL SKIPPED : 6

test/logs/ARM_MUSCA_S1/REGRESSION.log

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Non-secure test suites summary
2+
Test suite 'PSA protected storage NS interface tests \(TFM_PS_TEST_1XXX\)' has .* PASSED
3+
Test suite 'PSA internal trusted storage NS interface tests \(TFM_ITS_TEST_1XXX\)' has .* PASSED
4+
Test suite 'Crypto non-secure interface test \(TFM_CRYPTO_TEST_6XXX\)' has .* PASSED
5+
Test suite 'Initial Attestation Service non-secure interface tests\(TFM_ATTEST_TEST_2XXX\)' has .* PASSED
6+
Test suite 'QCBOR regression test\(TFM_QCBOR_TEST_7XXX\)' has .* PASSED
7+
Test suite 'T_COSE regression test\(TFM_T_COSE_TEST_8XXX\)' has .* PASSED
8+
Test suite 'Core non-secure positive tests \(TFM_CORE_TEST_1XXX\)' has .* PASSED
9+
Test suite 'IPC non-secure interface test \(TFM_IPC_TEST_1XXX\)' has .* PASSED
10+
End of Non-secure test suites

test/logs/ARM_MUSCA_S1/STORAGE.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Storage Suite Report
2+
TOTAL TESTS : [0-9]+
3+
TOTAL PASSED : [0-9]+
4+
TOTAL SIM ERROR : 0
5+
TOTAL FAILED : 0
6+
TOTAL SKIPPED : 6

test_psa_target.py

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,22 @@ def _erase_flash_storage(args, suite):
152152
"-Intel",
153153
]
154154

155+
if args.mcu == "ARM_MUSCA_S1":
156+
cmd = [
157+
"srec_cat",
158+
"mbed-os-tf-m-regression-tests.bin",
159+
"-Binary",
160+
"-offset",
161+
"0xA000000",
162+
"-fill",
163+
"0xFF",
164+
"0xA1E9000",
165+
"0xA1ED000",
166+
"-o",
167+
"mbed-os-tf-m-regression-tests-reset-flash.hex",
168+
"-Intel",
169+
]
170+
155171
retcode = run_cmd_output_realtime(cmd, mbed_os_dir)
156172
if retcode:
157173
logging.critical(
@@ -198,7 +214,7 @@ def _execute_test(args, suite):
198214
logging.critical(
199215
"Test **FAILED** for target %s, suite %s", args.mcu, suite
200216
)
201-
test_results[suite] = False
217+
test_results[suite] = "FAILED"
202218

203219

204220
def _run_regression_test(args):
@@ -225,6 +241,16 @@ def _run_compliance_test(args):
225241
_set_json_param(0, 1)
226242

227243
for suite in PSA_SUITE_CHOICES:
244+
245+
# Issue : https://github.com/ARMmbed/mbed-os-tf-m-regression-tests/issues/49
246+
# There is no support for this target to run Firmware Framework tests
247+
if suite == "IPC" and args.mcu == "ARM_MUSCA_S1":
248+
logging.info(
249+
"%s config is not supported for %s target" % (suite, args.mcu)
250+
)
251+
test_results[suite] = "SKIPPED"
252+
continue
253+
228254
logging.info("Build PSA Compliance - %s suite for %s", suite, args.mcu)
229255

230256
_build_psa_compliance(args, suite)
@@ -246,7 +272,7 @@ def _get_parser():
246272
"--mcu",
247273
help="Build for the given MCU",
248274
required=True,
249-
choices=["ARM_MUSCA_B1"],
275+
choices=["ARM_MUSCA_B1", "ARM_MUSCA_S1"],
250276
default=None,
251277
)
252278

@@ -290,7 +316,7 @@ def _init_results_dict():
290316
test_results = {}
291317
complete_list = ["REGRESSION"] + PSA_SUITE_CHOICES
292318
for index in complete_list:
293-
test_results[index] = True
319+
test_results[index] = "PASSED"
294320

295321

296322
def _print_results_and_exit():
@@ -301,12 +327,10 @@ def _print_results_and_exit():
301327
logging.info("*** Test execution status ***")
302328

303329
for key in test_results:
304-
if test_results.get(key):
305-
result = "PASSED"
306-
else:
307-
result = "FAILED"
330+
if test_results.get(key) == "FAILED":
308331
err = True
309-
logging.info(key + " suite : " + result)
332+
333+
logging.info(key + " suite : " + test_results.get(key))
310334

311335
logging.info("*** End Report ***")
312336

0 commit comments

Comments
 (0)