You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Matt Caswell 8a9394c1ed
Fix no-dh and no-dsa
2 years ago
..
certs make various test CA certs RFC 5280 compliant w.r.t. X509 extensions 2 years ago
ct Use .cnf for config files, not .conf 3 years ago
d2i-tests add test for CVE-2016-7053 6 years ago
helpers TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
ocsp-tests Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL 6 years ago
ossl_shim Add more diagnostics to ossl_shim 2 years ago
recipes dh_cms_set_shared_info: Use explicit fetch to be able to provide libctx 2 years ago
smime-certs Make the smdh.pem test certificate usable with fips provider 2 years ago
ssl-tests Update copyright year 2 years ago
testutil TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
CAtsa.cnf Remove RANDFILE settings from configuration files 3 years ago
README-dev.md Rename NOTES*, README*, VERSION, HACKING, LICENSE to .md or .txt 3 years ago
README-external.md Fix many MarkDown issues in {NOTES*,README*,HACKING,LICENSE}.md files 3 years ago
README.md test: document the random test ordering env variable 2 years ago
README.ssltest.md Fix issues reported by markdownlint 3 years ago
aborttest.c Following the license change, modify the boilerplates in test/ 4 years ago
acvp_test.c Drop OPENSSL_NO_RSA everywhere 2 years ago
acvp_test.inc Drop OPENSSL_NO_RSA everywhere 2 years ago
aesgcmtest.c Rename EVP_CIPHER_CTX_get_iv and EVP_CIPHER_CTX_get_iv_state for clarity 2 years ago
afalgtest.c Update copyright year 3 years ago
asn1_decode_test.c Add a test for encoding/decoding using an invalid ASN.1 Template 2 years ago
asn1_dsa_internal_test.c Update copyright year 2 years ago
asn1_encode_test.c Add a test for encoding/decoding using an invalid ASN.1 Template 2 years ago
asn1_internal_test.c Reorganize private crypto header files 4 years ago
asn1_string_table_test.c typo ANS1 -> ASN1 4 years ago
asn1_time_test.c Update copyright year 3 years ago
asynciotest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
asynctest.c Rename OPENSSL_CTX prefix to OSSL_LIB_CTX 2 years ago
bad_dtls_test.c Revert "The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*" 3 years ago
bftest.c Update copyright year 3 years ago
bio_callback_test.c Following the license change, modify the boilerplates in test/ 4 years ago
bio_enc_test.c Following the license change, modify the boilerplates in test/ 4 years ago
bio_memleak_test.c Update copyright year 3 years ago
bio_prefix_text.c TEST: Add test recipe and help program to test BIO_f_prefix() 3 years ago
bioprinttest.c TEST: Adjust test/bioprinttest.c to behave like the testutil routines 3 years ago
bn_internal_test.c Update copyright year 3 years ago
bn_rand_range.h Test of uniformity of BN_rand_range output. 4 years ago
bntest.c Update copyright year 2 years ago
bntests.pl Following the license change, modify the boilerplates in test/ 4 years ago
build.info TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
ca-and-certs.cnf Cleanup cert config files for tests 3 years ago
casttest.c Update copyright year 3 years ago
chacha_internal_test.c Reorganize private crypto header files 4 years ago
cipher_overhead_test.c Reorganize local header files 4 years ago
cipherbytes_test.c Fix safestack issues in ssl.h 3 years ago
cipherlist_test.c Fix safestack issues in ssl.h 3 years ago
ciphername_test.c Fix safestack issues in ssl.h 3 years ago
clienthellotest.c Update copyright year 3 years ago
cmactest.c Add a CMAC test 3 years ago
cmp_asn_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
cmp_client_test.c CMP: Allow PKCS#10 input also for ir, cr, kur, and rr messages 2 years ago
cmp_ctx_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
cmp_hdr_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
cmp_msg_test.c TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
cmp_protect_test.c TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
cmp_server_test.c Use adapted test_get_libctx() for simpler test setup and better error reporting 2 years ago
cmp_status_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
cmp_vfy_test.c TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
cms-examples.pl Following the license change, modify the boilerplates in test/ 4 years ago
cmsapitest.c CMS: Fix NULL access if d2i_CMS_bio() is not passed a CMS_ContentInfo**. 2 years ago
conf_include_test.c Remove RANDFILE settings from configuration files 3 years ago
confdump.c Fix safestack issues in conf.h 3 years ago
constant_time_test.c Reorganize local header files 4 years ago
context_internal_test.c Update copyright year 2 years ago
crltest.c Fix safestack issues in x509.h 3 years ago
ct_test.c Fix safestack issues in ct.h 3 years ago
ctype_internal_test.c Reorganize private crypto header files 4 years ago
curve448_internal_test.c Fix ecx so that is uses a settable propertyquery 3 years ago
d2i_test.c Update copyright year 3 years ago
danetest.c Fix safestack issues in x509.h 3 years ago
danetest.in Following the license change, modify the boilerplates in test/ 4 years ago
danetest.pem
data.bin TEST: Make our test data binary 2 years ago
data2.bin TEST: Make our test data binary 2 years ago
default-and-fips.cnf Update some nits around the FIPS module 3 years ago
default-and-legacy.cnf test/recipes/30-test_evp.t: Modify to test with different providers 4 years ago
default.cnf test/recipes/30-test_evp.t: Modify to test with different providers 4 years ago
defltfips_test.c Test that EVP_default_properties_is_fips_enabled() works early 3 years ago
destest.c Update copyright year 3 years ago
dhtest.c Update copyright year 3 years ago
drbgtest.c Remove unused DRBG tests. 2 years ago
dsa_no_digest_size_test.c Update copyright year 3 years ago
dsatest.c Swap to FIPS186-2 DSA generation outside of the FIPS module 2 years ago
dtls_mtu_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
dtlstest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
dtlsv1listentest.c Following the license change, modify the boilerplates in test/ 4 years ago
ec_internal_test.c EC_KEY: add EC_KEY_decoded_from_explicit_params() 3 years ago
ecdsatest.c Add SM2 key management 3 years ago
ecdsatest.h Fix header file include guard names 4 years ago
ecstresstest.c Remove tab characters from C source files. 4 years ago
ectest.c Add Explicit EC parameter support to providers. 3 years ago
endecode_test.c TEST: Fix test/endecode_test.c for 'no-legacy' 2 years ago
endecoder_legacy_test.c Adapt everything else to the updated OSSL_ENCODER_CTX_new_by_EVP_PKEY() 2 years ago
enginetest.c EVP: deprecate the EVP_X_meth_ functions. 3 years ago
errtest.c TEST: Adapt test/errtest for the 'no-err' configuration 2 years ago
evp_extra_test.c Fix no-dh and no-dsa 2 years ago
evp_extra_test2.c Use adapted test_get_libctx() for simpler test setup and better error reporting 2 years ago
evp_fetch_prov_test.c Rename OPENSSL_CTX prefix to OSSL_LIB_CTX 2 years ago
evp_kdf_test.c Add EVP_KDF-X942 to the fips module 2 years ago
evp_libctx_test.c chacha20: Properly reinitialize the cipher context with NULL key 2 years ago
evp_pkey_dparams_test.c Add necessary checks of OPENSSL_NO_DH, OPENSSL_NO_DSA and OPENSSL_NO_EC 2 years ago
evp_pkey_provided_test.c Fix Segfault in EVP_PKEY_CTX_dup when the ctx has an undefined operation. 2 years ago
evp_test.c Deprecate EVP_KEY_new_CMAC_key and EVP_PKEY_new_CMAC_key_ex 2 years ago
exdatatest.c Update copyright year 3 years ago
exptest.c Following the license change, modify the boilerplates in test/ 4 years ago
fatalerrtest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
ffc_internal_test.c Deprecate more DH functions 2 years ago
filterprov.c Fix instances of pointer addition with the NULL pointer 2 years ago
fips-and-base.cnf Add CLI tests in FIPS configuration 3 years ago
fips.cnf Test that EVP_default_properties_is_fips_enabled() works early 3 years ago
generate_buildtest.pl Following the license change, modify the boilerplates in test/ 4 years ago
generate_ssl_tests.pl Update copyright year 3 years ago
gmdifftest.c Following the license change, modify the boilerplates in test/ 4 years ago
gosttest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
hexstr_test.c Change OPENSSL_hexstr2buf_ex() & OPENSSL_buf2hexstr_ex() to pass the separator 2 years ago
hmactest.c Update copyright year 3 years ago
http_test.c TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
ideatest.c Update copyright year 3 years ago
igetest.c Deprecate the AES_ige_*() functions 3 years ago
insta.priv.pem Chunk 11 of CMP contribution to OpenSSL: CMP command-line interface 3 years ago
insta_ca.cert.pem Chunk 11 of CMP contribution to OpenSSL: CMP command-line interface 3 years ago
keymgmt_internal_test.c Deprecate RSA harder 2 years ago
legacy.cnf test/recipes/30-test_evp.t: Modify to test with different providers 4 years ago
lhash_test.c Update copyright year 2 years ago
mdc2_internal_test.c Update copyright year 3 years ago
mdc2test.c Update copyright year 3 years ago
memleaktest.c test/memleaktest.c: Modify for use with address/leak sanitizer 3 years ago
modes_internal_test.c Update copyright year 3 years ago
moduleloadtest.c TEST: Add a simple module loader, and test the FIPS module with it 2 years ago
namemap_internal_test.c namemap: change ossl_namemap_empty() to do what the documentation says. 3 years ago
ocspapitest.c Fix safestack issues in x509.h 3 years ago
ossl_store_test.c STORE: clear err after ossl_store_get0_loader_int 2 years ago
p_test.c Make the naming scheme for dispatched functions more consistent 3 years ago
packettest.c Make the PACKET/WPACKET code available to both libcrypto and libssl 4 years ago
param_build_test.c params: add OSSL_PARAM helpers for time_t. 3 years ago
params_api_test.c params: add integer conversion test cases. 2 years ago
params_conversion_test.c Update copyright year 3 years ago
params_test.c Update copyright year 3 years ago
pbelutest.c Following the license change, modify the boilerplates in test/ 4 years ago
pem_read_depr_test.c Test various deprecated PEM_read_bio_* APIs 2 years ago
pemtest.c Following the license change, modify the boilerplates in test/ 4 years ago
pkcs7-1.pem
pkcs7.pem
pkcs12_format_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
pkey_meth_kdf_test.c Update copyright year 2 years ago
pkey_meth_test.c Update copyright year 3 years ago
pkits-test.pl Following the license change, modify the boilerplates in test/ 4 years ago
poly1305_internal_test.c Add ChaCha related ciphers to default provider 3 years ago
property_test.c Rename OPENSSL_CTX prefix to OSSL_LIB_CTX 2 years ago
provider_fallback_test.c Rename OPENSSL_CTX prefix to OSSL_LIB_CTX 2 years ago
provider_internal_test.c CORE: Separate OSSL_PROVIDER activation from OSSL_PROVIDER reference 2 years ago
provider_internal_test.cnf.in Use .cnf for config files, not .conf 3 years ago
provider_status_test.c Rename OPENSSL_CTX prefix to OSSL_LIB_CTX 2 years ago
provider_test.c Change OSSL_PARAM return size to not be a pointer. 4 years ago
proxy.cnf Cleanup cert config files for tests 3 years ago
rand_status_test.c rand: instantiate the DRBGs upon first use. 3 years ago
rc2test.c Update copyright year 3 years ago
rc4test.c Update copyright year 3 years ago
rc5test.c Update copyright year 3 years ago
rdrand_sanitytest.c Remove extern declarations of OPENSSL_ia32cap_P 4 years ago
recordlentest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
rsa_complex.c Following the license change, modify the boilerplates in test/ 4 years ago
rsa_mp_test.c Drop OPENSSL_NO_RSA everywhere 2 years ago
rsa_sp800_56b_test.c Drop OPENSSL_NO_RSA everywhere 2 years ago
rsa_test.c Drop OPENSSL_NO_RSA everywhere 2 years ago
run_tests.pl Make TAP::Harness and TAP::Parser optional. 2 years ago
sanitytest.c Following the license change, modify the boilerplates in test/ 4 years ago
secmemtest.c Update copyright year 3 years ago
serverinfo.pem
serverinfo2.pem Add a SERVERINFOV2 format test file 6 years ago
servername_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
session.pem Don't store the ticket nonce in the session 5 years ago
shibboleth.pfx
shlibloadtest.c TEST: Break out the local dynamic loading code from shlibloadtest.c 2 years ago
simpledynamic.c Fix simpledynamic.c - a typo and missed a header 2 years ago
simpledynamic.h Fix simpledynamic test compilation when condigured without DSO support. 2 years ago
siphash_internal_test.c Reorganize private crypto header files 4 years ago
sm2_internal_test.c Update copyright year 3 years ago
sm4_internal_test.c Reorganize private crypto header files 4 years ago
smcont.txt
smcont_zero.txt Tests for processing zero-length content in SMIME format 2 years ago
sparse_array_test.c Reorganize private crypto header files 4 years ago
srptest.c Following the license change, modify the boilerplates in test/ 4 years ago
ssl_cert_table_internal_test.c Reorganize local header files 4 years ago
ssl_ctx_test.c Update copyright year 3 years ago
ssl_old_test.c Drop OPENSSL_NO_RSA everywhere 2 years ago
ssl_test.c Use adapted test_get_libctx() for simpler test setup and better error reporting 2 years ago
ssl_test.tmpl
ssl_test_ctx_test.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
ssl_test_ctx_test.cnf Use .cnf for config files, not .conf 3 years ago
sslapitest.c Fix incomplete deprecation guard in test/sslapitest.c 2 years ago
sslbuffertest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
sslcorrupttest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
stack_test.c Update copyright year 2 years ago
sysdefault.cnf Apply system_default configuration on SSL_CTX_new(). 5 years ago
sysdefaulttest.c Following the license change, modify the boilerplates in test/ 4 years ago
test.cnf Add -section option to 'req' command 3 years ago
test_test.c Fix --strict-warnings build 4 years ago
testcrl.pem
testdsa.pem
testdsapub.pem
testec-p256.pem
testecpub-p256.pem
tested448.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
tested448pub.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
tested25519.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
tested25519pub.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
testp7.pem
testreq2.pem
testrsa.pem Support writing RSA keys using the traditional format again 3 years ago
testrsa2048.pem Add fips checks for rsa encryption 3 years ago
testrsapub.pem
testsid.pem
testutil.h TEST: move cert, key, and CSR loading aux functions to new testutil/load.c 2 years ago
testx509.pem Extend X509 cert checks and error reporting in v3_{purp,crld}.c and x509_{set,vfy}.c 3 years ago
threadstest.c Extend the threads test to add simple fetch from multi threads 2 years ago
time_offset_test.c Following the license change, modify the boilerplates in test/ 4 years ago
tls-provider.c Constify OSSL_FUNC_keymgmt_has() 2 years ago
tls13ccstest.c test cleanup: move helper .c and .h files to test/helpers/ 2 years ago
tls13encryptiontest.c Move MAC removal responsibility to the various protocol "enc" functions 3 years ago
tls13secretstest.c Clean away extraneous library specific FETCH_FAILED reason codes 2 years ago
uitest.c Update copyright year 2 years ago
v3-cert1.pem
v3-cert2.pem
v3_ca_exts.cnf make various test CA certs RFC 5280 compliant w.r.t. X509 extensions 2 years ago
v3ext.c Update copyright year 3 years ago
v3nametest.c v3nametest: Make the gennames structure static 2 years ago
verify_extra_test.c x509_vfy.c: Fix a regression in find_issuer() 2 years ago
versions.c Following the license change, modify the boilerplates in test/ 4 years ago
wpackettest.c WPACKET: don't write DER length when we don't want to 3 years ago
x509_check_cert_pkey_test.c Update copyright year 3 years ago
x509_dup_cert_test.c Update copyright year 3 years ago
x509_internal_test.c Join the x509 and x509v3 directories 4 years ago
x509_time_test.c Update copyright year 3 years ago
x509aux.c X509_cmp(): Fix comparison in case x509v3_cache_extensions() failed to due to invalid cert 2 years ago

README.md

Using OpenSSL Tests

After a successful build, and before installing, the libraries should be tested. Run:

$ make test                                      # Unix
$ mms test                                       ! OpenVMS
$ nmake test                                     # Windows

Warning: you MUST run the tests from an unprivileged account (or disable your privileges temporarily if your platform allows it).

If some tests fail, take a look at the section Test Failures below.

Test Failures

If some tests fail, look at the output. There may be reasons for the failure that isn't a problem in OpenSSL itself (like an OS malfunction or a Perl issue). You may want increased verbosity, that can be accomplished like this:

Full verbosity, showing full output of all successful and failed test cases (make macro VERBOSE or V):

$ make V=1 test                                  # Unix
$ mms /macro=(V=1) test                          ! OpenVMS
$ nmake V=1 test                                 # Windows

Verbosity on failed (sub-)tests only (VERBOSE_FAILURE or VF or REPORT_FAILURES):

$ make test VF=1

Verbosity on failed (sub-)tests, in addition progress on succeeded (sub-)tests (VERBOSE_FAILURE_PROGRESS or VFP or REPORT_FAILURES_PROGRESS):

$ make test VFP=1

If you want to run just one or a few specific tests, you can use the make variable TESTS to specify them, like this:

$ make TESTS='test_rsa test_dsa' test            # Unix
$ mms/macro="TESTS=test_rsa test_dsa" test       ! OpenVMS
$ nmake TESTS='test_rsa test_dsa' test           # Windows

And of course, you can combine (Unix examples shown):

$ make test TESTS='test_rsa test_dsa' VF=1
$ make test TESTS="test_cmp_*" VFP=1

You can find the list of available tests like this:

$ make list-tests                                # Unix
$ mms list-tests                                 ! OpenVMS
$ nmake list-tests                               # Windows

Have a look at the manual for the perl module Test::Harness to see what other HARNESS_* variables there are.

To report a bug please open an issue on GitHub, at https://github.com/openssl/openssl/issues.

For more details on how the make variables TESTS can be used, see section Running Selected Tests below.

Running Selected Tests

The make variable TESTS supports a versatile set of space separated tokens with which you can specify a set of tests to be performed. With a "current set of tests" in mind, initially being empty, here are the possible tokens:

 alltests      The current set of tests becomes the whole set of available
               tests (as listed when you do 'make list-tests' or similar).

 xxx           Adds the test 'xxx' to the current set of tests.

-xxx           Removes 'xxx' from the current set of tests.  If this is the
               first token in the list, the current set of tests is first
               assigned the whole set of available tests, effectively making
               this token equivalent to TESTS="alltests -xxx".

 nn            Adds the test group 'nn' (which is a number) to the current
               set of tests.

-nn            Removes the test group 'nn' from the current set of tests.
               If this is the first token in the list, the current set of
               tests is first assigned the whole set of available tests,
               effectively making this token equivalent to
               TESTS="alltests -xxx".

Also, all tokens except for "alltests" may have wildcards, such as *. (on Unix and Windows, BSD style wildcards are supported, while on VMS, it's VMS style wildcards)

Examples

Run all tests except for the fuzz tests:

$ make TESTS='-test_fuzz*' test

or, if you want to be explicit:

$ make TESTS='alltests -test_fuzz*' test

Run all tests that have a name starting with "test_ssl" but not those starting with "test_ssl_":

$ make TESTS='test_ssl* -test_ssl_*' test

Run only test group 10:

$ make TESTS='10' test

Run all tests except the slow group (group 99):

$ make TESTS='-99' test

Run all tests in test groups 80 to 99 except for tests in group 90:

$ make TESTS='[89]? -90' test

To run specific fuzz tests you can use for instance:

$ make test TESTS='test_fuzz_cmp test_fuzz_cms'

To stochastically verify that the algorithm that produces uniformly distributed random numbers is operating correctly (with a false positive rate of 0.01%):

$ ./util/wrap.sh test/bntest -stochastic

Running Tests in Parallel

By default the test harness will execute the selected tests sequentially. Depending on the platform characteristics, running more than one test job in parallel may speed up test execution. This can be requested by setting the HARNESS_JOBS environment variable to a positive integer value. This specifies the maximum number of test jobs to run in parallel.

Depending on the Perl version different strategies could be adopted to select which test recipes can be run in parallel. In recent versions of Perl, unless specified otherwise, any task can be run in parallel. Consult the documentation for TAP::Harness to know more.

To run up to four tests in parallel at any given time:

$ make HARNESS_JOBS=4 test

Randomisation of Test Ordering

By default, the test harness will execute tests in the order they were added. By setting the OPENSSL_TEST_RAND_ORDER environment variable to zero, the test ordering will be randomised. If a randomly ordered test fails, the seed value used will be reported. Setting the OPENSSL_TEST_RAND_ORDER environment variable to this value will rerun the tests in the same order. This assures repeatability of randomly ordered test runs. This repeatability is independent of the operating system, processor or platform used.

To randomise the test ordering:

$ make OPENSSL_TEST_RAND_ORDER=0 test

To run the tests using the order defined by the random seed 42:

$ make OPENSSL_TEST_RAND_ORDER=42 test