No dependencies for storage format tests

Storage format tests that only look at how the file is structured and
don't care about the format of the key material don't depend on any
cryptographic mechanisms.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-01-12 21:18:36 +01:00
parent b51d72f82e
commit 80a970806f
2 changed files with 8 additions and 7 deletions

View file

@ -157,7 +157,6 @@ def dependencies_of_symbol(symbol):
return {symbol.replace('_', '_WANT_', 1)}
def systematic_dependencies(file_name, function_name, arguments):
#pylint: disable=unused-argument
"""List the systematically determined dependency for a test case."""
deps = set()
@ -171,6 +170,14 @@ def systematic_dependencies(file_name, function_name, arguments):
arguments[-2] = ''
arguments[-3] = ''
# Storage format tests that only look at how the file is structured and
# don't care about the format of the key material don't depend on any
# cryptographic mechanisms.
if os.path.basename(file_name) == 'test_suite_psa_crypto_persistent_key.data' and \
function_name in {'format_storage_data_check',
'parse_storage_data_check'}:
return []
for arg in arguments:
for symbol in re.findall(r'PSA_(?:ALG|KEY_TYPE)_\w+', arg):
deps.update(dependencies_of_symbol(symbol))