mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-06-05 21:15:09 +00:00
Do run not-supported test cases on not-implemented mechanisms
In automatically generated PSA test cases with automatically inferred dependencies, we were systematically skipping test cases when a dependency mentions a mechanism that is not supported, even when that dependency is negated. Fix this. This causes more not-supported test cases to run. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -13,11 +13,14 @@ from . import psa_information
|
||||
from . import test_case
|
||||
|
||||
|
||||
# A temporary hack: at the time of writing, not all dependency symbols
|
||||
# are implemented yet. Skip test cases for which the dependency symbols are
|
||||
# not available. Once all dependency symbols are available, this hack must
|
||||
# be removed so that a bug in the dependency symbols properly leads to a test
|
||||
# failure.
|
||||
# Skip test cases for which the dependency symbols are not defined.
|
||||
# We assume that this means that a required mechanism is not implemented.
|
||||
# Note that if we erroneously skip generating test cases for
|
||||
# mechanisms that are not implemented, this should be caught
|
||||
# by the NOT_SUPPORTED test cases generated by generate_psa_tests.py
|
||||
# in test_suite_psa_crypto_not_supported and test_suite_psa_crypto_op_fail:
|
||||
# those emit tests with negative dependencies, which will not be skipped here.
|
||||
|
||||
def read_implemented_dependencies(acc: Set[str], filename: str) -> None:
|
||||
with open(filename) as input_stream:
|
||||
for line in input_stream:
|
||||
@@ -46,8 +49,8 @@ def find_dependencies_not_implemented(dependencies: List[str]) -> List[str]:
|
||||
_implemented_dependencies = frozenset(acc)
|
||||
return [dep
|
||||
for dep in dependencies
|
||||
if (dep.lstrip('!') not in _implemented_dependencies and
|
||||
dep.lstrip('!').startswith('PSA_WANT'))]
|
||||
if (dep not in _implemented_dependencies and
|
||||
dep.startswith('PSA_WANT'))]
|
||||
|
||||
|
||||
class TestCase(test_case.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user