Welcome to ftp.nluug.nl Current directory: /pub/os/BSD/NetBSD/NetBSD-current/src/crypto/external/bsd/openssl.old/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/ 19-Apr-2023 05:02 - certs/ 19-Apr-2023 05:00 - ct/ 19-Apr-2023 05:00 - d2i-tests/ 19-Apr-2023 05:00 - ocsp-tests/ 19-Apr-2023 05:00 - ossl_shim/ 19-Apr-2023 05:00 - recipes/ 19-Apr-2023 05:00 - smime-certs/ 19-Apr-2023 05:00 - ssl-tests/ 19-Apr-2023 05:00 - testutil/ 19-Apr-2023 05:00 - CAss.cnf 19-Apr-2023 05:00 2.2K CAssdh.cnf 03-Feb-2018 23:43 728 CAssdsa.cnf 03-Feb-2018 23:43 729 CAssrsa.cnf 03-Feb-2018 23:43 708 CAtsa.cnf 19-Apr-2023 05:00 4.9K P1ss.cnf 19-Apr-2023 05:00 1.0K P2ss.cnf 19-Apr-2023 05:00 1.1K README 18-Apr-2023 16:19 4.4K README.external 18-Apr-2023 16:19 4.6K README.ssltest.md 18-Apr-2023 16:19 10K Sssdsa.cnf 03-Feb-2018 23:43 821 Sssrsa.cnf 03-Feb-2018 23:43 798 Uss.cnf 19-Apr-2023 05:00 1.0K aborttest.c 18-Apr-2023 16:19 464 afalgtest.c 18-Apr-2023 16:19 4.2K asn1_decode_test.c 18-Apr-2023 16:19 6.3K asn1_encode_test.c 18-Apr-2023 16:19 30K asn1_internal_test.c 18-Apr-2023 16:19 3.7K asn1_string_table_test.c 18-Apr-2023 16:19 1.9K asn1_time_test.c 18-Apr-2023 16:19 16K asynciotest.c 18-Apr-2023 16:19 12K asynctest.c 18-Apr-2023 16:19 8.7K bad_dtls_test.c 18-Apr-2023 16:19 19K bftest.c 18-Apr-2023 16:19 15K bio_callback_test.c 18-Apr-2023 16:19 6.4K bio_enc_test.c 18-Apr-2023 16:19 6.7K bio_memleak_test.c 18-Apr-2023 16:19 7.5K bioprinttest.c 18-Apr-2023 16:19 11K bntest.c 18-Apr-2023 16:19 92K bntests.pl 18-Apr-2023 16:19 4.5K build.info 18-Apr-2023 16:19 20K casttest.c 18-Apr-2023 16:19 3.1K chacha_internal_test.c 18-Apr-2023 16:19 8.0K cipher_overhead_test.c 18-Apr-2023 16:19 1.1K cipherbytes_test.c 18-Apr-2023 16:19 4.4K cipherlist_test.c 18-Apr-2023 16:19 7.1K ciphername_test.c 18-Apr-2023 16:19 21K clienthellotest.c 18-Apr-2023 16:19 8.3K cmactest.c 18-Apr-2023 16:19 5.9K cms-examples.pl 19-Apr-2023 05:00 8.7K cmsapitest.c 18-Apr-2023 16:19 2.2K conf_include_test.c 18-Apr-2023 16:19 5.4K constant_time_test.c 18-Apr-2023 16:19 12K crltest.c 18-Apr-2023 16:19 15K ct_test.c 18-Apr-2023 16:19 16K ctype_internal_test.c 18-Apr-2023 16:19 2.6K curve448_internal_test.c 18-Apr-2023 16:19 35K d2i_test.c 18-Apr-2023 16:19 4.0K dane-cross.in 18-Apr-2023 16:19 6.9K danetest.c 18-Apr-2023 16:19 11K danetest.in 18-Apr-2023 16:19 88K danetest.pem 18-Apr-2023 16:19 652 data.bin 18-Apr-2023 16:19 128 destest.c 18-Apr-2023 16:19 25K dhtest.c 18-Apr-2023 16:19 27K drbg_cavs_data.c 18-Apr-2023 16:19 7.9M drbg_cavs_data.h 18-Apr-2023 16:19 1.8K drbg_cavs_test.c 18-Apr-2023 16:19 7.5K drbgtest.c 18-Apr-2023 16:19 30K drbgtest.h 18-Apr-2023 16:19 26K dsa_no_digest_size_test.c 18-Apr-2023 16:19 8.4K dsatest.c 18-Apr-2023 16:19 3.7K dtls_mtu_test.c 18-Apr-2023 16:19 7.1K dtlstest.c 18-Apr-2023 16:19 13K dtlsv1listentest.c 18-Apr-2023 16:19 12K ec_internal_test.c 18-Apr-2023 16:19 12K ecdsatest.c 18-Apr-2023 16:19 11K ecdsatest.h 18-Apr-2023 16:19 674K ecstresstest.c 18-Apr-2023 16:19 3.9K ectest.c 18-Apr-2023 16:19 91K enginetest.c 18-Apr-2023 16:19 11K errtest.c 18-Apr-2023 16:19 941 evp_extra_test.c 18-Apr-2023 16:19 71K evp_test.c 18-Apr-2023 16:19 73K evp_test.h 18-Apr-2023 16:19 413 exdatatest.c 18-Apr-2023 16:19 6.7K exptest.c 18-Apr-2023 16:19 6.1K fatalerrtest.c 18-Apr-2023 16:19 2.7K generate_buildtest.pl 18-Apr-2023 16:19 793 generate_ssl_tests.pl 18-Apr-2023 16:19 4.4K gmdifftest.c 18-Apr-2023 16:19 1.8K gosttest.c 18-Apr-2023 16:19 3.1K handshake_helper.c 18-Apr-2023 16:19 60K handshake_helper.h 18-Apr-2023 16:19 2.9K hmactest.c 18-Apr-2023 16:19 7.2K ideatest.c 18-Apr-2023 16:19 3.7K igetest.c 19-Apr-2023 05:00 16K lhash_test.c 18-Apr-2023 16:19 5.5K md2test.c 18-Apr-2023 16:19 1.6K mdc2_internal_test.c 18-Apr-2023 16:19 1.6K mdc2test.c 18-Apr-2023 16:19 2.0K memleaktest.c 18-Apr-2023 16:19 1.6K modes_internal_test.c 18-Apr-2023 16:19 29K ocspapitest.c 18-Apr-2023 16:19 5.9K packettest.c 18-Apr-2023 16:19 15K pbelutest.c 18-Apr-2023 16:19 1.4K pemtest.c 18-Apr-2023 16:19 3.4K pkcs7-1.pem 03-Feb-2018 23:43 851 pkcs7.pem 03-Feb-2018 23:43 3.7K pkey_meth_kdf_test.c 18-Apr-2023 16:19 5.2K pkey_meth_test.c 18-Apr-2023 16:19 2.2K pkits-test.pl 19-Apr-2023 05:00 31K poly1305_internal_test.c 18-Apr-2023 16:19 56K rc2test.c 18-Apr-2023 16:19 2.0K rc4test.c 18-Apr-2023 16:19 3.9K rc5test.c 18-Apr-2023 16:19 8.8K rdrand_sanitytest.c 18-Apr-2023 16:19 3.4K recordlentest.c 18-Apr-2023 16:19 5.1K rsa_complex.c 18-Apr-2023 16:19 787 rsa_mp_test.c 18-Apr-2023 16:19 9.5K rsa_test.c 18-Apr-2023 16:19 13K run_tests.pl 18-Apr-2023 16:19 4.0K sanitytest.c 18-Apr-2023 16:19 3.0K secmemtest.c 18-Apr-2023 16:19 5.9K serverinfo.pem 03-Feb-2018 23:43 740 serverinfo2.pem 18-Apr-2023 16:19 412 servername_test.c 18-Apr-2023 16:19 6.7K session.pem 18-Apr-2023 16:19 1.9K shibboleth.pfx 18-Apr-2023 16:19 2.5K shlibloadtest.c 18-Apr-2023 16:19 9.1K siphash_internal_test.c 18-Apr-2023 16:19 17K sm2_internal_test.c 18-Apr-2023 16:19 13K sm4_internal_test.c 18-Apr-2023 16:19 2.3K smcont.txt 19-Apr-2023 05:00 83 srptest.c 18-Apr-2023 16:19 8.0K ssl_cert_table_internal_test.c 18-Apr-2023 16:19 2.3K ssl_ctx_test.c 18-Apr-2023 16:19 2.3K ssl_test.c 18-Apr-2023 16:19 18K ssl_test.tmpl 18-Apr-2023 16:19 4.3K ssl_test_ctx.c 18-Apr-2023 16:19 29K ssl_test_ctx.h 18-Apr-2023 16:19 8.5K ssl_test_ctx_test.c 18-Apr-2023 16:19 9.0K ssl_test_ctx_test.conf 18-Apr-2023 16:19 2.0K sslapitest.c 18-Apr-2023 16:19 249K sslbuffertest.c 18-Apr-2023 16:19 5.2K sslcorrupttest.c 18-Apr-2023 16:19 7.0K ssltest_old.c 18-Apr-2023 16:19 103K ssltestlib.c 19-Apr-2023 05:00 29K ssltestlib.h 19-Apr-2023 05:00 2.0K stack_test.c 18-Apr-2023 16:19 9.2K sysdefault.cnf 18-Apr-2023 16:19 241 sysdefaulttest.c 18-Apr-2023 16:19 1.1K test.cnf 19-Apr-2023 05:00 2.6K test_test.c 18-Apr-2023 16:19 18K testcrl.pem 03-Feb-2018 23:43 938 testdsa.pem 18-Apr-2023 16:19 672 testdsapub.pem 18-Apr-2023 16:19 654 testec-p256.pem 18-Apr-2023 16:19 227 testecpub-p256.pem 18-Apr-2023 16:19 178 tested448.pem 18-Apr-2023 16:19 156 tested448pub.pem 18-Apr-2023 16:19 146 tested25519.pem 18-Apr-2023 16:19 119 tested25519pub.pem 18-Apr-2023 16:19 113 testp7.pem 03-Feb-2018 23:43 2.8K testreq2.pem 03-Feb-2018 23:43 371 testrsa.pem 03-Feb-2018 23:43 497 testrsa_withattrs.der 18-Apr-2023 16:19 1.2K testrsa_withattrs.pem 18-Apr-2023 16:19 1.7K testrsapub.pem 18-Apr-2023 16:19 182 testsid.pem 19-Apr-2023 05:00 2.3K testutil.h 19-Apr-2023 05:00 19K testx509.pem 03-Feb-2018 23:43 530 threadstest.c 18-Apr-2023 16:19 3.9K time_offset_test.c 18-Apr-2023 16:19 3.2K tls13ccstest.c 18-Apr-2023 16:19 15K tls13encryptiontest.c 18-Apr-2023 16:19 14K tls13secretstest.c 18-Apr-2023 16:19 11K uitest.c 18-Apr-2023 16:19 2.3K v3-cert1.pem 03-Feb-2018 23:43 944 v3-cert2.pem 03-Feb-2018 23:43 940 v3ext.c 18-Apr-2023 16:19 11K v3nametest.c 18-Apr-2023 16:19 20K verify_extra_test.c 18-Apr-2023 16:19 8.6K versions.c 18-Apr-2023 16:19 645 wpackettest.c 18-Apr-2023 16:19 15K x509_check_cert_pkey_test.c 18-Apr-2023 16:19 3.0K x509_dup_cert_test.c 18-Apr-2023 16:19 1.3K x509_internal_test.c 18-Apr-2023 16:19 3.1K x509_time_test.c 18-Apr-2023 16:19 14K x509aux.c 18-Apr-2023 16:19 5.1K
NLUUG - Open Systems. Open Standards
Become a member
and get discounts on conferences and more, see the NLUUG website!