tree: abdb70d049b497e63fbce24d8717575bb3e89469 [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_dparams_test.c
  103. evp_pkey_provided_test.c
  104. evp_test.c
  105. exdatatest.c
  106. exptest.c
  107. fake_rsaprov.c
  108. fake_rsaprov.h
  109. fatalerrtest.c
  110. ffc_internal_test.c
  111. filterprov.c
  112. filterprov.h
  113. fips-alt.cnf
  114. fips-and-base.cnf
  115. fips.cnf
  116. generate_buildtest.pl
  117. generate_ssl_tests.pl
  118. gmdifftest.c
  119. hexstr_test.c
  120. hmactest.c
  121. http_test.c
  122. ideatest.c
  123. igetest.c
  124. insta.priv.pem
  125. insta_ca.cert.pem
  126. keymgmt_internal_test.c
  127. legacy.cnf
  128. lhash_test.c
  129. mdc2_internal_test.c
  130. mdc2test.c
  131. memleaktest.c
  132. modes_internal_test.c
  133. moduleloadtest.c
  134. namemap_internal_test.c
  135. ocspapitest.c
  136. ossl_store_test.c
  137. p_test.c
  138. packettest.c
  139. param_build_test.c
  140. params_api_test.c
  141. params_conversion_test.c
  142. params_test.c
  143. pbelutest.c
  144. pbetest.c
  145. pem_read_depr_test.c
  146. pemtest.c
  147. pkcs12_api_test.c
  148. pkcs12_format_test.c
  149. pkcs7-1.pem
  150. pkcs7.pem
  151. pkcs7_test.c
  152. pkey_meth_kdf_test.c
  153. pkey_meth_test.c
  154. pkits-test.pl
  155. poly1305_internal_test.c
  156. property_test.c
  157. prov_config_test.c
  158. provfetchtest.c
  159. provider_fallback_test.c
  160. provider_internal_test.c
  161. provider_internal_test.cnf.in
  162. provider_pkey_test.c
  163. provider_status_test.c
  164. provider_test.c
  165. proxy.cnf
  166. rand_status_test.c
  167. rand_test.c
  168. rc2test.c
  169. rc4test.c
  170. rc5test.c
  171. rdcpu_sanitytest.c
  172. README-dev.md
  173. README-external.md
  174. README.md
  175. README.ssltest.md
  176. recordlentest.c
  177. rsa_complex.c
  178. rsa_mp_test.c
  179. rsa_sp800_56b_test.c
  180. rsa_test.c
  181. run_tests.pl
  182. safe_math_test.c
  183. sanitytest.c
  184. secmemtest.c
  185. serverinfo.pem
  186. serverinfo2.pem
  187. servername_test.c
  188. session.pem
  189. sha_test.c
  190. shibboleth.pfx
  191. shlibloadtest.c
  192. simpledynamic.c
  193. simpledynamic.h
  194. siphash_internal_test.c
  195. sm2_internal_test.c
  196. sm3_internal_test.c
  197. sm4_internal_test.c
  198. smcont.bin
  199. smcont.txt
  200. smcont_zero.txt
  201. sparse_array_test.c
  202. srptest.c
  203. ssl_cert_table_internal_test.c
  204. ssl_ctx_test.c
  205. ssl_old_test.c
  206. ssl_test.c
  207. ssl_test.tmpl
  208. ssl_test_ctx_test.c
  209. ssl_test_ctx_test.cnf
  210. sslapitest.c
  211. sslbuffertest.c
  212. sslcorrupttest.c
  213. stack_test.c
  214. sysdefault.cnf
  215. sysdefaulttest.c
  216. test.cnf
  217. test_test.c
  218. testcrl.pem
  219. testdsa.pem
  220. testdsapub.pem
  221. testec-p256.pem
  222. testecpub-p256.pem
  223. tested25519.pem
  224. tested25519pub.pem
  225. tested448.pem
  226. tested448pub.pem
  227. testp7.pem
  228. testreq2.pem
  229. testrsa.pem
  230. testrsa2048.pem
  231. testrsa_withattrs.der
  232. testrsa_withattrs.pem
  233. testrsapss.pem
  234. testrsapssmandatory.pem
  235. testrsapub.pem
  236. testsid.pem
  237. testutil.h
  238. testx509.pem
  239. threadstest.c
  240. threadstest.h
  241. threadstest_fips.c
  242. time_offset_test.c
  243. tls-provider.c
  244. tls13ccstest.c
  245. tls13encryptiontest.c
  246. tls13secretstest.c
  247. uitest.c
  248. upcallstest.c
  249. user_property_test.c
  250. v3-cert1.pem
  251. v3-cert2.pem
  252. v3_ca_exts.cnf
  253. v3ext.c
  254. v3nametest.c
  255. verify_extra_test.c
  256. versions.c
  257. wpackettest.c
  258. x509_check_cert_pkey_test.c
  259. x509_dup_cert_test.c
  260. x509_internal_test.c
  261. x509_time_test.c
  262. 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