|
5 years ago | |
---|---|---|
.. | ||
certs | 5 years ago | |
ct | 6 years ago | |
d2i-tests | 6 years ago | |
ocsp-tests | 10 years ago | |
ossl_shim | 5 years ago | |
recipes | 5 years ago | |
smime-certs | 6 years ago | |
ssl-tests | 5 years ago | |
testlib | 5 years ago | |
CAss.cnf | 6 years ago | |
CAssdh.cnf | 24 years ago | |
CAssdsa.cnf | 24 years ago | |
CAssrsa.cnf | 24 years ago | |
CAtsa.cnf | 7 years ago | |
P1ss.cnf | 7 years ago | |
P2ss.cnf | 7 years ago | |
README | 5 years ago | |
README.external | 5 years ago | |
README.ssltest.md | 5 years ago | |
Sssdsa.cnf | 24 years ago | |
Sssrsa.cnf | 24 years ago | |
Uss.cnf | 7 years ago | |
aborttest.c | 6 years ago | |
afalgtest.c | 6 years ago | |
asn1_internal_test.c | 6 years ago | |
asynciotest.c | 5 years ago | |
asynctest.c | 5 years ago | |
bad_dtls_test.c | 6 years ago | |
bftest.c | 6 years ago | |
bio_enc_test.c | 6 years ago | |
bioprinttest.c | 6 years ago | |
bntest.c | 5 years ago | |
bntests.pl | 6 years ago | |
bntests.txt | 5 years ago | |
build.info | 5 years ago | |
casttest.c | 6 years ago | |
chacha_internal_test.c | 5 years ago | |
cipher_overhead_test.c | 6 years ago | |
cipherbytes_test.c | 5 years ago | |
cipherlist_test.c | 5 years ago | |
clienthellotest.c | 6 years ago | |
cms-examples.pl | 6 years ago | |
constant_time_test.c | 6 years ago | |
crltest.c | 6 years ago | |
ct_test.c | 6 years ago | |
d2i_test.c | 6 years ago | |
danetest.c | 6 years ago | |
danetest.in | 6 years ago | |
danetest.pem | 7 years ago | |
destest.c | 6 years ago | |
dhtest.c | 6 years ago | |
dsatest.c | 6 years ago | |
dtls_mtu_test.c | 5 years ago | |
dtlstest.c | 5 years ago | |
dtlsv1listentest.c | 6 years ago | |
ecdhtest.c | 6 years ago | |
ecdhtest_cavs.h | 6 years ago | |
ecdsatest.c | 6 years ago | |
ectest.c | 5 years ago | |
enginetest.c | 6 years ago | |
evp_extra_test.c | 6 years ago | |
evp_test.c | 5 years ago | |
evptests.txt | 5 years ago | |
exdatatest.c | 5 years ago | |
exptest.c | 6 years ago | |
generate_buildtest.pl | 6 years ago | |
generate_ssl_tests.pl | 6 years ago | |
gmdifftest.c | 6 years ago | |
handshake_helper.c | 5 years ago | |
handshake_helper.h | 5 years ago | |
hmactest.c | 6 years ago | |
ideatest.c | 6 years ago | |
igetest.c | 6 years ago | |
md2test.c | 6 years ago | |
mdc2_internal_test.c | 6 years ago | |
mdc2test.c | 6 years ago | |
memleaktest.c | 6 years ago | |
modes_internal_test.c | 6 years ago | |
packettest.c | 6 years ago | |
pbelutest.c | 6 years ago | |
pkcs7-1.pem | 24 years ago | |
pkcs7.pem | 24 years ago | |
pkey_meth_test.c | 6 years ago | |
pkits-test.pl | 6 years ago | |
poly1305_internal_test.c | 6 years ago | |
randtest.c | 6 years ago | |
rc2test.c | 6 years ago | |
rc4test.c | 5 years ago | |
rc5test.c | 6 years ago | |
recordlentest.c | 5 years ago | |
rsa_test.c | 5 years ago | |
run_tests.pl | 5 years ago | |
sanitytest.c | 6 years ago | |
secmemtest.c | 6 years ago | |
serverinfo.pem | 9 years ago | |
sha1test.c | 6 years ago | |
sha256t.c | 6 years ago | |
sha512t.c | 6 years ago | |
shibboleth.pfx | 6 years ago | |
shlibloadtest.c | 6 years ago | |
siphash_internal_test.c | 5 years ago | |
smcont.txt | 6 years ago | |
srptest.c | 6 years ago | |
ssl_test.c | 5 years ago | |
ssl_test.tmpl | 6 years ago | |
ssl_test_ctx.c | 5 years ago | |
ssl_test_ctx.h | 5 years ago | |
ssl_test_ctx_test.c | 5 years ago | |
ssl_test_ctx_test.conf | 5 years ago | |
sslapitest.c | 5 years ago | |
sslcorrupttest.c | 5 years ago | |
ssltest_old.c | 5 years ago | |
ssltestlib.c | 5 years ago | |
ssltestlib.h | 5 years ago | |
test.cnf | 7 years ago | |
test_main.c | 6 years ago | |
test_main.h | 6 years ago | |
test_main_custom.c | 6 years ago | |
test_main_custom.h | 6 years ago | |
testcrl.pem | 24 years ago | |
testdsa.pem | 7 years ago | |
testdsapub.pem | 7 years ago | |
testec-p256.pem | 7 years ago | |
testecpub-p256.pem | 7 years ago | |
testp7.pem | 22 years ago | |
testreq2.pem | 24 years ago | |
testrsa.pem | 24 years ago | |
testrsapub.pem | 7 years ago | |
testsid.pem | 8 years ago | |
testutil.c | 6 years ago | |
testutil.h | 5 years ago | |
testx509.pem | 24 years ago | |
threadstest.c | 6 years ago | |
tls13encryptiontest.c | 5 years ago | |
tls13secretstest.c | 5 years ago | |
uitest.c | 6 years ago | |
v3-cert1.pem | 24 years ago | |
v3-cert2.pem | 24 years ago | |
v3ext.c | 6 years ago | |
v3nametest.c | 6 years ago | |
verify_extra_test.c | 5 years ago | |
wpackettest.c | 5 years ago | |
x509_internal_test.c | 6 years ago | |
x509_time_test.c | 5 years ago | |
x509aux.c | 6 years ago |
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/Makefile
========================
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):
* among the variables for test executables at the beginning, add a line like
this:
{NAME}TEST= {name}test
* add `$({NAME}TEST)$(EXE_EXT)' to the assignment of EXE:
* add `$({NAME}TEST).o' to the assignment of OBJ:
* add `$({NAME}TEST).c' to the assignment of SRC:
* add the following lines for building the executable:
$({NAME}TEST)$(EXE_EXT): $({NAME}TEST).o $(DLIBCRYPTO)
@target=$({NAME}TEST); $(BUILD_CMD)