Todd Short b1ceb439f2 Add RFC5297 AES-SIV support 7 år sedan
..
certs 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ct 8c6afbc55c Verify SCT signatures 8 år sedan
d2i-tests a378a46985 add test for CVE-2016-7053 7 år sedan
ocsp-tests 121738d1cb Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL 6 år sedan
ossl_shim 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
recipes b1ceb439f2 Add RFC5297 AES-SIV support 5 år sedan
smime-certs 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl-tests 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
testutil ec91206fbe Add a format attribute to the format functions and fix the broken format 5 år sedan
CAss.cnf a7be5759cf RT3809: basicConstraints is critical 8 år sedan
CAssdh.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 25 år sedan
CAssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 25 år sedan
CAssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 25 år sedan
CAtsa.cnf f0ef20bf38 Added support for ESSCertIDv2 7 år sedan
P1ss.cnf fec669388c Use 2K RSA and SHA256 in tests 9 år sedan
P2ss.cnf fec669388c Use 2K RSA and SHA256 in tests 9 år sedan
README f90486f4de Fix test documentation. 6 år sedan
README.external 46f4e1bec5 Many spelling fixes/typo's corrected. 6 år sedan
README.ssltest.md a84e5c9aa8 Session resume broken switching contexts 6 år sedan
Sssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 25 år sedan
Sssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 25 år sedan
Uss.cnf cb0585c2cb Create DSA and ECDSA certificates. 8 år sedan
aborttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
afalgtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
asn1_decode_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
asn1_encode_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
asn1_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
asn1_string_table_test.c 275a7b9e5e typo ANS1 -> ASN1 5 år sedan
asn1_time_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
asynciotest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
asynctest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bad_dtls_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bftest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bio_callback_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bio_enc_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bioprinttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bntest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
bntests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
build.info 1c615e4ce9 Test: link drbgtest statically against libcrypto 5 år sedan
casttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
chacha_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
cipher_overhead_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
cipherbytes_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
cipherlist_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ciphername_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
clienthellotest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
cms-examples.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
cmsapitest.c e15e92dbd5 Add a CMS API test 6 år sedan
conf_include_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
constant_time_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
crltest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ct_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ctype_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
curve448_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
d2i_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
danetest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
danetest.in 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
danetest.pem 170b735820 DANE support for X509_verify_cert() 8 år sedan
destest.c 4b6ae3c3c2 add missing const 5 år sedan
dhtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbg_cavs_data.h 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbg_cavs_data_ctr.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbg_cavs_data_hash.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbg_cavs_data_hmac.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbg_cavs_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbgtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
drbgtest.h 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
dsa_no_digest_size_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
dsatest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
dtls_mtu_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
dtlstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
dtlsv1listentest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ecdsatest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ecstresstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ectest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
enginetest.c 1057c2c39f Cleaner disposal of ephemeral engine ids and names 5 år sedan
errtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
evp_extra_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
evp_test.c b1ceb439f2 Add RFC5297 AES-SIV support 5 år sedan
evp_test.h 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
exdatatest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
exptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
fatalerrtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
generate_buildtest.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
generate_ssl_tests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
gmdifftest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
gosttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
handshake_helper.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
handshake_helper.h 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
hmactest.c 1057c2c39f Cleaner disposal of ephemeral engine ids and names 5 år sedan
ideatest.c 9b34028187 Eliminate NOP cast 5 år sedan
igetest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
lhash_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
md2test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
mdc2_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
mdc2test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
memleaktest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
modes_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ocspapitest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
packettest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
pbelutest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
pemtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
pkey_meth_kdf_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
pkey_meth_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
pkits-test.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
poly1305_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rc2test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rc4test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rc5test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rdrand_sanitytest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
recordlentest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rsa_complex.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rsa_mp_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
rsa_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
run_tests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
sanitytest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
secmemtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... 10 år sedan
serverinfo2.pem b878afae4b Add a SERVERINFOV2 format test file 7 år sedan
servername_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
session.pem 6cf2dbd9fa Don't store the ticket nonce in the session 6 år sedan
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. 7 år sedan
shlibloadtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
siphash_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
sm2_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
sm4_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. 7 år sedan
srptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl_cert_table_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. 7 år sedan
ssl_test_ctx.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl_test_ctx.h 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl_test_ctx_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssl_test_ctx_test.conf cf72c75792 Implement Maximum Fragment Length TLS extension. 6 år sedan
sslapitest.c fe5d945028 sslapitest: add test ktls 5 år sedan
sslbuffertest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
sslcorrupttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssltest_old.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
ssltestlib.c fe5d945028 sslapitest: add test ktls 5 år sedan
ssltestlib.h fe5d945028 sslapitest: add test ktls 5 år sedan
stack_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). 6 år sedan
sysdefaulttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
test.cnf fec669388c Use 2K RSA and SHA256 in tests 9 år sedan
test_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
testdsa.pem 79a578b902 Add private/public key conversion tests 9 år sedan
testdsapub.pem 79a578b902 Add private/public key conversion tests 9 år sedan
testec-p256.pem 79a578b902 Add private/public key conversion tests 9 år sedan
testecpub-p256.pem 79a578b902 Add private/public key conversion tests 9 år sedan
testp7.pem dcb1ef5c22 Change PKCS#7 test data to take account of removal of 24 år sedan
testreq2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
testrsapub.pem 79a578b902 Add private/public key conversion tests 9 år sedan
testsid.pem 45f55f6a5b Remove SSLv2 support 9 år sedan
testutil.h 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
threadstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
time_offset_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
tls13ccstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
tls13encryptiontest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
tls13secretstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
uitest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 25 år sedan
v3ext.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
v3nametest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
verify_extra_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
versions.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
wpackettest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
x509_check_cert_pkey_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
x509_dup_cert_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
x509_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
x509_time_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan
x509aux.c 909f1a2e51 Following the license change, modify the boilerplates in test/ 5 år sedan

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_equal(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.