tree: ccfaa19f442a5f03aea02f0bc3211f367fdf3aea [path history] [tgz]
  1. certs/
  2. ct/
  3. d2i-tests/
  4. helpers/
  5. ocsp-tests/
  6. recipes/
  7. smime-certs/
  8. ssl-tests/
  9. testutil/
  10. aborttest.c
  11. acvp_test.c
  12. acvp_test.inc
  13. aesgcmtest.c
  14. afalgtest.c
  15. algorithmid_test.c
  16. asn1_decode_test.c
  17. asn1_dsa_internal_test.c
  18. asn1_encode_test.c
  19. asn1_internal_test.c
  20. asn1_string_table_test.c
  21. asn1_time_test.c
  22. asynciotest.c
  23. asynctest.c
  24. bad_dtls_test.c
  25. bftest.c
  26. bio_callback_test.c
  27. bio_core_test.c
  28. bio_enc_test.c
  29. bio_memleak_test.c
  30. bio_prefix_text.c
  31. bio_readbuffer_test.c
  32. bio_tfo_test.c
  33. bioprinttest.c
  34. bn_internal_test.c
  35. bn_rand_range.h
  36. bntest.c
  37. bntests.pl
  38. build.info
  39. ca-and-certs.cnf
  40. ca_internals_test.c
  41. casttest.c
  42. CAtsa.cnf
  43. chacha_internal_test.c
  44. cipher_overhead_test.c
  45. cipherbytes_test.c
  46. cipherlist_test.c
  47. ciphername_test.c
  48. clienthellotest.c
  49. cmactest.c
  50. cmp_asn_test.c
  51. cmp_client_test.c
  52. cmp_ctx_test.c
  53. cmp_hdr_test.c
  54. cmp_msg_test.c
  55. cmp_protect_test.c
  56. cmp_server_test.c
  57. cmp_status_test.c
  58. cmp_vfy_test.c
  59. cms-examples.pl
  60. cmsapitest.c
  61. conf_include_test.c
  62. confdump.c
  63. constant_time_test.c
  64. context_internal_test.c
  65. crltest.c
  66. ct_test.c
  67. ctype_internal_test.c
  68. curve448_internal_test.c
  69. d2i_test.c
  70. dane-cross.in
  71. danetest.c
  72. danetest.in
  73. danetest.pem
  74. data.bin
  75. data2.bin
  76. default-and-fips.cnf
  77. default-and-legacy.cnf
  78. default.cnf
  79. defltfips_test.c
  80. destest.c
  81. dhtest.c
  82. drbgtest.c
  83. dsa_no_digest_size_test.c
  84. dsatest.c
  85. dtls_mtu_test.c
  86. dtlstest.c
  87. dtlsv1listentest.c
  88. ec_internal_test.c
  89. ecdsatest.c
  90. ecdsatest.h
  91. ecstresstest.c
  92. ectest.c
  93. endecode_test.c
  94. endecoder_legacy_test.c
  95. enginetest.c
  96. errtest.c
  97. evp_extra_test.c
  98. evp_extra_test2.c
  99. evp_fetch_prov_test.c
  100. evp_kdf_test.c
  101. evp_libctx_test.c
  102. evp_pkey_ctx_new_from_name.c
  103. evp_pkey_dparams_test.c
  104. evp_pkey_provided_test.c
  105. evp_test.c
  106. exdatatest.c
  107. exptest.c
  108. fake_rsaprov.c
  109. fake_rsaprov.h
  110. fatalerrtest.c
  111. ffc_internal_test.c
  112. filterprov.c
  113. filterprov.h
  114. fips-alt.cnf
  115. fips-and-base.cnf
  116. fips.cnf
  117. generate_buildtest.pl
  118. generate_ssl_tests.pl
  119. gmdifftest.c
  120. hexstr_test.c
  121. hmactest.c
  122. http_test.c
  123. ideatest.c
  124. igetest.c
  125. insta.priv.pem
  126. insta_ca.cert.pem
  127. keymgmt_internal_test.c
  128. legacy.cnf
  129. lhash_test.c
  130. localetest.c
  131. mdc2_internal_test.c
  132. mdc2test.c
  133. memleaktest.c
  134. modes_internal_test.c
  135. moduleloadtest.c
  136. namemap_internal_test.c
  137. ocspapitest.c
  138. ossl_store_test.c
  139. p_test.c
  140. packettest.c
  141. param_build_test.c
  142. params_api_test.c
  143. params_conversion_test.c
  144. params_test.c
  145. pbelutest.c
  146. pbetest.c
  147. pem_read_depr_test.c
  148. pemtest.c
  149. pkcs12_api_test.c
  150. pkcs12_format_test.c
  151. pkcs7-1.pem
  152. pkcs7.pem
  153. pkcs7_test.c
  154. pkey_meth_kdf_test.c
  155. pkey_meth_test.c
  156. pkits-test.pl
  157. poly1305_internal_test.c
  158. property_test.c
  159. prov_config_test.c
  160. provfetchtest.c
  161. provider_fallback_test.c
  162. provider_internal_test.c
  163. provider_internal_test.cnf.in
  164. provider_pkey_test.c
  165. provider_status_test.c
  166. provider_test.c
  167. proxy.cnf
  168. rand_status_test.c
  169. rand_test.c
  170. rc2test.c
  171. rc4test.c
  172. rc5test.c
  173. rdcpu_sanitytest.c
  174. README-dev.md
  175. README-external.md
  176. README.md
  177. README.ssltest.md
  178. recordlentest.c
  179. rsa_complex.c
  180. rsa_mp_test.c
  181. rsa_sp800_56b_test.c
  182. rsa_test.c
  183. run_tests.pl
  184. safe_math_test.c
  185. sanitytest.c
  186. secmemtest.c
  187. serverinfo.pem
  188. serverinfo2.pem
  189. servername_test.c
  190. session.pem
  191. sha_test.c
  192. shibboleth.pfx
  193. shlibloadtest.c
  194. simpledynamic.c
  195. simpledynamic.h
  196. siphash_internal_test.c
  197. sm2_internal_test.c
  198. sm3_internal_test.c
  199. sm4_internal_test.c
  200. smcont.bin
  201. smcont.txt
  202. smcont_zero.txt
  203. sparse_array_test.c
  204. srptest.c
  205. ssl_cert_table_internal_test.c
  206. ssl_ctx_test.c
  207. ssl_old_test.c
  208. ssl_test.c
  209. ssl_test.tmpl
  210. ssl_test_ctx_test.c
  211. ssl_test_ctx_test.cnf
  212. sslapitest.c
  213. sslbuffertest.c
  214. sslcorrupttest.c
  215. stack_test.c
  216. sysdefault.cnf
  217. sysdefaulttest.c
  218. test.cnf
  219. test_test.c
  220. testcrl.pem
  221. testdsa.pem
  222. testdsapub.pem
  223. testec-p256.pem
  224. testecpub-p256.pem
  225. tested25519.pem
  226. tested25519pub.pem
  227. tested448.pem
  228. tested448pub.pem
  229. testp7.pem
  230. testreq2.pem
  231. testrsa.pem
  232. testrsa2048.pem
  233. testrsa_withattrs.der
  234. testrsa_withattrs.pem
  235. testrsapss.pem
  236. testrsapssmandatory.pem
  237. testrsapub.pem
  238. testsid.pem
  239. testutil.h
  240. testx509.pem
  241. threadstest.c
  242. threadstest.h
  243. threadstest_fips.c
  244. time_offset_test.c
  245. tls-provider.c
  246. tls13ccstest.c
  247. tls13encryptiontest.c
  248. tls13secretstest.c
  249. uitest.c
  250. upcallstest.c
  251. user_property_test.c
  252. v3-cert1.pem
  253. v3-cert2.pem
  254. v3_ca_exts.cnf
  255. v3ext.c
  256. v3nametest.c
  257. verify_extra_test.c
  258. versions.c
  259. wpackettest.c
  260. x509_check_cert_pkey_test.c
  261. x509_dup_cert_test.c
  262. x509_internal_test.c
  263. x509_time_test.c
  264. x509aux.c
test/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