mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-02 23:07:22 +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 <[email protected]>
This commit is contained in:
@@ -13,11 +13,14 @@ from . import psa_information
|
|||||||
from . import test_case
|
from . import test_case
|
||||||
|
|
||||||
|
|
||||||
# A temporary hack: at the time of writing, not all dependency symbols
|
# Skip test cases for which the dependency symbols are not defined.
|
||||||
# are implemented yet. Skip test cases for which the dependency symbols are
|
# We assume that this means that a required mechanism is not implemented.
|
||||||
# not available. Once all dependency symbols are available, this hack must
|
# Note that if we erroneously skip generating test cases for
|
||||||
# be removed so that a bug in the dependency symbols properly leads to a test
|
# mechanisms that are not implemented, this should be caught
|
||||||
# failure.
|
# 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:
|
def read_implemented_dependencies(acc: Set[str], filename: str) -> None:
|
||||||
with open(filename) as input_stream:
|
with open(filename) as input_stream:
|
||||||
for line in 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)
|
_implemented_dependencies = frozenset(acc)
|
||||||
return [dep
|
return [dep
|
||||||
for dep in dependencies
|
for dep in dependencies
|
||||||
if (dep.lstrip('!') not in _implemented_dependencies and
|
if (dep not in _implemented_dependencies and
|
||||||
dep.lstrip('!').startswith('PSA_WANT'))]
|
dep.startswith('PSA_WANT'))]
|
||||||
|
|
||||||
|
|
||||||
class TestCase(test_case.TestCase):
|
class TestCase(test_case.TestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user