From 20f8bc72552932393023f5bc5b436cc40cdd1348 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Sun, 29 Nov 2020 12:40:10 +0100 Subject: [PATCH] test cleanup: move helper .c and .h files to test/helpers/ Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/13568) --- test/asynciotest.c | 2 +- test/build.info | 68 +++++++++---------- test/cmp_asn_test.c | 2 +- test/cmp_client_test.c | 2 +- test/cmp_ctx_test.c | 2 +- test/cmp_hdr_test.c | 2 +- test/cmp_msg_test.c | 2 +- test/cmp_protect_test.c | 2 +- test/cmp_server_test.c | 2 +- test/cmp_status_test.c | 2 +- test/cmp_vfy_test.c | 2 +- test/dtls_mtu_test.c | 2 +- test/dtlstest.c | 2 +- test/endecode_test.c | 2 +- test/evp_test.c | 4 +- test/evp_test.h | 11 --- test/fatalerrtest.c | 2 +- test/gosttest.c | 2 +- test/{ => helpers}/cmp_testlib.c | 0 test/{ => helpers}/cmp_testlib.h | 5 +- .../handshake.c} | 6 +- .../handshake.h} | 0 test/{pkcs12_helper.c => helpers/pkcs12.c} | 4 +- test/{pkcs12_helper.h => helpers/pkcs12.h} | 2 +- test/{ => helpers}/predefined_dhparams.c | 0 test/{ => helpers}/predefined_dhparams.h | 0 test/{ => helpers}/ssl_test_ctx.c | 2 +- test/{ => helpers}/ssl_test_ctx.h | 0 test/{ => helpers}/ssltestlib.c | 2 +- test/{ => helpers}/ssltestlib.h | 0 test/pkcs12_format_test.c | 2 +- test/recipes/80-test_ssl_old.t | 12 ++-- test/recordlentest.c | 2 +- test/servername_test.c | 2 +- test/{ssltest_old.c => ssl_old_test.c} | 2 +- test/ssl_test.c | 4 +- test/ssl_test_ctx_test.c | 2 +- test/sslapitest.c | 2 +- test/sslbuffertest.c | 2 +- test/sslcorrupttest.c | 2 +- test/testutil/{output_helpers.c => output.c} | 0 test/tls13ccstest.c | 2 +- 42 files changed, 79 insertions(+), 89 deletions(-) delete mode 100644 test/evp_test.h rename test/{ => helpers}/cmp_testlib.c (100%) rename test/{ => helpers}/cmp_testlib.h (95%) rename test/{handshake_helper.c => helpers/handshake.c} (99%) rename test/{handshake_helper.h => helpers/handshake.h} (100%) rename test/{pkcs12_helper.c => helpers/pkcs12.c} (99%) rename test/{pkcs12_helper.h => helpers/pkcs12.h} (99%) rename test/{ => helpers}/predefined_dhparams.c (100%) rename test/{ => helpers}/predefined_dhparams.h (100%) rename test/{ => helpers}/ssl_test_ctx.c (99%) rename test/{ => helpers}/ssl_test_ctx.h (100%) rename test/{ => helpers}/ssltestlib.c (99%) rename test/{ => helpers}/ssltestlib.h (100%) rename test/{ssltest_old.c => ssl_old_test.c} (99%) rename test/testutil/{output_helpers.c => output.c} (100%) diff --git a/test/asynciotest.c b/test/asynciotest.c index 4147ee128c..10c958f667 100644 --- a/test/asynciotest.c +++ b/test/asynciotest.c @@ -15,7 +15,7 @@ #include "internal/packet.h" -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" /* Should we fragment records or not? 0 = no, !0 = yes*/ diff --git a/test/build.info b/test/build.info index d781b10393..463e3cd262 100644 --- a/test/build.info +++ b/test/build.info @@ -18,7 +18,7 @@ $LIBAPPSSRC=../apps/lib/opt.c $AUXLIBAPPSSRC IF[{- !$disabled{tests} -}] LIBS{noinst,has_main}=libtestutil.a - SOURCE[libtestutil.a]=testutil/basic_output.c testutil/output_helpers.c \ + SOURCE[libtestutil.a]=testutil/basic_output.c testutil/output.c \ testutil/driver.c testutil/tests.c testutil/cb.c testutil/stanza.c \ testutil/format_output.c \ testutil/test_cleanup.c testutil/main.c testutil/testutil_init.c \ @@ -122,11 +122,11 @@ IF[{- !$disabled{tests} -}] INCLUDE[exptest]=../include ../apps/include DEPEND[exptest]=../libcrypto libtestutil.a - SOURCE[fatalerrtest]=fatalerrtest.c ssltestlib.c + SOURCE[fatalerrtest]=fatalerrtest.c helpers/ssltestlib.c INCLUDE[fatalerrtest]=../include ../apps/include DEPEND[fatalerrtest]=../libcrypto ../libssl libtestutil.a - SOURCE[tls13ccstest]=tls13ccstest.c ssltestlib.c + SOURCE[tls13ccstest]=tls13ccstest.c helpers/ssltestlib.c INCLUDE[tls13ccstest]=../include ../apps/include DEPEND[tls13ccstest]=../libcrypto ../libssl libtestutil.a @@ -242,7 +242,7 @@ IF[{- !$disabled{tests} -}] INCLUDE[memleaktest]=../include ../apps/include DEPEND[memleaktest]=../libcrypto libtestutil.a - SOURCE[pkcs12_format_test]=pkcs12_format_test.c pkcs12_helper.c + SOURCE[pkcs12_format_test]=pkcs12_format_test.c helpers/pkcs12.c INCLUDE[pkcs12_format_test]=../include ../apps/include DEPEND[pkcs12_format_test]=../libcrypto libtestutil.a @@ -274,11 +274,11 @@ IF[{- !$disabled{tests} -}] INCLUDE[d2i_test]=../include ../apps/include DEPEND[d2i_test]=../libcrypto libtestutil.a - SOURCE[ssl_test_ctx_test]=ssl_test_ctx_test.c ssl_test_ctx.c + SOURCE[ssl_test_ctx_test]=ssl_test_ctx_test.c helpers/ssl_test_ctx.c INCLUDE[ssl_test_ctx_test]=../include ../apps/include DEPEND[ssl_test_ctx_test]=../libcrypto ../libssl libtestutil.a - SOURCE[ssl_test]=ssl_test.c ssl_test_ctx.c handshake_helper.c + SOURCE[ssl_test]=ssl_test.c helpers/ssl_test_ctx.c helpers/handshake.c INCLUDE[ssl_test]=../include ../apps/include DEPEND[ssl_test]=../libcrypto ../libssl libtestutil.a @@ -286,17 +286,17 @@ IF[{- !$disabled{tests} -}] INCLUDE[cipherlist_test]=../include ../apps/include DEPEND[cipherlist_test]=../libcrypto ../libssl libtestutil.a - INCLUDE[ssl_test_ctx.o]=../include - INCLUDE[handshake_helper.o]=.. ../include - INCLUDE[pkcs12_helper.o]=.. ../include - INCLUDE[ssltestlib.o]=.. ../include - INCLUDE[cmp_testlib.o]=.. ../include ../apps/include + INCLUDE[helpers/ssl_test_ctx.o]=../include + INCLUDE[helpers/handshake.o]=.. ../include + INCLUDE[helpers/pkcs12.o]=.. ../include + INCLUDE[helpers/ssltestlib.o]=.. ../include + INCLUDE[helpers/cmp_testlib.o]=.. ../include ../apps/include SOURCE[x509aux]=x509aux.c INCLUDE[x509aux]=../include ../apps/include DEPEND[x509aux]=../libcrypto libtestutil.a - SOURCE[asynciotest]=asynciotest.c ssltestlib.c + SOURCE[asynciotest]=asynciotest.c helpers/ssltestlib.c INCLUDE[asynciotest]=../include ../apps/include DEPEND[asynciotest]=../libcrypto ../libssl libtestutil.a @@ -324,7 +324,7 @@ IF[{- !$disabled{tests} -}] INCLUDE[param_build_test]=../include ../apps/include DEPEND[param_build_test]=../libcrypto.a libtestutil.a - SOURCE[sslapitest]=sslapitest.c ssltestlib.c filterprov.c tls-provider.c + SOURCE[sslapitest]=sslapitest.c helpers/ssltestlib.c filterprov.c tls-provider.c INCLUDE[sslapitest]=../include ../apps/include .. DEPEND[sslapitest]=../libcrypto ../libssl libtestutil.a @@ -344,11 +344,11 @@ IF[{- !$disabled{tests} -}] INCLUDE[http_test]=../include ../apps/include DEPEND[http_test]=../libcrypto libtestutil.a - SOURCE[dtlstest]=dtlstest.c ssltestlib.c + SOURCE[dtlstest]=dtlstest.c helpers/ssltestlib.c INCLUDE[dtlstest]=../include ../apps/include DEPEND[dtlstest]=../libcrypto ../libssl libtestutil.a - SOURCE[sslcorrupttest]=sslcorrupttest.c ssltestlib.c + SOURCE[sslcorrupttest]=sslcorrupttest.c helpers/ssltestlib.c INCLUDE[sslcorrupttest]=../include ../apps/include DEPEND[sslcorrupttest]=../libcrypto ../libssl libtestutil.a @@ -376,7 +376,7 @@ IF[{- !$disabled{tests} -}] INCLUDE[x509_time_test]=../include ../apps/include DEPEND[x509_time_test]=../libcrypto libtestutil.a - SOURCE[recordlentest]=recordlentest.c ssltestlib.c + SOURCE[recordlentest]=recordlentest.c helpers/ssltestlib.c INCLUDE[recordlentest]=../include ../apps/include DEPEND[recordlentest]=../libcrypto ../libssl libtestutil.a @@ -412,7 +412,7 @@ IF[{- !$disabled{tests} -}] INCLUDE[http_test]=../include ../apps/include DEPEND[http_test]=../libcrypto libtestutil.a - SOURCE[servername_test]=servername_test.c ssltestlib.c + SOURCE[servername_test]=servername_test.c helpers/ssltestlib.c INCLUDE[servername_test]=../include ../apps/include DEPEND[servername_test]=../libcrypto ../libssl libtestutil.a @@ -425,7 +425,7 @@ IF[{- !$disabled{tests} -}] IF[{- !$disabled{psk} -}] PROGRAMS{noinst}=dtls_mtu_test - SOURCE[dtls_mtu_test]=dtls_mtu_test.c ssltestlib.c + SOURCE[dtls_mtu_test]=dtls_mtu_test.c helpers/ssltestlib.c INCLUDE[dtls_mtu_test]=.. ../include ../apps/include DEPEND[dtls_mtu_test]=../libcrypto ../libssl libtestutil.a ENDIF @@ -477,39 +477,39 @@ IF[{- !$disabled{tests} -}] cmp_server_test cmp_client_test ENDIF - SOURCE[cmp_asn_test]=cmp_asn_test.c cmp_testlib.c + SOURCE[cmp_asn_test]=cmp_asn_test.c helpers/cmp_testlib.c INCLUDE[cmp_asn_test]=.. ../include ../apps/include DEPEND[cmp_asn_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_ctx_test]=cmp_ctx_test.c cmp_testlib.c + SOURCE[cmp_ctx_test]=cmp_ctx_test.c helpers/cmp_testlib.c INCLUDE[cmp_ctx_test]=.. ../include ../apps/include DEPEND[cmp_ctx_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_hdr_test]=cmp_hdr_test.c cmp_testlib.c + SOURCE[cmp_hdr_test]=cmp_hdr_test.c helpers/cmp_testlib.c INCLUDE[cmp_hdr_test]=.. ../include ../apps/include DEPEND[cmp_hdr_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_status_test]=cmp_status_test.c cmp_testlib.c + SOURCE[cmp_status_test]=cmp_status_test.c helpers/cmp_testlib.c INCLUDE[cmp_status_test]=.. ../include ../apps/include DEPEND[cmp_status_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_protect_test]=cmp_protect_test.c cmp_testlib.c + SOURCE[cmp_protect_test]=cmp_protect_test.c helpers/cmp_testlib.c INCLUDE[cmp_protect_test]=.. ../include ../apps/include DEPEND[cmp_protect_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_msg_test]=cmp_msg_test.c cmp_testlib.c + SOURCE[cmp_msg_test]=cmp_msg_test.c helpers/cmp_testlib.c INCLUDE[cmp_msg_test]=.. ../include ../apps/include DEPEND[cmp_msg_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_vfy_test]=cmp_vfy_test.c cmp_testlib.c + SOURCE[cmp_vfy_test]=cmp_vfy_test.c helpers/cmp_testlib.c INCLUDE[cmp_vfy_test]=.. ../include ../apps/include DEPEND[cmp_vfy_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_server_test]=cmp_server_test.c cmp_testlib.c + SOURCE[cmp_server_test]=cmp_server_test.c helpers/cmp_testlib.c INCLUDE[cmp_server_test]=.. ../include ../apps/include DEPEND[cmp_server_test]=../libcrypto.a libtestutil.a - SOURCE[cmp_client_test]=cmp_client_test.c cmp_testlib.c ../apps/cmp_mock_srv.c + SOURCE[cmp_client_test]=cmp_client_test.c helpers/cmp_testlib.c ../apps/cmp_mock_srv.c INCLUDE[cmp_client_test]=.. ../include ../apps/include DEPEND[cmp_client_test]=../libcrypto.a libtestutil.a @@ -526,7 +526,7 @@ IF[{- !$disabled{tests} -}] rsa_sp800_56b_test bn_internal_test ecdsatest rsa_test \ rc2test rc4test rc5test hmactest ffc_internal_test \ asn1_dsa_internal_test dsatest dsa_no_digest_size_test \ - dhtest ssltest_old + dhtest ssl_old_test IF[{- !$disabled{poly1305} -}] PROGRAMS{noinst}=poly1305_internal_test @@ -700,9 +700,9 @@ IF[{- !$disabled{tests} -}] INCLUDE[mdc2_internal_test]=.. ../include ../apps/include DEPEND[mdc2_internal_test]=../libcrypto.a libtestutil.a - SOURCE[ssltest_old]=ssltest_old.c predefined_dhparams.c - INCLUDE[ssltest_old]=.. ../include ../apps/include - DEPEND[ssltest_old]=../libcrypto.a ../libssl.a + SOURCE[ssl_old_test]=ssl_old_test.c helpers/predefined_dhparams.c + INCLUDE[ssl_old_test]=.. ../include ../apps/include + DEPEND[ssl_old_test]=../libcrypto.a ../libssl.a ENDIF PROGRAMS{noinst}=asn1_time_test @@ -722,7 +722,7 @@ IF[{- !$disabled{tests} -}] DEPEND[tls13secretstest]=../libcrypto ../libssl libtestutil.a ENDIF - SOURCE[sslbuffertest]=sslbuffertest.c ssltestlib.c + SOURCE[sslbuffertest]=sslbuffertest.c helpers/ssltestlib.c INCLUDE[sslbuffertest]=../include ../apps/include DEPEND[sslbuffertest]=../libcrypto ../libssl libtestutil.a @@ -734,7 +734,7 @@ IF[{- !$disabled{tests} -}] INCLUDE[errtest]=../include ../apps/include DEPEND[errtest]=../libcrypto libtestutil.a - SOURCE[gosttest]=gosttest.c ssltestlib.c + SOURCE[gosttest]=gosttest.c helpers/ssltestlib.c INCLUDE[gosttest]=../include ../apps/include .. DEPEND[gosttest]=../libcrypto ../libssl libtestutil.a @@ -789,7 +789,7 @@ IF[{- !$disabled{tests} -}] DEPEND[hexstr_test]=../libcrypto.a libtestutil.a PROGRAMS{noinst}=endecode_test - SOURCE[endecode_test]=endecode_test.c predefined_dhparams.c + SOURCE[endecode_test]=endecode_test.c helpers/predefined_dhparams.c INCLUDE[endecode_test]=.. ../include ../apps/include DEPEND[endecode_test]=../libcrypto.a libtestutil.a diff --git a/test/cmp_asn_test.c b/test/cmp_asn_test.c index 10661b3ff0..33cc03cb4c 100644 --- a/test/cmp_asn_test.c +++ b/test/cmp_asn_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH]; diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c index dfb7dcb9f0..17f932a73a 100644 --- a/test/cmp_client_test.c +++ b/test/cmp_client_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" #include "apps/cmp_mock_srv.h" diff --git a/test/cmp_ctx_test.c b/test/cmp_ctx_test.c index 76c8c4613b..3ea3013abe 100644 --- a/test/cmp_ctx_test.c +++ b/test/cmp_ctx_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" #include diff --git a/test/cmp_hdr_test.c b/test/cmp_hdr_test.c index 75baefb7b9..17f38377b5 100644 --- a/test/cmp_hdr_test.c +++ b/test/cmp_hdr_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH]; diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c index 59b0a1777d..41ba5cf975 100644 --- a/test/cmp_msg_test.c +++ b/test/cmp_msg_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" static const char *newkey_f; static const char *server_cert_f; diff --git a/test/cmp_protect_test.c b/test/cmp_protect_test.c index 933adcb196..3cca30144d 100644 --- a/test/cmp_protect_test.c +++ b/test/cmp_protect_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" static const char *ir_protected_f; static const char *ir_unprotected_f; diff --git a/test/cmp_server_test.c b/test/cmp_server_test.c index 8d0e1de759..49108bfa17 100644 --- a/test/cmp_server_test.c +++ b/test/cmp_server_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" typedef struct test_fixture { const char *test_case_name; diff --git a/test/cmp_status_test.c b/test/cmp_status_test.c index 7358f1589f..6248cc9b32 100644 --- a/test/cmp_status_test.c +++ b/test/cmp_status_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" typedef struct test_fixture { const char *test_case_name; diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c index 2343ebe699..67112f6489 100644 --- a/test/cmp_vfy_test.c +++ b/test/cmp_vfy_test.c @@ -9,7 +9,7 @@ * https://www.openssl.org/source/license.html */ -#include "cmp_testlib.h" +#include "helpers/cmp_testlib.h" #include "../crypto/crmf/crmf_local.h" /* for manipulating POPO signature */ static const char *server_f; diff --git a/test/dtls_mtu_test.c b/test/dtls_mtu_test.c index 588ca32c79..612b76a3bc 100644 --- a/test/dtls_mtu_test.c +++ b/test/dtls_mtu_test.c @@ -14,7 +14,7 @@ #include #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" /* for SSL_READ_ETM() */ diff --git a/test/dtlstest.c b/test/dtlstest.c index 775ba22114..2d8aaf4709 100644 --- a/test/dtlstest.c +++ b/test/dtlstest.c @@ -13,7 +13,7 @@ #include #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" static char *cert = NULL; diff --git a/test/endecode_test.c b/test/endecode_test.c index e01cc4ddff..e8cdd611e6 100644 --- a/test/endecode_test.c +++ b/test/endecode_test.c @@ -22,7 +22,7 @@ #include "internal/cryptlib.h" /* ossl_assert */ #include "crypto/pem.h" /* For PVK and "blob" PEM headers */ -#include "predefined_dhparams.h" +#include "helpers/predefined_dhparams.h" #include "testutil.h" #ifndef OPENSSL_NO_EC diff --git a/test/evp_test.c b/test/evp_test.c index 9361845450..ba26108eb2 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -26,7 +26,9 @@ #include "internal/nelem.h" #include "crypto/evp.h" #include "testutil.h" -#include "evp_test.h" + +typedef struct evp_test_buffer_st EVP_TEST_BUFFER; +DEFINE_STACK_OF(EVP_TEST_BUFFER) #define AAD_NUM 4 diff --git a/test/evp_test.h b/test/evp_test.h deleted file mode 100644 index 028ca341ff..0000000000 --- a/test/evp_test.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -typedef struct evp_test_buffer_st EVP_TEST_BUFFER; -DEFINE_STACK_OF(EVP_TEST_BUFFER) diff --git a/test/fatalerrtest.c b/test/fatalerrtest.c index a2538c5921..30930d9ce8 100644 --- a/test/fatalerrtest.c +++ b/test/fatalerrtest.c @@ -9,7 +9,7 @@ #include #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" #include diff --git a/test/gosttest.c b/test/gosttest.c index b61e4efa49..84c5e6c501 100644 --- a/test/gosttest.c +++ b/test/gosttest.c @@ -7,7 +7,7 @@ * https://www.openssl.org/source/license.html */ -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" #include "internal/nelem.h" diff --git a/test/cmp_testlib.c b/test/helpers/cmp_testlib.c similarity index 100% rename from test/cmp_testlib.c rename to test/helpers/cmp_testlib.c diff --git a/test/cmp_testlib.h b/test/helpers/cmp_testlib.h similarity index 95% rename from test/cmp_testlib.h rename to test/helpers/cmp_testlib.h index e4361b198a..0bee099a67 100644 --- a/test/cmp_testlib.h +++ b/test/helpers/cmp_testlib.h @@ -17,9 +17,8 @@ # include # include "crypto/x509.h" /* for x509_set0_libctx() and x509_dup_ex() */ -# include "../crypto/cmp/cmp_local.h" - -# include "testutil.h" +# include "../../crypto/cmp/cmp_local.h" +# include "../testutil.h" # ifndef OPENSSL_NO_CMP # define CMP_TEST_REFVALUE_LENGTH 15 /* arbitrary value */ diff --git a/test/handshake_helper.c b/test/helpers/handshake.c similarity index 99% rename from test/handshake_helper.c rename to test/helpers/handshake.c index 5253f0d602..08fcd39bea 100644 --- a/test/handshake_helper.c +++ b/test/helpers/handshake.c @@ -16,11 +16,11 @@ #include #endif -#include "../ssl/ssl_local.h" +#include "../../ssl/ssl_local.h" #include "internal/sockets.h" #include "internal/nelem.h" -#include "handshake_helper.h" -#include "testutil.h" +#include "handshake.h" +#include "../testutil.h" #if !defined(OPENSSL_NO_SCTP) && !defined(OPENSSL_NO_SOCK) #include diff --git a/test/handshake_helper.h b/test/helpers/handshake.h similarity index 100% rename from test/handshake_helper.h rename to test/helpers/handshake.h diff --git a/test/pkcs12_helper.c b/test/helpers/pkcs12.c similarity index 99% rename from test/pkcs12_helper.c rename to test/helpers/pkcs12.c index dd64a2a716..6489609d25 100644 --- a/test/pkcs12_helper.c +++ b/test/helpers/pkcs12.c @@ -18,8 +18,8 @@ #include #include -#include "testutil.h" -#include "pkcs12_helper.h" +#include "../testutil.h" +#include "pkcs12.h" /* from the same directory */ /* Set this to > 0 write test data to file */ int write_files = 0; diff --git a/test/pkcs12_helper.h b/test/helpers/pkcs12.h similarity index 99% rename from test/pkcs12_helper.h rename to test/helpers/pkcs12.h index 8ae640d7f8..01e1cf1595 100644 --- a/test/pkcs12_helper.h +++ b/test/helpers/pkcs12.h @@ -18,7 +18,7 @@ #include #include -#include "testutil.h" +#include "../testutil.h" /* Set this to > 0 write test data to file */ extern int write_files; diff --git a/test/predefined_dhparams.c b/test/helpers/predefined_dhparams.c similarity index 100% rename from test/predefined_dhparams.c rename to test/helpers/predefined_dhparams.c diff --git a/test/predefined_dhparams.h b/test/helpers/predefined_dhparams.h similarity index 100% rename from test/predefined_dhparams.h rename to test/helpers/predefined_dhparams.h diff --git a/test/ssl_test_ctx.c b/test/helpers/ssl_test_ctx.c similarity index 99% rename from test/ssl_test_ctx.c rename to test/helpers/ssl_test_ctx.c index 5c3de4c436..db4752c54f 100644 --- a/test/ssl_test_ctx.c +++ b/test/helpers/ssl_test_ctx.c @@ -14,7 +14,7 @@ #include "internal/nelem.h" #include "ssl_test_ctx.h" -#include "testutil.h" +#include "../testutil.h" #ifdef OPENSSL_SYS_WINDOWS # define strcasecmp _stricmp diff --git a/test/ssl_test_ctx.h b/test/helpers/ssl_test_ctx.h similarity index 100% rename from test/ssl_test_ctx.h rename to test/helpers/ssl_test_ctx.h diff --git a/test/ssltestlib.c b/test/helpers/ssltestlib.c similarity index 99% rename from test/ssltestlib.c rename to test/helpers/ssltestlib.c index 1fbe51763b..2366c3db4d 100644 --- a/test/ssltestlib.c +++ b/test/helpers/ssltestlib.c @@ -12,7 +12,7 @@ #include "internal/nelem.h" #include "internal/cryptlib.h" /* for ossl_sleep() */ #include "ssltestlib.h" -#include "testutil.h" +#include "../testutil.h" #include "e_os.h" #ifdef OPENSSL_SYS_UNIX diff --git a/test/ssltestlib.h b/test/helpers/ssltestlib.h similarity index 100% rename from test/ssltestlib.h rename to test/helpers/ssltestlib.h diff --git a/test/pkcs12_format_test.c b/test/pkcs12_format_test.c index 4b638af82d..8b1448f19c 100644 --- a/test/pkcs12_format_test.c +++ b/test/pkcs12_format_test.c @@ -19,7 +19,7 @@ #include #include "testutil.h" -#include "pkcs12_helper.h" +#include "helpers/pkcs12.h" /* -------------------------------------------------------------------------- diff --git a/test/recipes/80-test_ssl_old.t b/test/recipes/80-test_ssl_old.t index aa2428559f..4e3c0998a2 100644 --- a/test/recipes/80-test_ssl_old.t +++ b/test/recipes/80-test_ssl_old.t @@ -75,7 +75,7 @@ my $P2intermediate="tmp_intP2.ss"; my $server_sess="server.ss"; my $client_sess="client.ss"; -# ssltest_old.c is deprecated in favour of the new framework in ssl_test.c +# ssl_old_test.c is deprecated in favour of the new framework in ssl_test.c # If you're adding tests here, you probably want to convert them to the # new format in ssl_test.c and add recipes to 80-test_ssl_new.t instead. plan tests => @@ -333,7 +333,7 @@ sub testssl { push @providerflags, "-provider", "legacy"; } - my @ssltest = ("ssltest_old", + my @ssltest = ("ssl_old_test", "-s_key", $key, "-s_cert", $cert, "-c_key", $key, "-c_cert", $cert, "-config", $configfile, @@ -438,7 +438,7 @@ sub testssl { } my @protocols = (); - # We only use the flags that ssltest_old understands + # We only use the flags that ssl_old_test understands push @protocols, "-tls1_3" unless $no_tls1_3; push @protocols, "-tls1_2" unless $no_tls1_2; push @protocols, "-tls1" unless $no_tls1 || $provider eq "fips"; @@ -482,7 +482,7 @@ sub testssl { foreach my $protocol (sort keys %ciphersuites) { note "Testing ciphersuites for $protocol"; - # ssltest_old doesn't know -tls1_3, but that's fine, since that's + # ssl_old_test doesn't know -tls1_3, but that's fine, since that's # the default choice if TLSv1.3 enabled my $flag = $protocol eq "-tls1_3" ? "" : $protocol; my $ciphersuites = ""; @@ -541,13 +541,13 @@ sub testssl { skip "skipping RSA tests", 2 if $no_rsa; - ok(run(test(["ssltest_old", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-no_dhe", "-no_ecdhe", "-num", "10", "-f", "-time"])), + ok(run(test(["ssl_old_test", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-no_dhe", "-no_ecdhe", "-num", "10", "-f", "-time"])), 'test tlsv1 with 1024bit RSA, no (EC)DHE, multiple handshakes'); skip "skipping RSA+DHE tests", 1 if $no_dh; - ok(run(test(["ssltest_old", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-dhe1024dsa", "-num", "10", "-f", "-time"])), + ok(run(test(["ssl_old_test", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-dhe1024dsa", "-num", "10", "-f", "-time"])), 'test tlsv1 with 1024bit RSA, 1024bit DHE, multiple handshakes'); } diff --git a/test/recordlentest.c b/test/recordlentest.c index cfd1a7cbf5..5388db7ddd 100644 --- a/test/recordlentest.c +++ b/test/recordlentest.c @@ -9,7 +9,7 @@ #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" static char *cert = NULL; diff --git a/test/servername_test.c b/test/servername_test.c index cf9cdd174a..14088211c9 100644 --- a/test/servername_test.c +++ b/test/servername_test.c @@ -22,7 +22,7 @@ #include "testutil.h" #include "internal/nelem.h" -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #define CLIENT_VERSION_LEN 2 diff --git a/test/ssltest_old.c b/test/ssl_old_test.c similarity index 99% rename from test/ssltest_old.c rename to test/ssl_old_test.c index 794d878675..54b1ca4236 100644 --- a/test/ssltest_old.c +++ b/test/ssl_old_test.c @@ -72,7 +72,7 @@ # include #endif -#include "predefined_dhparams.h" +#include "helpers/predefined_dhparams.h" static SSL_CTX *s_ctx = NULL; static SSL_CTX *s_ctx2 = NULL; diff --git a/test/ssl_test.c b/test/ssl_test.c index d902283edf..09141b2fed 100644 --- a/test/ssl_test.c +++ b/test/ssl_test.c @@ -15,8 +15,8 @@ #include #include -#include "handshake_helper.h" -#include "ssl_test_ctx.h" +#include "helpers/handshake.h" +#include "helpers/ssl_test_ctx.h" #include "testutil.h" static CONF *conf = NULL; diff --git a/test/ssl_test_ctx_test.c b/test/ssl_test_ctx_test.c index 91f418095f..7579b4b12a 100644 --- a/test/ssl_test_ctx_test.c +++ b/test/ssl_test_ctx_test.c @@ -16,7 +16,7 @@ #include #include "internal/nelem.h" -#include "ssl_test_ctx.h" +#include "helpers/ssl_test_ctx.h" #include "testutil.h" #include #include diff --git a/test/sslapitest.c b/test/sslapitest.c index 19421947de..158295c034 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -32,7 +32,7 @@ #include #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" #include "testutil/output.h" #include "internal/nelem.h" diff --git a/test/sslbuffertest.c b/test/sslbuffertest.c index 3d034d6041..3c3e69d61d 100644 --- a/test/sslbuffertest.c +++ b/test/sslbuffertest.c @@ -15,7 +15,7 @@ #include "internal/packet.h" -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" struct async_ctrs { diff --git a/test/sslcorrupttest.c b/test/sslcorrupttest.c index 97d235c8ad..d270d42351 100644 --- a/test/sslcorrupttest.c +++ b/test/sslcorrupttest.c @@ -8,7 +8,7 @@ */ #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" static int docorrupt = 0; diff --git a/test/testutil/output_helpers.c b/test/testutil/output.c similarity index 100% rename from test/testutil/output_helpers.c rename to test/testutil/output.c diff --git a/test/tls13ccstest.c b/test/tls13ccstest.c index 3a81ceba22..3a3fa8c22a 100644 --- a/test/tls13ccstest.c +++ b/test/tls13ccstest.c @@ -9,7 +9,7 @@ #include #include -#include "ssltestlib.h" +#include "helpers/ssltestlib.h" #include "testutil.h" #include "internal/packet.h" -- 2.39.2