You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Dr. Stephen Henson 42a8b3f90a Extended master secret test script.
Reviewed-by: Matt Caswell <matt@openssl.org>
7 years ago
..
Attic Remove old testing scripts out of the way. 8 years ago
certs Add test for CVE-2015-1793 8 years ago
ocsp-tests Fix OCSP checking. 10 years ago
recipes Extended master secret test script. 7 years ago
smime-certs Add X9.42 DH certificate to S/MIME test 10 years ago
testlib/OpenSSL testlib/OpenSSL/Test.pm: remove redundant 'cmd /c', MSWin32 Perl can take care of itself. 8 years ago
CAss.cnf Use 2K RSA and SHA256 in tests 8 years ago
CAssdh.cnf Import of old SSLeay release: SSLeay 0.9.0b 25 years ago
CAssdsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 25 years ago
CAssrsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 25 years ago
CAtsa.cnf Use better defaults for TSA. 7 years ago
Makefile Fix ASYNC null implementation 7 years ago
P1ss.cnf Use 2K RSA and SHA256 in tests 8 years ago
P2ss.cnf Use 2K RSA and SHA256 in tests 8 years ago
README Add documentation for the new testing framework 8 years ago
Sssdsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 25 years ago
Sssrsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 25 years ago
Uss.cnf Create DSA and ECDSA certificates. 8 years ago
asynctest.c Convert __thread to pthreads for Thread Local Storage 7 years ago
bftest.c memset, memcpy, sizeof consistency fixes 8 years ago
bntest.c bn/asm/x86_64-mont5.pl: fix carry propagating bug (CVE-2015-3193). 7 years ago
casttest.c Stop symlinking, move files to intended directory 8 years ago
clean_test.com * apps/makeapps.com: Forgot to end the check for /POINTER_SIZE=64=ARGV 12 years ago
clienthellotest.c GH354: Memory leak fixes 8 years ago
cms-examples.pl Use "cont" consistently in cms-examples.pl 15 years ago
conftest.c No fprintf in the txt_db component 8 years ago
constant_time_test.c Add recipes for misc other things we want to test 8 years ago
destest.c Stop symlinking, move files to intended directory 8 years ago
dhtest.c Properly check return type of DH_compute_key() 8 years ago
dsatest.c Have the test executables output in text mode 8 years ago
dummytest.c Run util/openssl-format-source -v -c . 8 years ago
ecdhtest.c Have the test executables output in text mode 8 years ago
ecdsatest.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
ectest.c EC_POINT_is_on_curve does not return a boolean 8 years ago
enginetest.c memset, memcpy, sizeof consistency fixes 8 years ago
evp_extra_test.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
evp_test.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
evptests.txt base64 decode: check for high bit 8 years ago
exdatatest.c ex_data part 2: doc fixes and CRYPTO_free_ex_index. 7 years ago
exptest.c Have the test executables output in text mode 8 years ago
gmdifftest.c Check OPENSSL_gmtime_diff 8 years ago
gost2814789test.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
heartbeat_test.c memset, memcpy, sizeof consistency fixes 8 years ago
hmactest.c Cleanup: fix all sources that used HMAC_CTX_init 7 years ago
ideatest.c Enable -Wmissing-variable-declarations and 8 years ago
igetest.c more OSSL_NELEM cases 8 years ago
jpaketest.c Have the test executables output in text mode 8 years ago
maketests.com Catch up the VMS build. 8 years ago
md2test.c Stop symlinking, move files to intended directory 8 years ago
md4test.c Stop symlinking, move files to intended directory 8 years ago
md5test.c Stop symlinking, move files to intended directory 8 years ago
mdc2test.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
methtest.c More comment realignment 8 years ago
nptest.c Test for NULL ptr == 0 8 years ago
p5_crpt2_test.c Stop symlinking, move files to intended directory 8 years ago
packettest.c DTLS: remove unused cookie field 8 years ago
pbelutest.c PBE lookup test 8 years ago
pkcs7-1.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
pkcs7.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
pkits-test.pl detect and use older PKITS data 11 years ago
r160test.c Run util/openssl-format-source -v -c . 8 years ago
randtest.c Stop symlinking, move files to intended directory 8 years ago
rc2test.c Stop symlinking, move files to intended directory 8 years ago
rc4test.c memset, memcpy, sizeof consistency fixes 8 years ago
rc5test.c Stop symlinking, move files to intended directory 8 years ago
rmdtest.c Stop symlinking, move files to intended directory 8 years ago
rsa_test.c RT 3493: fix RSA test 8 years ago
run_tests.pl Add a method to list available tests 8 years ago
secmemtest.c More secure storage of key material. 8 years ago
serverinfo.pem Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... 10 years ago
sha1test.c Cleanup the EVP_MD_CTX before exit rather than after 7 years ago
sha256t.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
sha512t.c Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy) 7 years ago
smcont.txt Add extensive PCKS7 and CMS consistency test script. 15 years ago
srptest.c Have the test executables output in text mode 8 years ago
ssltest.c Remove support for all 40 and 56 bit ciphers. 7 years ago
test.cnf Use 2K RSA and SHA256 in tests 8 years ago
test_aesni test_aesni: harmonize with AES-NI support at EVP layer. 11 years ago
test_padlock Update test/test_padlock script. 14 years ago
test_t4 Add support for SPARC T4 DES opcode. 10 years ago
testcrl.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
testdsa.pem Add private/public key conversion tests 8 years ago
testdsapub.pem Add private/public key conversion tests 8 years ago
testec-p256.pem Add private/public key conversion tests 8 years ago
testecpub-p256.pem Add private/public key conversion tests 8 years ago
testp7.pem Change PKCS#7 test data to take account of removal of 23 years ago
testreq2.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
testrsa.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
testrsapub.pem Add private/public key conversion tests 8 years ago
tests.com Catch up the VMS build. 8 years ago
testsid.pem Remove SSLv2 support 8 years ago
testutil.c more OSSL_NELEM cases 8 years ago
testutil.h Run util/openssl-format-source -v -c . 8 years ago
testx509.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
times Updates from 1.0.0-stable branch. 14 years ago
v3-cert1.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
v3-cert2.pem Import of old SSLeay release: SSLeay 0.8.1b 25 years ago
v3nametest.c Stop symlinking, move files to intended directory 8 years ago
verify_extra_test.c Make the verify_extra test location agnostic 8 years ago
wp_test.c Enable -Wmissing-variable-declarations and 8 years ago

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 convetions
=================

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:

05  individual symmetric cipher algorithms
10  math (bignum)
15  individual asymmetric cipher algorithms
20  openssl enc
25  certificate forms, generation and verification
30  engine and evp
70  PACKET layer
80  "larger" protocols (CA, CMS, OCSP, SSL, TSA)
90  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)