FdaSilvaYY 69687aa829 More typo fixes преди 7 години
..
certs 4772610ccf Add test for -nameout output преди 7 години
ct 8c6afbc55c Verify SCT signatures преди 8 години
d2i-tests a378a46985 add test for CVE-2016-7053 преди 7 години
ocsp-tests 30c278aa6b Fix OCSP checking. преди 11 години
ossl_shim 69687aa829 More typo fixes преди 7 години
recipes 69687aa829 More typo fixes преди 7 години
smime-certs 6025001707 spelling fixes, just comments and readme. преди 7 години
ssl-tests 1763ab1029 Add a test for resumption after HRR преди 7 години
testlib 69687aa829 More typo fixes преди 7 години
CAss.cnf a7be5759cf RT3809: basicConstraints is critical преди 8 години
CAssdh.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 25 години
CAssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 25 години
CAssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 25 години
CAtsa.cnf 2cc7acd273 Use better defaults for TSA. преди 8 години
P1ss.cnf fec669388c Use 2K RSA and SHA256 in tests преди 9 години
P2ss.cnf fec669388c Use 2K RSA and SHA256 in tests преди 9 години
README 2fae041d6c Test infrastructure additions. преди 7 години
README.external 5c9e344731 Add Python Cryptography.io external test suite преди 7 години
README.ssltest.md 2e21539b2b Add ExpectedClientCANames преди 7 години
Sssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 25 години
Sssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b преди 25 години
Uss.cnf cb0585c2cb Create DSA and ECDSA certificates. преди 8 години
aborttest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
afalgtest.c 25b9d11c00 Handle inability to create AFALG socket преди 8 години
asn1_internal_test.c 2fae041d6c Test infrastructure additions. преди 7 години
asynciotest.c 8e2236eff8 Let test handshakes stop on certain errors преди 7 години
asynctest.c a0f44a34d2 asynctest: don't depend on apps преди 7 години
bad_dtls_test.c af5883fec9 Solution proposal for issue #1647. преди 7 години
bftest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
bio_enc_test.c 61884b8140 Fix bio_enc_test преди 7 години
bioprinttest.c 6b4a77f56e Whitespace cleanup in apps преди 8 години
bntest.c 24dc7fe0c0 bntest: do not stop on first fautl encountered преди 7 години
bntests.pl 8d1ebff41c Make bntest be (mostly) file-based. преди 7 години
bntests.txt 383e9ade2b bntests.txt: add a couple of checks of possibly negative zero преди 7 години
build.info 69687aa829 More typo fixes преди 7 години
casttest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
chacha_internal_test.c ee6d9dfb39 test: add chacha_internal_test. преди 7 години
cipher_overhead_test.c 542dd9c587 Add unit test for ssl_cipher_get_overhead() преди 7 години
cipherbytes_test.c 6e3dac1995 Tests for SSL_bytes_to_cipher_list() преди 7 години
cipherlist_test.c 2fae041d6c Test infrastructure additions. преди 7 години
clienthellotest.c 6828358c65 Handle TLSv1.3 being disabled in clienthello test преди 7 години
cms-examples.pl e0a651945c Copyright consolidation: perl files преди 8 години
constant_time_test.c c76da13cd9 constant time test: include our internal/numbers.h rather than limits.h преди 7 години
crltest.c 2fae041d6c Test infrastructure additions. преди 7 години
ct_test.c 765731a888 Make sure things get deleted when test setup fails in ct_test.c преди 7 години
d2i_test.c e364c3b24e Add main() test methods to reduce test boilerplate. преди 7 години
danetest.c aebe9e3991 Fix some -Wshadow warnings преди 7 години
danetest.in 5ae4ceb92c Perform DANE-EE(3) name checks by default преди 7 години
danetest.pem 170b735820 DANE support for X509_verify_cert() преди 8 години
destest.c 6025001707 spelling fixes, just comments and readme. преди 7 години
dhtest.c b84e12266f Fix the build and tests following constification of DH, DSA, RSA преди 8 години
dsatest.c b84e12266f Fix the build and tests following constification of DH, DSA, RSA преди 8 години
dtls_mtu_test.c 8e2236eff8 Let test handshakes stop on certain errors преди 7 години
dtlstest.c 8e2236eff8 Let test handshakes stop on certain errors преди 7 години
dtlsv1listentest.c 65e2d67254 Simplify and rename SSL_set_rbio() and SSL_set_wbio() преди 7 години
ecdhtest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
ecdhtest_cavs.h 6b4a77f56e Whitespace cleanup in apps преди 8 години
ecdsatest.c 6025001707 spelling fixes, just comments and readme. преди 7 години
ectest.c 2f0ca54c32 Remove some obsolete/obscure internal define switches: преди 7 години
enginetest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
evp_extra_test.c 440e5d805f Copyright consolidation 02/10 преди 8 години
evp_test.c fa013b6524 Fixed PKCS5_PBKDF2_HMAC() to adhere to the documentation. преди 7 години
evptests.txt fa013b6524 Fixed PKCS5_PBKDF2_HMAC() to adhere to the documentation. преди 7 години
exdatatest.c b3c31a6572 Fix the error handling in CRYPTO_dup_ex_data. преди 7 години
exptest.c 2301d91dd5 Change callers to use the new constants. преди 7 години
generate_buildtest.pl 5cdad22f3e Move the building of test/buildtest_*. to be done unconditionally преди 7 години
generate_ssl_tests.pl 9f48bbacd8 Reorganize SSL test structures преди 7 години
gmdifftest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
handshake_helper.c 2e21539b2b Add ExpectedClientCANames преди 7 години
handshake_helper.h 2e21539b2b Add ExpectedClientCANames преди 7 години
hmactest.c 8a3c000c8f Fix hmac test case 6 преди 8 години
ideatest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
igetest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
lhash_test.c 2fae041d6c Test infrastructure additions. преди 7 години
md2test.c d166ed8c11 check return values for EVP_Digest*() APIs преди 7 години
mdc2_internal_test.c 2fae041d6c Test infrastructure additions. преди 7 години
mdc2test.c d166ed8c11 check return values for EVP_Digest*() APIs преди 7 години
memleaktest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
modes_internal_test.c e364c3b24e Add main() test methods to reduce test boilerplate. преди 7 години
packettest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
pbelutest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
pkey_meth_test.c 2fae041d6c Test infrastructure additions. преди 7 години
pkits-test.pl 609b0852e4 Remove trailing whitespace from some files. преди 7 години
poly1305_internal_test.c 2fae041d6c Test infrastructure additions. преди 7 години
randtest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
rc2test.c 440e5d805f Copyright consolidation 02/10 преди 8 години
rc4test.c c5055adf35 Revert rc4test removal, it performs additional tests not in evptests.txt преди 7 години
rc5test.c 440e5d805f Copyright consolidation 02/10 преди 8 години
recordlentest.c 69687aa829 More typo fixes преди 7 години
rsa_test.c 2f0ca54c32 Remove some obsolete/obscure internal define switches: преди 7 години
run_tests.pl e5fd8ca43b Make it possible to select or deselect test groups by number преди 7 години
sanitytest.c cc75cbc4ed Platform sanity test преди 8 години
secmemtest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... преди 10 години
session.pem 6bc6ca623b Add tests for the padding extension преди 7 години
sha1test.c d166ed8c11 check return values for EVP_Digest*() APIs преди 7 години
sha256t.c d166ed8c11 check return values for EVP_Digest*() APIs преди 7 години
sha512t.c d166ed8c11 check return values for EVP_Digest*() APIs преди 7 години
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. преди 7 години
shlibloadtest.c 586b79d888 Fix no-dso (shlibloadtest) преди 7 години
siphash_internal_test.c 3f5616d734 Add support for parameterized SipHash преди 7 години
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. преди 7 години
srptest.c 198d805900 Add SRP test vectors from RFC5054 преди 7 години
ssl_test.c 2fae041d6c Test infrastructure additions. преди 7 години
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. преди 7 години
ssl_test_ctx.c 2e21539b2b Add ExpectedClientCANames преди 7 години
ssl_test_ctx.h 2e21539b2b Add ExpectedClientCANames преди 7 години
ssl_test_ctx_test.c 2fae041d6c Test infrastructure additions. преди 7 години
ssl_test_ctx_test.conf 439db0c97b Add compression tests преди 7 години
sslapitest.c 69687aa829 More typo fixes преди 7 години
sslcorrupttest.c 8e2236eff8 Let test handshakes stop on certain errors преди 7 години
ssltest_old.c 69687aa829 More typo fixes преди 7 години
ssltestlib.c 43708c1545 Move PRIu64, OSSLzu to e_os.h преди 7 години
ssltestlib.h 8e2236eff8 Let test handshakes stop on certain errors преди 7 години
stack_test.c 2fae041d6c Test infrastructure additions. преди 7 години
test.cnf fec669388c Use 2K RSA and SHA256 in tests преди 9 години
test_main.c e364c3b24e Add main() test methods to reduce test boilerplate. преди 7 години
test_main.h e364c3b24e Add main() test methods to reduce test boilerplate. преди 7 години
test_main_custom.c e364c3b24e Add main() test methods to reduce test boilerplate. преди 7 години
test_main_custom.h e364c3b24e Add main() test methods to reduce test boilerplate. преди 7 години
test_test.c 2fae041d6c Test infrastructure additions. преди 7 години
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
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 преди 25 години
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
testrsapub.pem 79a578b902 Add private/public key conversion tests преди 9 години
testsid.pem 45f55f6a5b Remove SSLv2 support преди 9 години
testutil.c 2fae041d6c Test infrastructure additions. преди 7 години
testutil.h 2fae041d6c Test infrastructure additions. преди 7 години
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
threadstest.c f1f5ee17b6 include/openssl: don't include <windows.h> in public headers. преди 8 години
tls13encryptiontest.c 2fae041d6c Test infrastructure additions. преди 7 години
tls13secretstest.c 2fae041d6c Test infrastructure additions. преди 7 години
uitest.c 6a15d5b637 UI: fix uitest for VMS преди 7 години
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b преди 25 години
v3ext.c e417070c9f Add some accessor API's преди 8 години
v3nametest.c 440e5d805f Copyright consolidation 02/10 преди 8 години
verify_extra_test.c 28b86f313b Fix some extra or missing whitespaces... преди 7 години
wpackettest.c 342543426d Add a test for WPACKET_fill_lengths() преди 7 години
x509_internal_test.c 2fae041d6c Test infrastructure additions. преди 7 години
x509_time_test.c 2fae041d6c Test infrastructure additions. преди 7 години
x509aux.c 780bbb96bf test/x509aux.c: Fix argv loop преди 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 test/testlib/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 test/testlib/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 testutil.c test_main.c
INCLUDE[{name}]=.. ../include
DEPEND[{name}]=../libcrypto

Generic form of C test executables
==================================

#include "test_main.h"
#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;
}

void register_tests(void)
{
ADD_TEST(my_test); /* Add each test separately */
}

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.