diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2023-02-19 18:36:32 +0200 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2023-03-15 17:58:14 +0200 |
commit | 84fbbb08459a66e98cad86a79f22ac3108cc56d5 (patch) | |
tree | d110f1fdcfa30c619ab2a1c4082d35adca22fb1c /test | |
parent | 725aed9608d46b1c3b2cd17a31597f75adfd264d (diff) |
validation: crypto: run all tests only when FULL_TEST env variable is set
Run all tests only when FULL_TEST environment variable is set to a nonzero
value. Otherwise limit test run time by skipping some parts of the tests.
As of now, the only thing skipped is the reinvocation of a crypto operation
with the same parameters (which does not add much coverage anyway). In
the future, when more tests get added, more skipping will be needed to
keep make check and CI run times reasonable.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/validation/api/crypto/odp_crypto_test_inp.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index c6a51e2f0..5251e68fc 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -6,12 +6,19 @@ */ #include <string.h> +#include <stdlib.h> #include <odp_api.h> #include <odp/helper/odph_api.h> #include <odp_cunit_common.h> #include <packet_common.h> #include "test_vectors.h" +/* + * If nonzero, run time consuming tests too. + * Set through FULL_TEST environment variable. + */ +static int full_test; + #define PKT_POOL_NUM 64 #define PKT_POOL_LEN (1 * 1024) #define UAREA_SIZE 8 @@ -881,7 +888,8 @@ static void alg_test_op(alg_test_param_t *param) param->wrong_digest = false; alg_test_execute(param); - alg_test_execute(param); /* rerun with the same parameters */ + if (full_test) + alg_test_execute(param); /* rerun with the same parameters */ param->wrong_digest = true; alg_test_execute(param); } @@ -2853,6 +2861,11 @@ static int crypto_term(odp_instance_t inst) int main(int argc, char *argv[]) { int ret; + char *env = getenv("FULL_TEST"); + + if (env && strcmp(env, "0")) + full_test = 1; + printf("Test mode: %s\n", full_test ? "full" : "partial"); /* parse common options: */ if (odp_cunit_parse_options(argc, argv)) |