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