Welcome to ftp.nluug.nl Current directory: /ftp/pub/NetBSD/NetBSD-release-9/src/crypto/external/bsd/openssl/dist/test/ |
|
Contents of README:How to add recipes ================== For any test that you want to perform, you write a script located in test/recipes/, named {nn}-test_{name}.t, where {nn} is a two digit number and {name} is a unique name of your choice. Please note that if a test involves a new testing executable, you will need to do some additions in test/Makefile. More on this later. Naming conventions ================= A test executable is named test/{name}test.c A test recipe is named test/recipes/{nn}-test_{name}.t, where {nn} is a two digit number and {name} is a unique name of your choice. The number {nn} is (somewhat loosely) grouped as follows: 00-04 sanity, internal and essential API tests 05-09 individual symmetric cipher algorithms 10-14 math (bignum) 15-19 individual asymmetric cipher algorithms 20-24 openssl commands (some otherwise not tested) 25-29 certificate forms, generation and verification 30-35 engine and evp 60-79 APIs 70 PACKET layer 80-89 "larger" protocols (CA, CMS, OCSP, SSL, TSA) 90-98 misc 99 most time consuming tests [such as test_fuzz] A recipe that just runs a test executable ========================================= A script that just runs a program looks like this: #! /usr/bin/perl use OpenSSL::Test::Simple; simple_test("test_{name}", "{name}test", "{name}"); {name} is the unique name you have chosen for your test. The second argument to `simple_test' is the test executable, and `simple_test' expects it to be located in test/ For documentation on OpenSSL::Test::Simple, do `perldoc util/perl/OpenSSL/Test/Simple.pm'. A recipe that runs a more complex test ====================================== For more complex tests, you will need to read up on Test::More and OpenSSL::Test. Test::More is normally preinstalled, do `man Test::More' for documentation. For OpenSSL::Test, do `perldoc util/perl/OpenSSL/Test.pm'. A script to start from could be this: #! /usr/bin/perl use strict; use warnings; use OpenSSL::Test; setup("test_{name}"); plan tests => 2; # The number of tests being performed ok(test1, "test1"); ok(test2, "test1"); sub test1 { # test feature 1 } sub test2 { # test feature 2 } Changes to test/build.info ========================== Whenever a new test involves a new test executable you need to do the following (at all times, replace {NAME} and {name} with the name of your test): * add {name} to the list of programs under PROGRAMS_NO_INST * create a three line description of how to build the test, you will have to modify the include paths and source files if you don't want to use the basic test framework: SOURCE[{name}]={name}.c INCLUDE[{name}]=.. ../include DEPEND[{name}]=../libcrypto libtestutil.a Generic form of C test executables ================================== #include "testutil.h" static int my_test(void) { int testresult = 0; /* Assume the test will fail */ int observed; observed = function(); /* Call the code under test */ if (!TEST_int_eq(observed, 2)) /* Check the result is correct */ goto end; /* Exit on failure - optional */ testresult = 1; /* Mark the test case a success */ end: cleanup(); /* Any cleanup you require */ return testresult; } int setup_tests(void) { ADD_TEST(my_test); /* Add each test separately */ return 1; /* Indicate success */ } You should use the TEST_xxx macros provided by testutil.h to test all failure conditions. These macros produce an error message in a standard format if the condition is not met (and nothing if the condition is met). Additional information can be presented with the TEST_info macro that takes a printf format string and arguments. TEST_error is useful for complicated conditions, it also takes a printf format string and argument. In all cases the TEST_xxx macros are guaranteed to evaluate their arguments exactly once. This means that expressions with side effects are allowed as parameters. Thus, if (!TEST_ptr(ptr = OPENSSL_malloc(..))) works fine and can be used in place of: ptr = OPENSSL_malloc(..); if (!TEST_ptr(ptr)) The former produces a more meaningful message on failure than the latter. |
Name Last modified Size
Parent Directory - CVS/ 02-Dec-2024 04:04 - certs/ 14-Feb-2024 19:44 - ct/ 14-Feb-2024 19:44 - d2i-tests/ 14-Feb-2024 19:44 - ocsp-tests/ 14-Feb-2024 19:44 - ossl_shim/ 14-Feb-2024 19:44 - recipes/ 02-Dec-2024 04:04 - smime-certs/ 14-Feb-2024 19:44 - ssl-tests/ 14-Feb-2024 19:44 - testutil/ 14-Feb-2024 19:44 - CAss.cnf 08-Feb-2018 21:56 2.2K CAssdh.cnf 20-Jul-2009 01:06 728 CAssdsa.cnf 20-Jul-2009 01:06 729 CAssrsa.cnf 20-Jul-2009 01:06 708 CAtsa.cnf 23-Sep-2018 15:17 4.9K P1ss.cnf 08-Feb-2018 21:56 1.0K P2ss.cnf 08-Feb-2018 21:56 1.1K README 27-Apr-2020 16:47 4.4K README.external 12-Mar-2019 17:44 4.6K README.ssltest.md 23-Sep-2018 15:17 10K Sssdsa.cnf 20-Jul-2009 01:06 821 Sssrsa.cnf 20-Jul-2009 01:06 798 Uss.cnf 08-Feb-2018 21:56 1.0K aborttest.c 08-Feb-2018 21:56 464 afalgtest.c 24-Feb-2023 15:07 4.2K asn1_decode_test.c 24-Feb-2023 15:07 6.3K asn1_encode_test.c 27-Mar-2021 15:35 30K asn1_internal_test.c 24-Feb-2023 15:07 3.7K asn1_string_table_test.c 23-Sep-2018 15:17 1.9K asn1_time_test.c 27-Jan-2020 08:21 16K asynciotest.c 27-Apr-2020 16:47 12K asynctest.c 23-Sep-2018 15:17 8.7K bad_dtls_test.c 27-Apr-2020 16:47 19K bftest.c 23-Sep-2018 15:33 15K bio_callback_test.c 08-Dec-2018 23:33 6.4K bio_enc_test.c 23-Sep-2018 15:17 6.7K bio_memleak_test.c 24-Feb-2023 15:07 7.5K bioprinttest.c 27-Mar-2021 15:35 11K bntest.c 24-Feb-2023 15:07 92K bntests.pl 23-Sep-2018 15:17 4.5K build.info 24-Feb-2023 15:07 20K casttest.c 23-Sep-2018 15:33 3.1K chacha_internal_test.c 27-Apr-2020 16:47 8.0K cipher_overhead_test.c 27-Apr-2020 16:47 1.1K cipherbytes_test.c 23-Sep-2018 15:17 4.4K cipherlist_test.c 12-Mar-2019 17:44 7.1K ciphername_test.c 23-Sep-2018 15:17 21K clienthellotest.c 24-Feb-2023 15:07 8.3K cmactest.c 27-Mar-2021 15:35 5.9K cms-examples.pl 08-Feb-2018 21:56 8.7K cmsapitest.c 23-Sep-2018 15:17 2.2K conf_include_test.c 27-Jan-2020 08:21 5.4K constant_time_test.c 27-Apr-2020 16:47 12K crltest.c 12-Mar-2019 17:44 15K ct_test.c 24-Feb-2023 15:07 16K ctype_internal_test.c 27-Apr-2020 16:47 2.6K curve448_internal_test.c 27-Apr-2020 16:47 35K d2i_test.c 23-Sep-2018 15:17 4.0K dane-cross.in 24-Feb-2023 15:07 6.9K danetest.c 24-Feb-2023 15:07 11K danetest.in 08-Feb-2018 21:56 88K danetest.pem 08-Feb-2018 21:56 652 data.bin 24-Feb-2023 15:07 128 destest.c 23-Sep-2018 15:33 25K dhtest.c 27-Jan-2020 08:21 27K drbg_cavs_data.c 23-Sep-2018 15:17 7.9M drbg_cavs_data.h 27-Apr-2020 16:47 1.8K drbg_cavs_test.c 27-Apr-2020 16:47 7.5K drbgtest.c 27-Mar-2021 15:35 30K drbgtest.h 23-Sep-2018 15:17 26K dsa_no_digest_size_test.c 23-Sep-2018 15:17 8.4K dsatest.c 23-Sep-2018 15:33 3.7K dtls_mtu_test.c 24-Feb-2023 15:07 7.1K dtlstest.c 24-Feb-2023 15:07 13K dtlsv1listentest.c 23-Sep-2018 15:17 12K ec_internal_test.c 24-Feb-2023 15:07 12K ecdsatest.c 09-Jun-2019 20:44 11K ecdsatest.h 27-Apr-2020 16:47 674K ecstresstest.c 23-Sep-2018 15:17 3.9K ectest.c 24-Feb-2023 15:07 91K enginetest.c 27-Jan-2020 08:21 11K errtest.c 23-Sep-2018 15:17 941 evp_extra_test.c 24-Feb-2023 15:07 71K evp_test.c 24-Feb-2023 15:07 73K evp_test.h 23-Sep-2018 15:17 413 exdatatest.c 23-Sep-2018 15:17 6.7K exptest.c 24-Feb-2023 15:07 6.1K fatalerrtest.c 23-Sep-2018 15:17 2.7K generate_buildtest.pl 23-Sep-2018 15:17 793 generate_ssl_tests.pl 07-Apr-2018 00:49 4.4K gmdifftest.c 23-Sep-2018 15:17 1.8K gosttest.c 23-Sep-2018 15:17 3.1K handshake_helper.c 27-Mar-2021 15:35 60K handshake_helper.h 27-Apr-2020 16:47 2.9K hmactest.c 27-Apr-2020 16:47 7.2K ideatest.c 23-Sep-2018 15:33 3.7K igetest.c 23-Sep-2018 15:17 16K lhash_test.c 23-Sep-2018 15:17 5.5K md2test.c 23-Sep-2018 15:33 1.6K mdc2_internal_test.c 23-Sep-2018 15:17 1.6K mdc2test.c 23-Sep-2018 15:33 2.0K memleaktest.c 23-Sep-2018 15:17 1.6K modes_internal_test.c 27-Apr-2020 16:47 29K ocspapitest.c 09-Jun-2019 19:47 5.9K packettest.c 24-Feb-2023 15:07 15K pbelutest.c 23-Sep-2018 15:17 1.4K pemtest.c 24-Feb-2023 15:07 3.4K pkcs7-1.pem 20-Jul-2009 01:06 851 pkcs7.pem 20-Jul-2009 01:06 3.7K pkey_meth_kdf_test.c 23-Sep-2018 15:17 5.2K pkey_meth_test.c 23-Sep-2018 15:17 2.2K pkits-test.pl 23-Sep-2018 15:17 31K poly1305_internal_test.c 27-Apr-2020 16:47 56K rc2test.c 23-Sep-2018 15:33 2.0K rc4test.c 23-Sep-2018 15:33 3.9K rc5test.c 23-Sep-2018 15:33 8.8K rdrand_sanitytest.c 12-Mar-2019 17:44 3.4K recordlentest.c 23-Sep-2018 15:17 5.1K rsa_complex.c 08-Dec-2018 23:33 787 rsa_mp_test.c 23-Sep-2018 15:17 9.5K rsa_test.c 24-Feb-2023 15:07 13K run_tests.pl 27-Apr-2020 16:47 4.0K sanitytest.c 23-Sep-2018 15:17 3.0K secmemtest.c 08-Dec-2018 23:33 5.9K serverinfo.pem 14-Oct-2016 18:06 740 serverinfo2.pem 23-Sep-2018 15:17 412 servername_test.c 27-Apr-2020 16:47 6.7K session.pem 23-Sep-2018 15:17 1.9K shibboleth.pfx 08-Feb-2018 21:56 2.5K shlibloadtest.c 27-Apr-2020 16:47 9.1K siphash_internal_test.c 27-Apr-2020 16:47 17K sm2_internal_test.c 24-Feb-2023 15:07 13K sm4_internal_test.c 27-Apr-2020 16:47 2.3K smcont.txt 08-Feb-2018 21:56 83 srptest.c 23-Sep-2018 15:33 8.0K ssl_cert_table_internal_test.c 27-Apr-2020 16:47 2.3K ssl_ctx_test.c 27-Apr-2020 16:47 2.3K ssl_test.c 23-Sep-2018 15:17 18K ssl_test.tmpl 08-Feb-2018 21:56 4.3K ssl_test_ctx.c 12-Mar-2019 17:44 29K ssl_test_ctx.h 27-Apr-2020 16:47 8.5K ssl_test_ctx_test.c 23-Sep-2018 15:17 9.0K ssl_test_ctx_test.conf 23-Sep-2018 15:17 2.0K sslapitest.c 24-Feb-2023 15:07 249K sslbuffertest.c 27-Apr-2020 16:47 5.2K sslcorrupttest.c 23-Sep-2018 15:17 7.0K ssltest_old.c 24-Feb-2023 15:07 103K ssltestlib.c 24-Feb-2023 15:07 29K ssltestlib.h 24-Feb-2023 15:07 2.0K stack_test.c 23-Sep-2018 15:17 9.2K sysdefault.cnf 23-Sep-2018 15:17 241 sysdefaulttest.c 23-Sep-2018 15:17 1.1K test.cnf 08-Feb-2018 21:56 2.6K test_test.c 24-Feb-2023 15:07 18K testcrl.pem 20-Jul-2009 01:06 938 testdsa.pem 08-Feb-2018 21:56 672 testdsapub.pem 08-Feb-2018 21:56 654 testec-p256.pem 08-Feb-2018 21:56 227 testecpub-p256.pem 08-Feb-2018 21:56 178 tested448.pem 27-Mar-2021 15:35 156 tested448pub.pem 27-Mar-2021 15:35 146 tested25519.pem 27-Mar-2021 15:35 119 tested25519pub.pem 27-Mar-2021 15:35 113 testp7.pem 20-Jul-2009 01:06 2.8K testreq2.pem 20-Jul-2009 01:06 371 testrsa.pem 20-Jul-2009 01:06 497 testrsa_withattrs.der 24-Feb-2023 15:07 1.2K testrsa_withattrs.pem 24-Feb-2023 15:07 1.7K testrsapub.pem 08-Feb-2018 21:56 182 testsid.pem 08-Feb-2018 21:56 2.3K testutil.h 27-Apr-2020 16:47 19K testx509.pem 20-Jul-2009 01:06 530 threadstest.c 23-Sep-2018 15:17 3.9K time_offset_test.c 23-Sep-2018 15:17 3.2K tls13ccstest.c 27-Apr-2020 16:47 15K tls13encryptiontest.c 27-Mar-2021 15:35 14K tls13secretstest.c 27-Apr-2020 16:47 11K uitest.c 23-Sep-2018 15:17 2.3K v3-cert1.pem 20-Jul-2009 01:06 944 v3-cert2.pem 20-Jul-2009 01:06 940 v3ext.c 24-Feb-2023 15:07 11K v3nametest.c 24-Feb-2023 15:07 20K verify_extra_test.c 24-Feb-2023 15:07 8.6K versions.c 18-Aug-2018 10:30 645 wpackettest.c 27-Apr-2020 16:47 15K x509_check_cert_pkey_test.c 23-Sep-2018 15:17 3.0K x509_dup_cert_test.c 23-Sep-2018 15:17 1.3K x509_internal_test.c 24-Feb-2023 15:07 3.1K x509_time_test.c 24-Feb-2023 15:07 14K x509aux.c 27-Mar-2021 15:35 5.1K
NLUUG - Open Systems. Open Standards
Become a member
and get discounts on conferences and more, see the NLUUG website!