Richard Levitte 6fb7b08987 15-test_out_option: Refactor and don't test directory write on VMS преди 6 години
..
certs b0edda11cb Update copyright year преди 6 години
ct 8c6afbc55c Verify SCT signatures преди 8 години
d2i-tests a378a46985 add test for CVE-2016-7053 преди 8 години
ocsp-tests 121738d1cb Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL преди 7 години
ossl_shim aaaa6ac11b Don't negotiate TLSv1.3 with the ossl_shim преди 6 години
recipes 6fb7b08987 15-test_out_option: Refactor and don't test directory write on VMS преди 6 години
smime-certs 1aee92bf0f Add alternative CMS P-256 cert преди 7 години
ssl-tests 7500bc337a Allow TLSv1.3 EC certs to use compressed points преди 6 години
testutil 0d66475908 Update copyright year преди 6 години
CAss.cnf a7be5759cf RT3809: basicConstraints is critical преди 8 години
CAssdh.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 26 години
CAssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 26 години
CAssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 26 години
CAtsa.cnf f0ef20bf38 Added support for ESSCertIDv2 преди 7 години
P1ss.cnf fec669388c Use 2K RSA and SHA256 in tests преди 9 години
P2ss.cnf fec669388c Use 2K RSA and SHA256 in tests преди 9 години
README f90486f4de Fix test documentation. преди 7 години
README.external 46f4e1bec5 Many spelling fixes/typo's corrected. преди 6 години
README.ssltest.md a84e5c9aa8 Session resume broken switching contexts преди 7 години
Sssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 26 години
Sssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 26 години
Uss.cnf cb0585c2cb Create DSA and ECDSA certificates. преди 9 години
aborttest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
afalgtest.c c517ac4c3f Revert "Modify test/afalgtest to fail if the afalg engine couldn't be loaded" преди 6 години
asn1_encode_test.c 0d66475908 Update copyright year преди 6 години
asn1_internal_test.c 899e62d186 Fix AppVeyor/VC build failure преди 6 години
asn1_string_table_test.c 31a80694d4 [Win] Fix some test method signatures ... преди 7 години
asn1_time_test.c f5e3115361 test/asn1_time_test.c: make it work on 64-bit HP-UX. преди 6 години
asynciotest.c b0edda11cb Update copyright year преди 6 години
asynctest.c a0f44a34d2 asynctest: don't depend on apps преди 7 години
bad_dtls_test.c d68a0eaf45 Remove unicode characters from source преди 6 години
bftest.c cbe2964821 Consistent formatting for sizeof(foo) преди 6 години
bio_callback_test.c c911e5da3c Fix bio callback backward compatibility преди 6 години
bio_enc_test.c 0139ce7c92 Fix no-chacha and no-poly1305 преди 7 години
bioprinttest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
bntest.c f91e026e38 Fix a possible crash in BN_from_montgomery_word преди 6 години
bntests.pl 8d1ebff41c Make bntest be (mostly) file-based. преди 7 години
build.info efe749c840 Refuse to run test_cipherlist unless shared library matches build преди 6 години
casttest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
chacha_internal_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
cipher_overhead_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
cipherbytes_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
cipherlist_test.c f865b08143 Split configuration of TLSv1.3 ciphers from older ciphers преди 6 години
ciphername_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
clienthellotest.c 7d7f6834e5 Enhance ssltestlib's create_ssl_ctx_pair to take min and max proto version преди 6 години
cms-examples.pl e0a651945c Copyright consolidation: perl files преди 8 години
conf_include_test.c 1a54618ba6 Fix no-posix-io compile failure преди 6 години
constant_time_test.c 0d66475908 Update copyright year преди 6 години
crltest.c 4483fbae10 Factorise duplicated code. преди 6 години
ct_test.c b9d1ad3203 test/ct_test.c: remove dependency on -lm. преди 6 години
ctype_internal_test.c b0edda11cb Update copyright year преди 6 години
curve448_internal_test.c 0d66475908 Update copyright year преди 6 години
d2i_test.c cbe2964821 Consistent formatting for sizeof(foo) преди 6 години
danetest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
danetest.in 5ae4ceb92c Perform DANE-EE(3) name checks by default преди 8 години
danetest.pem 170b735820 DANE support for X509_verify_cert() преди 8 години
destest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
dhtest.c 7966101e20 Allow DH_set0_key with only private key. преди 7 години
drbg_cavs_data.c c4d3c19b4c Update copyright year преди 6 години
drbg_cavs_data.h c4d3c19b4c Update copyright year преди 6 години
drbg_cavs_test.c c4d3c19b4c Update copyright year преди 6 години
drbgtest.c 43687d685f DRBG: fix coverity issues преди 6 години
drbgtest.h 12fb8c3d2d Add DRBG random method преди 7 години
dsatest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
dtls_mtu_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
dtlstest.c b0edda11cb Update copyright year преди 6 години
dtlsv1listentest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
ecdsatest.c b0edda11cb Update copyright year преди 6 години
ecstresstest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
ectest.c dc55e4f70f Fix a bug in ecp_nistp224.c. преди 6 години
enginetest.c e3662075c3 Add EVP_PKEY_METHOD redirection test преди 7 години
evp_extra_test.c 8a8bc66562 Fix no-ec преди 6 години
evp_test.c b0edda11cb Update copyright year преди 6 години
evp_test.h c3fc7d9ac5 Add support for multiple update calls in evp_test преди 7 години
exdatatest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
exptest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
fatalerrtest.c b0edda11cb Update copyright year преди 6 години
generate_buildtest.pl 5cdad22f3e Move the building of test/buildtest_*. to be done unconditionally преди 8 години
generate_ssl_tests.pl cb6afcd6ee Consolidate the locations where we have our internal perl modules преди 7 години
gmdifftest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
handshake_helper.c df0fed9aab Session Ticket app data преди 6 години
handshake_helper.h b0edda11cb Update copyright year преди 6 години
hmactest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
ideatest.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
igetest.c cbe2964821 Consistent formatting for sizeof(foo) преди 6 години
lhash_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
md2test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
mdc2_internal_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
mdc2test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
memleaktest.c 789dfc478e Update secmemtest and memeleaktest to use the test infrastructure. преди 7 години
modes_internal_test.c 6738bf1417 Update copyright year преди 6 години
ocspapitest.c cb091295a9 Wrap more of ocspapitest.c in OPENSSL_NO_OCSP преди 6 години
packettest.c b0edda11cb Update copyright year преди 6 години
pbelutest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
pemtest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
pkey_meth_kdf_test.c b73b4d73de Add PKEY_CTX setter tests for TLS1-PRF преди 7 години
pkey_meth_test.c 31a80694d4 [Win] Fix some test method signatures ... преди 7 години
pkits-test.pl 46f4e1bec5 Many spelling fixes/typo's corrected. преди 6 години
poly1305_internal_test.c 6738bf1417 Update copyright year преди 6 години
rc2test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
rc4test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
rc5test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
rdrand_sanitytest.c b0edda11cb Update copyright year преди 6 години
recordlentest.c b0edda11cb Update copyright year преди 6 години
rsa_mp_test.c 3bded9cd35 rsa/rsa_gen.c: harmonize keygen's ability with RSA_security_bits. преди 6 години
rsa_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
run_tests.pl 26810b5eaf test/run_tests.pl: don't use Module::Load::Conditional. преди 7 години
sanitytest.c cbe2964821 Consistent formatting for sizeof(foo) преди 6 години
secmemtest.c 44e6995155 Fix some Typos and indents преди 7 години
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... преди 11 години
serverinfo2.pem b878afae4b Add a SERVERINFOV2 format test file преди 7 години
servername_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
session.pem 5a6ff161cc Update the test/session.pem to have a tick_nonce value преди 7 години
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. преди 8 години
shlibloadtest.c 26db32469f Fix a gcc-8 warning -Wcast-function-type преди 6 години
siphash_internal_test.c 6738bf1417 Update copyright year преди 6 години
sm2crypttest.c b0edda11cb Update copyright year преди 6 години
sm2sigtest.c b0edda11cb Update copyright year преди 6 години
sm4_internal_test.c f19a5ff9ab SM4: Add SM4 block cipher to EVP преди 7 години
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. преди 8 години
srptest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
ssl_cert_table_internal_test.c b0edda11cb Update copyright year преди 6 години
ssl_test.c dbabc86296 Add a config option to disable automatic config loading преди 6 години
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. преди 8 години
ssl_test_ctx.c df0fed9aab Session Ticket app data преди 6 години
ssl_test_ctx.h df0fed9aab Session Ticket app data преди 6 години
ssl_test_ctx_test.c b0edda11cb Update copyright year преди 6 години
ssl_test_ctx_test.conf cf72c75792 Implement Maximum Fragment Length TLS extension. преди 7 години
sslapitest.c 4a432af895 Add a test for SSL_pending() преди 6 години
sslbuffertest.c b0edda11cb Update copyright year преди 6 години
sslcorrupttest.c a53b5be6a0 Fix configuration of TLSv1.3 ciphersuites преди 6 години
ssltest_old.c de5b3a8645 TLSProxy/Proxy.pm: bind s_server to loopback interface. преди 6 години
ssltestlib.c b0edda11cb Update copyright year преди 6 години
ssltestlib.h b0edda11cb Update copyright year преди 6 години
stack_test.c 1b3e2bbf64 Add a reserve call to the stack data structure. преди 7 години
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). преди 6 години
sysdefaulttest.c b0edda11cb Update copyright year преди 6 години
test.cnf fec669388c Use 2K RSA and SHA256 in tests преди 9 години
test_test.c c4d3c19b4c Update copyright year преди 6 години
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
testdsa.pem 79a578b902 Add private/public key conversion tests преди 9 години
testdsapub.pem 79a578b902 Add private/public key conversion tests преди 9 години
testec-p256.pem 79a578b902 Add private/public key conversion tests преди 9 години
testecpub-p256.pem 79a578b902 Add private/public key conversion tests преди 9 години
testp7.pem dcb1ef5c22 Change PKCS#7 test data to take account of removal of преди 24 години
testreq2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
testrsapub.pem 79a578b902 Add private/public key conversion tests преди 9 години
testsid.pem 45f55f6a5b Remove SSLv2 support преди 9 години
testutil.h b7af3f1433 Test support for time_t comparisons. преди 6 години
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
threadstest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
time_offset_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
tls13ccstest.c d4da95a773 test: Remove redundant SSL_CTX_set_max_early_data преди 6 години
tls13encryptiontest.c b0edda11cb Update copyright year преди 6 години
tls13secretstest.c b38ede8043 Export keying material using early exporter master secret преди 6 години
uitest.c 31a80694d4 [Win] Fix some test method signatures ... преди 7 години
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 26 години
v3ext.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
v3nametest.c 6738bf1417 Update copyright year преди 6 години
verify_extra_test.c 7f6dfa19df Add a test for a NULL X509_STORE in X509_STORE_CTX_init преди 6 години
versions.c efe749c840 Refuse to run test_cipherlist unless shared library matches build преди 6 години
wpackettest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
x509_check_cert_pkey_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
x509_dup_cert_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything преди 7 години
x509_internal_test.c 5d99881e6a Iron out /WX errors in VC-WIN32. преди 6 години
x509_time_test.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години
x509aux.c 176db6dc51 Use "" not <> for internal/ includes преди 7 години

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.