Move config-tfm.h testing to separate all.sh component

Rename the existing component_test_tfm_config which tests a modified version
of config-tfm.h for the sake of driver-vs-reference comparison.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2024-09-14 11:35:36 +02:00
parent dbd0f424b0
commit ced0edc43e
3 changed files with 15 additions and 7 deletions

View File

@ -576,7 +576,7 @@ KNOWN_TASKS = {
'analyze_driver_vs_reference_tfm_config': { 'analyze_driver_vs_reference_tfm_config': {
'test_function': do_analyze_driver_vs_reference, 'test_function': do_analyze_driver_vs_reference,
'args': { 'args': {
'component_ref': 'test_tfm_config', 'component_ref': 'test_tfm_config_no_p256m',
'component_driver': 'test_tfm_config_p256m_driver_accel_ec', 'component_driver': 'test_tfm_config_p256m_driver_accel_ec',
'ignored_suites': [ 'ignored_suites': [
# Modules replaced by drivers # Modules replaced by drivers

View File

@ -1640,9 +1640,19 @@ component_test_psa_crypto_config_reference_ecc_ffdh_no_bignum () {
common_test_psa_crypto_config_reference_ecc_ffdh_no_bignum "ECC_DH" common_test_psa_crypto_config_reference_ecc_ffdh_no_bignum "ECC_DH"
} }
component_test_tfm_config_as_is () {
msg "build: configs/config-tfm.h"
cp configs/config-tfm.h "$CONFIG_H"
CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan .
make
msg "test: configs/config-tfm.h - unit tests"
make test
}
# Helper for setting common configurations between: # Helper for setting common configurations between:
# - component_test_tfm_config_p256m_driver_accel_ec() # - component_test_tfm_config_p256m_driver_accel_ec()
# - component_test_tfm_config() # - component_test_tfm_config_no_p256m()
common_tfm_config () { common_tfm_config () {
# Enable TF-M config # Enable TF-M config
cp configs/config-tfm.h "$CONFIG_H" cp configs/config-tfm.h "$CONFIG_H"
@ -1696,14 +1706,14 @@ component_test_tfm_config_p256m_driver_accel_ec () {
# Keep this in sync with component_test_tfm_config_p256m_driver_accel_ec() as # Keep this in sync with component_test_tfm_config_p256m_driver_accel_ec() as
# they are both meant to be used in analyze_outcomes.py for driver's coverage # they are both meant to be used in analyze_outcomes.py for driver's coverage
# analysis. # analysis.
component_test_tfm_config () { component_test_tfm_config_no_p256m () {
common_tfm_config common_tfm_config
# Disable P256M driver, which is on by default, so that analyze_outcomes # Disable P256M driver, which is on by default, so that analyze_outcomes
# can compare this test with test_tfm_config_p256m_driver_accel_ec # can compare this test with test_tfm_config_p256m_driver_accel_ec
echo "#undef MBEDTLS_PSA_P256M_DRIVER_ENABLED" >> "$CONFIG_H" echo "#undef MBEDTLS_PSA_P256M_DRIVER_ENABLED" >> "$CONFIG_H"
msg "build: TF-M config" msg "build: TF-M config without p256m"
make CFLAGS='-Werror -Wall -Wextra -I../tests/include/spe' tests make CFLAGS='-Werror -Wall -Wextra -I../tests/include/spe' tests
# Check that p256m was not built # Check that p256m was not built
@ -1713,7 +1723,7 @@ component_test_tfm_config () {
# files, so we want to ensure that it has not be re-enabled accidentally. # files, so we want to ensure that it has not be re-enabled accidentally.
not grep mbedtls_cipher library/cipher.o not grep mbedtls_cipher library/cipher.o
msg "test: TF-M config" msg "test: TF-M config without p256m"
make test make test
} }

View File

@ -16,8 +16,6 @@ use warnings;
use strict; use strict;
my %configs = ( my %configs = (
'config-tfm.h' => {
},
); );
# If no config-name is provided, use all known configs. # If no config-name is provided, use all known configs.