From ce220662119bff13da53ef5606ebf233e049ee54 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 21 Oct 2022 18:54:43 +0200 Subject: [PATCH 1/3] Rename test_suite_bignum for consistency with bignum.{h,c} Align the name of the bignum test suite with the source module (which was renamed from mpi.c to bignum.c in the PolarSSL 1.x days). This also brings it into line with the test suites for the low-level bignum interfaces. Signed-off-by: Gilles Peskine --- tests/scripts/generate_bignum_tests.py | 4 ++-- tests/suites/{test_suite_mpi.data => test_suite_bignum.data} | 0 .../{test_suite_mpi.function => test_suite_bignum.function} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename tests/suites/{test_suite_mpi.data => test_suite_bignum.data} (100%) rename tests/suites/{test_suite_mpi.function => test_suite_bignum.function} (100%) diff --git a/tests/scripts/generate_bignum_tests.py b/tests/scripts/generate_bignum_tests.py index 493582968e..4ac9210e71 100755 --- a/tests/scripts/generate_bignum_tests.py +++ b/tests/scripts/generate_bignum_tests.py @@ -70,8 +70,8 @@ from mbedtls_dev import bignum_core # pylint: disable=unused-import class BignumTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): #pylint: disable=abstract-method - """Target for bignum (mpi) test case generation.""" - target_basename = 'test_suite_mpi.generated' + """Target for bignum (legacy) test case generation.""" + target_basename = 'test_suite_bignum.generated' class BignumOperation(bignum_common.OperationCommon, BignumTarget, metaclass=ABCMeta): diff --git a/tests/suites/test_suite_mpi.data b/tests/suites/test_suite_bignum.data similarity index 100% rename from tests/suites/test_suite_mpi.data rename to tests/suites/test_suite_bignum.data diff --git a/tests/suites/test_suite_mpi.function b/tests/suites/test_suite_bignum.function similarity index 100% rename from tests/suites/test_suite_mpi.function rename to tests/suites/test_suite_bignum.function From 42832bd406a35326a219913d72603f0913002bea Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 21 Oct 2022 18:56:47 +0200 Subject: [PATCH 2/3] Don't use test_suite_mpi as an example It just got renamed, and it's also not the most canonical example since it's a somewhat deprecated interface. Make a different module the example. Signed-off-by: Gilles Peskine --- CONTRIBUTING.md | 2 +- tests/scripts/generate-afl-tests.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66fe5f1af0..0e2cf49121 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,7 @@ Tests ----- As mentioned, tests that show the correctness of the feature or bug fix should be added to the pull request, if no such tests exist. -Mbed TLS includes a comprehensive set of test suites in the `tests/` directory that are dynamically generated to produce the actual test source files (e.g. `test_suite_mpi.c`). These files are generated from a `function file` (e.g. `suites/test_suite_mpi.function`) and a `data file` (e.g. `suites/test_suite_mpi.data`). The function file contains the test functions. The data file contains the test cases, specified as parameters that will be passed to the test function. +Mbed TLS includes a comprehensive set of test suites in the `tests/` directory that are dynamically generated to produce the actual test source files (e.g. `test_suite_rsa.c`). These files are generated from a `function file` (e.g. `suites/test_suite_rsa.function`) and a `data file` (e.g. `suites/test_suite_rsa.data`). The function file contains the test functions. The data file contains the test cases, specified as parameters that will be passed to the test function. [A Knowledge Base article describing how to add additional tests is available on the Mbed TLS website](https://mbed-tls.readthedocs.io/en/latest/kb/development/test_suites/). diff --git a/tests/scripts/generate-afl-tests.sh b/tests/scripts/generate-afl-tests.sh index 7c9f432ae4..a640b566dd 100755 --- a/tests/scripts/generate-afl-tests.sh +++ b/tests/scripts/generate-afl-tests.sh @@ -6,7 +6,7 @@ # # Usage: generate-afl-tests.sh # - should be the path to one of the test suite files -# such as 'test_suite_mpi.data' +# such as 'test_suite_rsa.data' # # Copyright The Mbed TLS Contributors # SPDX-License-Identifier: Apache-2.0 From a020d535adb1e30a01531effd4bb3a9be9ccf4fc Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 21 Oct 2022 19:00:38 +0200 Subject: [PATCH 3/3] Avoid having both test_suite_XXX.data and test_suite_XXX.*.data Although our build scripts support that, it's annoying, because it makes "test_suite_XXX" ambiguous between "all the data for test_suite_XXX.function" and "just test_suite_XXX.data". Signed-off-by: Gilles Peskine --- .../{test_suite_bignum.data => test_suite_bignum.misc.data} | 0 ...st_suite_bignum_core.data => test_suite_bignum_core.misc.data} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/suites/{test_suite_bignum.data => test_suite_bignum.misc.data} (100%) rename tests/suites/{test_suite_bignum_core.data => test_suite_bignum_core.misc.data} (100%) diff --git a/tests/suites/test_suite_bignum.data b/tests/suites/test_suite_bignum.misc.data similarity index 100% rename from tests/suites/test_suite_bignum.data rename to tests/suites/test_suite_bignum.misc.data diff --git a/tests/suites/test_suite_bignum_core.data b/tests/suites/test_suite_bignum_core.misc.data similarity index 100% rename from tests/suites/test_suite_bignum_core.data rename to tests/suites/test_suite_bignum_core.misc.data