From 8c59f7f236a4e5971aa4ee2632e01a0a9b578383 Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Wed, 5 Jun 2019 15:31:29 +0200 Subject: [PATCH] tests/torture_pki_dsa: Skip completely if in FIPS mode DSA is not allowed in FIPS mode. Signed-off-by: Anderson Toshiyuki Sasaki Reviewed-by: Andreas Schneider --- tests/unittests/torture_pki_dsa.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/unittests/torture_pki_dsa.c b/tests/unittests/torture_pki_dsa.c index b88aa84e..f1fd9bf9 100644 --- a/tests/unittests/torture_pki_dsa.c +++ b/tests/unittests/torture_pki_dsa.c @@ -815,6 +815,11 @@ static void torture_pki_dsa_cert_verify(void **state) ssh_free(session); } +static void torture_pki_dsa_skip(UNUSED_PARAM(void **state)) +{ + skip(); +} + int torture_run_tests(void) { int rc; @@ -865,10 +870,17 @@ int torture_run_tests(void) setup_dsa_key, teardown), }; + struct CMUnitTest skip_tests[] = { + cmocka_unit_test(torture_pki_dsa_skip) + }; ssh_init(); - torture_filter_tests(tests); - rc = cmocka_run_group_tests(tests, NULL, NULL); + if (ssh_fips_mode()) { + rc = cmocka_run_group_tests(skip_tests, NULL, NULL); + } else { + torture_filter_tests(tests); + rc = cmocka_run_group_tests(tests, NULL, NULL); + } ssh_finalize(); return rc; }