tree: 4148629039d79e3ab052b9b0623100e989126469 [path history] [tgz]
  1. certs/
  2. cms-msg/
  3. ct/
  4. d2i-tests/
  5. helpers/
  6. ocsp-tests/
  7. quic-openssl-docker/
  8. radix/
  9. recipes/
  10. smime-certs/
  11. smime-eml/
  12. ssl-tests/
  13. testutil/
  14. aborttest.c
  15. acvp_test.c
  16. acvp_test.inc
  17. aesgcmtest.c
  18. aeswrap_test.c
  19. algorithmid_test.c
  20. asn1_decode_test.c
  21. asn1_dsa_internal_test.c
  22. asn1_encode_test.c
  23. asn1_internal_test.c
  24. asn1_stable_parse_test.c
  25. asn1_string_table_test.c
  26. asn1_string_test.c
  27. asn1_time_test.c
  28. asynciotest.c
  29. asynctest.c
  30. bad_dtls_test.c
  31. base64_simdutf_test.c
  32. bftest.c
  33. bio_addr_test.c
  34. bio_base64_test.c
  35. bio_callback_test.c
  36. bio_comp_test.c
  37. bio_core_test.c
  38. bio_dgram_test.c
  39. bio_enc_test.c
  40. bio_eof_test.c
  41. bio_memleak_test.c
  42. bio_meth_test.c
  43. bio_prefix_text.c
  44. bio_pw_callback_test.c
  45. bio_readbuffer_test.c
  46. bio_tfo_test.c
  47. bioprinttest.c
  48. bn_internal_test.c
  49. bn_rand_range.h
  50. bntest.c
  51. bntests.pl
  52. build.info
  53. build_wincrypt_test.c
  54. byteorder_test.c
  55. ca-and-certs.cnf
  56. ca_internals_test.c
  57. casttest.c
  58. CAtsa.cnf
  59. cc_dummy.c
  60. cert_comp_test.c
  61. chacha_internal_test.c
  62. cipher_overhead_test.c
  63. cipherbytes_test.c
  64. cipherlist_test.c
  65. ciphername_test.c
  66. clienthellotest.c
  67. cmactest.c
  68. cmp_asn_test.c
  69. cmp_client_test.c
  70. cmp_ctx_test.c
  71. cmp_hdr_test.c
  72. cmp_msg_test.c
  73. cmp_protect_test.c
  74. cmp_server_test.c
  75. cmp_status_test.c
  76. cmp_vfy_test.c
  77. cms-examples.pl
  78. cmsapitest.c
  79. conf_include_test.c
  80. confdump.c
  81. constant_time_test.c
  82. context_internal_test.c
  83. crltest.c
  84. ct_test.c
  85. ctype_internal_test.c
  86. curve448_internal_test.c
  87. d2i_test.c
  88. dane-cross.in
  89. danetest.c
  90. danetest.in
  91. danetest.pem
  92. data.bin
  93. data2.bin
  94. decap_out.bin
  95. decoder_propq_test.c
  96. default-and-fips.cnf
  97. default-and-jitter.cnf
  98. default-and-legacy.cnf
  99. default-for-evptest.cnf
  100. default-recordpadding.cnf
  101. default.cnf
  102. defltfips_test.c
  103. destest.c
  104. dhkem_test.inc
  105. dhtest.c
  106. drbgtest.c
  107. dsa_no_digest_size_test.c
  108. dsatest.c
  109. dtls_mtu_test.c
  110. dtlstest.c
  111. dtlsv1listentest.c
  112. ec_internal_test.c
  113. ecdsatest.c
  114. ecdsatest.h
  115. ech_corrupt_test.c
  116. ech_test.c
  117. ecstresstest.c
  118. ectest.c
  119. encap_out.bin
  120. encap_secret.bin
  121. endecode_test.c
  122. endecoder_legacy_test.c
  123. engine_stubs_test.c
  124. errtest.c
  125. evp_byname_test.c
  126. evp_extra_test.c
  127. evp_extra_test2.c
  128. evp_fetch_prov_test.c
  129. evp_kdf_test.c
  130. evp_libctx_test.c
  131. evp_pkey_ctx_new_from_name.c
  132. evp_pkey_dhkem_test.c
  133. evp_pkey_dparams_test.c
  134. evp_pkey_provided_test.c
  135. evp_skey_test.c
  136. evp_test.c
  137. evp_xof_test.c
  138. exdatatest.c
  139. exptest.c
  140. ext_internal_test.c
  141. fake_cipherprov.c
  142. fake_cipherprov.h
  143. fake_pipelineprov.c
  144. fake_pipelineprov.h
  145. fake_rsaprov.c
  146. fake_rsaprov.h
  147. fatalerrtest.c
  148. ffc_internal_test.c
  149. filterprov.c
  150. filterprov.h
  151. fips-alt.cnf
  152. fips-and-base.cnf
  153. fips.cnf
  154. fips_version_test.c
  155. generate_buildtest.pl
  156. generate_ssl_tests.pl
  157. gmdifftest.c
  158. handshake-memfail.c
  159. hexstr_test.c
  160. hmactest.c
  161. hpke_test.c
  162. http_test.c
  163. ideatest.c
  164. igetest.c
  165. insta.priv.pem
  166. insta_ca.cert.pem
  167. invalid-x509.cnf
  168. json_test.c
  169. keymgmt_internal_test.c
  170. legacy.cnf
  171. lhash_test.c
  172. libctx_config_test.c
  173. list_test.c
  174. lms.inc
  175. lms_common.inc
  176. lms_parse.py
  177. lms_test.c
  178. localetest.c
  179. mdc2_internal_test.c
  180. mdc2test.c
  181. mem_alloc_custom_fns_test.c
  182. mem_alloc_test.c
  183. membio_test.c
  184. memleaktest.c
  185. ml_dsa.inc
  186. ml_dsa_test.c
  187. ml_kem_evp_extra_test.c
  188. ml_kem_internal_test.c
  189. mldsa_parse.py
  190. mldsa_wycheproof_parse.py
  191. mlkem_parse.py
  192. modes_internal_test.c
  193. moduleloadtest.c
  194. namemap_internal_test.c
  195. nocache-and-default.cnf
  196. nodefltctxtest.c
  197. null.cnf
  198. ocspapitest.c
  199. ossl_store_test.c
  200. p_minimal.c
  201. p_ossltest.c
  202. p_test.c
  203. packettest.c
  204. pairwise_fail_test.c
  205. param_build_test.c
  206. params_api_test.c
  207. params_conversion_test.c
  208. params_test.c
  209. pathed.cnf
  210. pbelutest.c
  211. pbetest.c
  212. pem_read_depr_test.c
  213. pemtest.c
  214. pkcs12_api_test.c
  215. pkcs12_format_test.c
  216. pkcs7-1.pem
  217. pkcs7.pem
  218. pkcs7_test.c
  219. pkey_meth_kdf_test.c
  220. pkits-test.pl
  221. poly1305_internal_test.c
  222. priority_queue_test.c
  223. property_test.c
  224. prov_config_test.c
  225. provfetchtest.c
  226. provider_default_search_path_test.c
  227. provider_fallback_test.c
  228. provider_internal_test.c
  229. provider_internal_test.cnf.in
  230. provider_pkey_test.c
  231. provider_status_test.c
  232. provider_test.c
  233. proxy.cnf
  234. punycode_test.c
  235. quic_ackm_test.c
  236. quic_cc_test.c
  237. quic_cfq_test.c
  238. quic_client_test.c
  239. quic_fc_test.c
  240. quic_fifd_test.c
  241. quic_lcidm_test.c
  242. quic_multistream_test.c
  243. quic_newcid_test.c
  244. quic_qlog_test.c
  245. quic_rcidm_test.c
  246. quic_record_test.c
  247. quic_record_test_util.h
  248. quic_srt_gen_test.c
  249. quic_srtm_test.c
  250. quic_stream_test.c
  251. quic_tserver_test.c
  252. quic_txp_test.c
  253. quic_txpim_test.c
  254. quic_wire_test.c
  255. quicapitest.c
  256. quicfaultstest.c
  257. rand_status_test.c
  258. rand_test.c
  259. rc2test.c
  260. rc4test.c
  261. rc5test.c
  262. rdcpu_sanitytest.c
  263. README-dev.md
  264. README-external.md
  265. README.md
  266. README.ssltest.md
  267. recordlentest.c
  268. recursive.cnf
  269. rpktest.c
  270. rsa_complex.c
  271. rsa_mp_test.c
  272. rsa_sp800_56b_test.c
  273. rsa_test.c
  274. rsa_x931_test.c
  275. run_tests.pl
  276. safe_math_test.c
  277. sanitytest.c
  278. secmemtest.c
  279. serverinfo.pem
  280. serverinfo2.pem
  281. servername_test.c
  282. sha_test.c
  283. shibboleth.pfx
  284. shlibloadtest.c
  285. simpledynamic.c
  286. simpledynamic.h
  287. siphash_internal_test.c
  288. slh_dsa.inc
  289. slh_dsa_test.c
  290. slhdsa_parse.py
  291. sm2_internal_test.c
  292. sm3_internal_test.c
  293. sm4_internal_test.c
  294. smcont.bin
  295. smcont.txt
  296. smcont_zero.txt
  297. sparse_array_test.c
  298. srptest.c
  299. ssl_cert_table_internal_test.c
  300. ssl_ctx_test.c
  301. ssl_handshake_rtt_test.c
  302. ssl_old_test.c
  303. ssl_test.c
  304. ssl_test.tmpl
  305. ssl_test_ctx_test.c
  306. ssl_test_ctx_test.cnf
  307. sslapitest.c
  308. sslbuffertest.c
  309. sslcorrupttest.c
  310. stack_test.c
  311. strtoultest.c
  312. sysdefaulttest.c
  313. test.cnf
  314. test_asn1_genconf.cnf
  315. test_asn1_parse.cnf
  316. test_test.c
  317. testcrl.pem
  318. testdsa.pem
  319. testdsapub.pem
  320. testec-p112r1.pem
  321. testec-p256.pem
  322. testec-sm2.pem
  323. testecpub-p256.pem
  324. tested25519.pem
  325. tested25519pub.pem
  326. tested448.pem
  327. tested448pub.pem
  328. testmldsa44.pem
  329. testmldsa44pub.pem
  330. testmldsa65.pem
  331. testmldsa65pub.pem
  332. testmldsa87.pem
  333. testmldsa87pub.pem
  334. testp7.pem
  335. testreq2.pem
  336. testrsa.pem
  337. testrsa2048.pem
  338. testrsa2048pub.pem
  339. testrsa_withattrs.der
  340. testrsa_withattrs.pem
  341. testrsapss.pem
  342. testrsapssmandatory.pem
  343. testrsapub.pem
  344. testsid.pem
  345. testutil.h
  346. testx509.pem
  347. threadpool_test.c
  348. threadstest.c
  349. threadstest.h
  350. threadstest_fips.c
  351. time_offset_test.c
  352. time_test.c
  353. timing_load_creds.c
  354. tls-max-v11.cnf
  355. tls-max-v12.cnf
  356. tls-provider.c
  357. tls13ccstest.c
  358. tls13encryptiontest.c
  359. tls13groupselection_test.c
  360. tls13secretstest.c
  361. trace_api_test.c
  362. uitest.c
  363. upcallstest.c
  364. user_property_test.c
  365. v3-cert1.pem
  366. v3-cert2.pem
  367. v3_ca_exts.cnf
  368. v3ext.c
  369. v3nametest.c
  370. verify_extra_test.c
  371. versions.c
  372. wpackettest.c
  373. x509_acert_test.c
  374. x509_check_cert_pkey_test.c
  375. x509_dup_cert_test.c
  376. x509_internal_test.c
  377. x509_load_cert_file_test.c
  378. x509_memfail.c
  379. x509_req_test.c
  380. x509_test.c
  381. x509_time_test.c
  382. 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

Random numbers in tests

Some tests use random numbers as part of the test. In some cases a test failure may occur for some random numbers, but not for others. The seed used for the rand number generator can be set via the OPENSSL_TEST_RAND_SEED environment variable. It can also be set via the OPENSSL_TEST_RAND_ORDER environment variable which additionally randomises the order tests are run in (see below).

When a test fails the test harness will display the seed used during the test (displaying either the OPENSSL_TEST_RAND_SEED or OPENSSL_TEST_RAND_ORDER environment variable value that must be used to recreate the results), e.g.

$ make OPENSSL_TEST_RAND_SEED=42 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. This additionally seeds the random number generator used within the tests as described in the section above. 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 and will also seed the test random number generator. 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

Running Tests under Valgrind

Normally, testing for memory leaks is accomplished by building Openssl with the enable-asan option, which links the library with the compiler asan library. However some people prefer to use valgrind to do dynamic instrumentation for memory leak checking. OpenSSL also offers a suppression file to suppress reachable memory leaks, that are often inappropriately considered to be true leaks. In order to maintain and test this suppression file, OpenSSL tests can be run under valgrind automatically.

To run the test suite under valgrind:

$ make OSSL_USE_VALGRIND=yes test

Doing so will create valgrind.log file for each test under the test-runs subdirectory.