openssl/test
Matt Caswell f4764841dc Update copyright year
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9848)
2019-09-10 13:59:11 +01:00
..
certs Limit scope of CN name constraints 2018-05-23 11:08:48 -04:00
ct Verify SCT signatures 2016-03-01 11:59:28 -05:00
d2i-tests add test for CVE-2016-7053 2016-11-10 13:04:05 +00:00
ocsp-tests Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL 2017-08-16 14:36:48 -04:00
recipes Update copyright year 2019-09-10 13:59:11 +01:00
smime-certs Add alternative CMS P-256 cert 2017-08-10 20:26:33 +01:00
ssl-tests Update copyright year 2018-03-27 13:43:23 +01:00
CAss.cnf RT3809: basicConstraints is critical 2016-06-13 09:18:22 -04:00
CAssdh.cnf
CAssdsa.cnf
CAssrsa.cnf
CAtsa.cnf Use better defaults for TSA. 2015-11-20 13:40:53 +00:00
P1ss.cnf Use 2K RSA and SHA256 in tests 2015-04-20 07:23:04 -04:00
P2ss.cnf Use 2K RSA and SHA256 in tests 2015-04-20 07:23:04 -04:00
README test/README: clarify test number groups 2017-02-17 08:55:09 +01:00
README.ssltest.md Add new ssl_test option. 2017-01-08 19:39:33 +00:00
Sssdsa.cnf
Sssrsa.cnf
Uss.cnf Create DSA and ECDSA certificates. 2015-09-02 21:22:44 +01:00
aborttest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
afalgtest.c afalg: Fix kernel version check 2017-10-31 11:22:06 +01:00
asynciotest.c Update copyright year 2018-03-27 13:43:23 +01:00
asynctest.c asynctest: don't depend on apps 2017-03-28 14:38:55 +02:00
bad_dtls_test.c Remove unicode characters from source 2017-12-08 11:57:20 +01:00
bftest.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
bio_enc_test.c Fix bio_enc_test 2016-08-23 09:24:29 +01:00
bioprinttest.c Whitespace cleanup in apps 2016-06-29 09:56:39 -04:00
bntest.c Test for constant-time flag leakage in BN_CTX 2019-02-21 22:03:09 +02:00
build.info [test] unit test for field_inv function pointer in EC_METHOD 2019-02-20 20:03:48 +02:00
casttest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
cipherlist_test.c To avoid SWEET32 attack, move 3DES to weak 2016-08-24 14:05:52 +01:00
clienthellotest.c Update copyright year 2018-03-27 13:43:23 +01:00
cms-examples.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
constant_time_test.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
crltest.c GH2176: Add X509_VERIFY_PARAM_get_time 2017-01-12 10:08:24 -05:00
ct_test.c Update copyright year 2018-11-20 13:28:44 +00:00
d2i_test.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
danetest.c Fix some -Wshadow warnings 2017-03-14 18:10:00 +01:00
danetest.in Perform DANE-EE(3) name checks by default 2016-07-12 10:16:34 -04:00
danetest.pem DANE support for X509_verify_cert() 2016-01-07 13:48:59 -05:00
destest.c spelling fixes, just comments and readme. 2016-08-05 19:07:30 -04:00
dhtest.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
dsatest.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
dtlstest.c Update copyright year 2018-03-27 13:43:23 +01:00
dtlsv1listentest.c Simplify and rename SSL_set_rbio() and SSL_set_wbio() 2016-07-29 14:09:57 +01:00
ec_internal_test.c [test] unit test for field_inv function pointer in EC_METHOD 2019-02-20 20:03:48 +02:00
ecdsatest.c spelling fixes, just comments and readme. 2016-08-05 19:07:30 -04:00
ectest.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
enginetest.c Backport key redirection test from master branch 2017-10-14 00:07:49 +02:00
errtest.c Save and restore the Windows error around TlsGetValue. 2018-05-24 15:49:33 -04:00
evp_extra_test.c Key zeroization fix for EVP_SealInit. 2018-09-05 08:34:56 +10:00
evp_test.c Update copyright year 2018-08-14 13:37:41 +01:00
exdatatest.c Fix ex_data and session_dup issues 2017-06-14 10:38:51 +01:00
exptest.c Fix typo in comment 2017-12-11 08:48:46 -06:00
fatalerrtest.c Update copyright year 2018-03-27 13:43:23 +01:00
generate_buildtest.pl Move the building of test/buildtest_*. to be done unconditionally 2016-08-05 21:17:05 +02:00
generate_ssl_tests.pl Consolidate the locations where we have our internal perl modules 2017-11-05 22:58:10 +01:00
gmdifftest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
handshake_helper.c Update copyright year 2018-03-27 13:43:23 +01:00
handshake_helper.h Add new ssl_test option. 2017-01-08 19:39:33 +00:00
heartbeat_test.c Simplify SSL BIO buffering logic 2016-05-20 14:11:11 +01:00
hmactest.c Fix hmac test case 6 2016-06-30 08:52:37 -04:00
ideatest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
igetest.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
md2test.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
md4test.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
md5test.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
mdc2test.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
memleaktest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
methtest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
ocspapitest.c Wrap more of ocspapitest.c in OPENSSL_NO_OCSP 2017-12-12 19:08:22 -06:00
p5_crpt2_test.c Useless includes 2016-06-18 16:30:24 -04:00
packettest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
pbelutest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
pkcs7-1.pem
pkcs7.pem
pkits-test.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
r160test.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
randtest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
rc2test.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
rc4test.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
rc5test.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
rmdtest.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
rsa_complex.c Add a compile time test to verify that openssl/rsa.h and complex.h can 2018-09-17 09:48:09 +10:00
rsa_test.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
run_tests.pl Consolidate the locations where we have our internal perl modules 2017-11-05 22:58:10 +01:00
sanitytest.c Standardize syntax of sizeof(foo) 2017-12-08 15:17:12 -05:00
secmemtest.c Update copyright year 2018-11-20 13:28:44 +00:00
serverinfo.pem Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... 2013-09-13 19:32:55 -07:00
sha1test.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
sha256t.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
sha512t.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
shibboleth.pfx Add PKCS#12 UTF-8 interoperability test. 2016-08-22 13:52:51 +02:00
shlibloadtest.c Fix a gcc-8 warning -Wcast-function-type 2018-04-20 15:54:22 +02:00
smcont.txt test/smcont.txt: trigger assertion in bio_enc.c. 2016-07-31 17:03:17 +02:00
srptest.c Add SRP test vectors from RFC5054 2016-10-01 14:13:02 +01:00
ssl_test.c Update copyright year 2018-03-27 13:43:23 +01:00
ssl_test.tmpl test/ssl_test.tmpl: make it work with elderly perl. 2016-08-16 12:43:44 +02:00
ssl_test_ctx.c Fix a mem leak in ssl_test_ctx.c 2017-02-16 17:20:14 +00:00
ssl_test_ctx.h Provide a test for the Encrypt-Then-Mac renegotiation crash 2017-02-16 09:39:05 +00:00
ssl_test_ctx_test.c Add some CertStatus tests 2016-08-30 21:14:29 +01:00
ssl_test_ctx_test.conf Port multi-buffer tests 2016-08-18 12:46:00 +02:00
sslapitest.c Add a test for SSL_pending() 2018-04-20 11:56:30 +01:00
sslcorrupttest.c Update copyright year 2018-03-27 13:43:23 +01:00
ssltest_old.c Update copyright year 2018-03-27 13:43:23 +01:00
ssltestlib.c Update copyright year 2018-03-27 13:43:23 +01:00
ssltestlib.h Update copyright year 2018-03-27 13:43:23 +01:00
test.cnf Use 2K RSA and SHA256 in tests 2015-04-20 07:23:04 -04:00
testcrl.pem
testdsa.pem Add private/public key conversion tests 2015-03-29 03:26:12 +01:00
testdsapub.pem Add private/public key conversion tests 2015-03-29 03:26:12 +01:00
testec-p256.pem Add private/public key conversion tests 2015-03-29 03:26:12 +01:00
testecpub-p256.pem Add private/public key conversion tests 2015-03-29 03:26:12 +01:00
testp7.pem
testreq2.pem
testrsa.pem
testrsapub.pem Add private/public key conversion tests 2015-03-29 03:26:12 +01:00
testsid.pem Remove SSLv2 support 2014-12-04 11:55:03 +01:00
testutil.c SSL test framework: port NPN and ALPN tests 2016-07-19 14:17:48 +02:00
testutil.h Add -Wundef to strict-warnings 2017-02-23 09:48:49 -05:00
testx509.pem
threadstest.c include/openssl: don't include <windows.h> in public headers. 2016-07-08 11:49:44 +02:00
v3-cert1.pem
v3-cert2.pem
v3ext.c Add some accessor API's 2016-06-08 11:37:06 -04:00
v3nametest.c Copyright consolidation 02/10 2016-05-17 14:20:27 -04:00
verify_extra_test.c Update copyright year 2018-08-14 13:37:41 +01:00
versions.c Refuse to run test_cipherlist unless shared library matches build 2018-03-31 16:36:49 +02:00
wp_test.c crypto/cryptlib.c: omit OPENSSL_ia32cap_loc(). 2016-06-22 20:20:37 +02:00
x509_dup_cert_test.c Avoid errors when loading a cert multiple times. 2018-08-06 07:36:08 +10:00
x509_time_test.c Update copyright year 2018-08-14 13:37:41 +01:00
x509aux.c test/x509aux.c: Fix argv loop 2016-09-22 09:01:22 +01:00

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-99  misc


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)