slontis d60b37506d Fix BIO_get_new_index() to return an error when it is exhausted. | 8 mēneši atpakaļ | |
---|---|---|
.. | ||
certs | 1 gadu atpakaļ | |
ct | 3 gadi atpakaļ | |
d2i-tests | 8 gadi atpakaļ | |
helpers | 8 mēneši atpakaļ | |
ocsp-tests | 7 gadi atpakaļ | |
recipes | 8 mēneši atpakaļ | |
smime-certs | 11 mēneši atpakaļ | |
smime-eml | 1 gadu atpakaļ | |
ssl-tests | 10 mēneši atpakaļ | |
testutil | 1 gadu atpakaļ | |
CAtsa.cnf | 1 gadu atpakaļ | |
README-dev.md | 1 gadu atpakaļ | |
README-external.md | 1 gadu atpakaļ | |
README.md | 11 mēneši atpakaļ | |
README.ssltest.md | 2 gadi atpakaļ | |
aborttest.c | 6 gadi atpakaļ | |
acvp_test.c | 2 gadi atpakaļ | |
acvp_test.inc | 3 gadi atpakaļ | |
aesgcmtest.c | 2 gadi atpakaļ | |
afalgtest.c | 1 gadu atpakaļ | |
algorithmid_test.c | 3 gadi atpakaļ | |
asn1_decode_test.c | 8 mēneši atpakaļ | |
asn1_dsa_internal_test.c | 4 gadi atpakaļ | |
asn1_encode_test.c | 3 gadi atpakaļ | |
asn1_internal_test.c | 1 gadu atpakaļ | |
asn1_stable_parse_test.c | 10 mēneši atpakaļ | |
asn1_string_table_test.c | 6 gadi atpakaļ | |
asn1_time_test.c | 8 mēneši atpakaļ | |
asynciotest.c | 4 gadi atpakaļ | |
asynctest.c | 2 gadi atpakaļ | |
bad_dtls_test.c | 2 gadi atpakaļ | |
bftest.c | 3 gadi atpakaļ | |
bio_addr_test.c | 1 gadu atpakaļ | |
bio_callback_test.c | 3 gadi atpakaļ | |
bio_comp_test.c | 2 gadi atpakaļ | |
bio_core_test.c | 1 gadu atpakaļ | |
bio_dgram_test.c | 1 gadu atpakaļ | |
bio_enc_test.c | 2 gadi atpakaļ | |
bio_memleak_test.c | 1 gadu atpakaļ | |
bio_meth_test.c | 8 mēneši atpakaļ | |
bio_prefix_text.c | 3 gadi atpakaļ | |
bio_readbuffer_test.c | 3 gadi atpakaļ | |
bio_tfo_test.c | 2 gadi atpakaļ | |
bioprinttest.c | 4 gadi atpakaļ | |
bn_internal_test.c | 3 gadi atpakaļ | |
bn_rand_range.h | 5 gadi atpakaļ | |
bntest.c | 11 mēneši atpakaļ | |
bntests.pl | 6 gadi atpakaļ | |
build.info | 8 mēneši atpakaļ | |
build_wincrypt_test.c | 1 gadu atpakaļ | |
ca-and-certs.cnf | 1 gadu atpakaļ | |
ca_internals_test.c | 2 gadi atpakaļ | |
casttest.c | 4 gadi atpakaļ | |
cc_dummy.c | 1 gadu atpakaļ | |
cert_comp_test.c | 2 gadi atpakaļ | |
chacha_internal_test.c | 1 gadu atpakaļ | |
cipher_overhead_test.c | 3 gadi atpakaļ | |
cipherbytes_test.c | 4 gadi atpakaļ | |
cipherlist_test.c | 3 gadi atpakaļ | |
ciphername_test.c | 4 gadi atpakaļ | |
clienthellotest.c | 3 gadi atpakaļ | |
cmactest.c | 1 gadu atpakaļ | |
cmp_asn_test.c | 1 gadu atpakaļ | |
cmp_client_test.c | 10 mēneši atpakaļ | |
cmp_ctx_test.c | 11 mēneši atpakaļ | |
cmp_hdr_test.c | 1 gadu atpakaļ | |
cmp_msg_test.c | 1 gadu atpakaļ | |
cmp_protect_test.c | 1 gadu atpakaļ | |
cmp_server_test.c | 10 mēneši atpakaļ | |
cmp_status_test.c | 2 gadi atpakaļ | |
cmp_vfy_test.c | 1 gadu atpakaļ | |
cms-examples.pl | 6 gadi atpakaļ | |
cmsapitest.c | 1 gadu atpakaļ | |
conf_include_test.c | 1 gadu atpakaļ | |
confdump.c | 3 gadi atpakaļ | |
constant_time_test.c | 3 gadi atpakaļ | |
context_internal_test.c | 2 gadi atpakaļ | |
crltest.c | 2 gadi atpakaļ | |
ct_test.c | 2 gadi atpakaļ | |
ctype_internal_test.c | 5 gadi atpakaļ | |
curve448_internal_test.c | 1 gadu atpakaļ | |
d2i_test.c | 4 gadi atpakaļ | |
dane-cross.in | 2 gadi atpakaļ | |
danetest.c | 2 gadi atpakaļ | |
danetest.in | 11 mēneši atpakaļ | |
danetest.pem | 8 gadi atpakaļ | |
data.bin | 4 gadi atpakaļ | |
data2.bin | 3 gadi atpakaļ | |
decoder_propq_test.c | 1 gadu atpakaļ | |
default-and-fips.cnf | 10 mēneši atpakaļ | |
default-and-legacy.cnf | 3 gadi atpakaļ | |
default.cnf | 10 mēneši atpakaļ | |
defltfips_test.c | 2 gadi atpakaļ | |
destest.c | 1 gadu atpakaļ | |
dhkem_test.inc | 1 gadu atpakaļ | |
dhtest.c | 1 gadu atpakaļ | |
drbgtest.c | 1 gadu atpakaļ | |
dsa_no_digest_size_test.c | 4 gadi atpakaļ | |
dsatest.c | 1 gadu atpakaļ | |
dtls_mtu_test.c | 2 gadi atpakaļ | |
dtlstest.c | 1 gadu atpakaļ | |
dtlsv1listentest.c | 6 gadi atpakaļ | |
ec_internal_test.c | 2 gadi atpakaļ | |
ecdsatest.c | 1 gadu atpakaļ | |
ecdsatest.h | 5 gadi atpakaļ | |
ecstresstest.c | 3 gadi atpakaļ | |
ectest.c | 1 gadu atpakaļ | |
endecode_test.c | 1 gadu atpakaļ | |
endecoder_legacy_test.c | 3 gadi atpakaļ | |
enginetest.c | 2 gadi atpakaļ | |
errtest.c | 1 gadu atpakaļ | |
event_queue_test.c | 2 gadi atpakaļ | |
evp_extra_test.c | 9 mēneši atpakaļ | |
evp_extra_test2.c | 10 mēneši atpakaļ | |
evp_fetch_prov_test.c | 10 mēneši atpakaļ | |
evp_kdf_test.c | 10 mēneši atpakaļ | |
evp_libctx_test.c | 9 mēneši atpakaļ | |
evp_pkey_ctx_new_from_name.c | 2 gadi atpakaļ | |
evp_pkey_dhkem_test.c | 1 gadu atpakaļ | |
evp_pkey_dparams_test.c | 2 gadi atpakaļ | |
evp_pkey_provided_test.c | 9 mēneši atpakaļ | |
evp_test.c | 9 mēneši atpakaļ | |
evp_xof_test.c | 1 gadu atpakaļ | |
exdatatest.c | 3 gadi atpakaļ | |
exptest.c | 1 gadu atpakaļ | |
ext_internal_test.c | 1 gadu atpakaļ | |
fake_rsaprov.c | 1 gadu atpakaļ | |
fake_rsaprov.h | 1 gadu atpakaļ | |
fatalerrtest.c | 4 gadi atpakaļ | |
ffc_internal_test.c | 1 gadu atpakaļ | |
filterprov.c | 1 gadu atpakaļ | |
filterprov.h | 3 gadi atpakaļ | |
fips-alt.cnf | 3 gadi atpakaļ | |
fips-and-base.cnf | 1 gadu atpakaļ | |
fips.cnf | 3 gadi atpakaļ | |
fips_version_test.c | 2 gadi atpakaļ | |
generate_buildtest.pl | 6 gadi atpakaļ | |
generate_ssl_tests.pl | 3 gadi atpakaļ | |
gmdifftest.c | 3 gadi atpakaļ | |
hexstr_test.c | 3 gadi atpakaļ | |
hmactest.c | 2 gadi atpakaļ | |
hpke_test.c | 1 gadu atpakaļ | |
http_test.c | 11 mēneši atpakaļ | |
ideatest.c | 4 gadi atpakaļ | |
igetest.c | 5 gadi atpakaļ | |
insta.priv.pem | 3 gadi atpakaļ | |
insta_ca.cert.pem | 3 gadi atpakaļ | |
invalid-x509.cnf | 10 mēneši atpakaļ | |
json_test.c | 8 mēneši atpakaļ | |
keymgmt_internal_test.c | 9 mēneši atpakaļ | |
legacy.cnf | 3 gadi atpakaļ | |
lhash_test.c | 2 gadi atpakaļ | |
list_test.c | 2 gadi atpakaļ | |
localetest.c | 2 gadi atpakaļ | |
mdc2_internal_test.c | 4 gadi atpakaļ | |
mdc2test.c | 2 gadi atpakaļ | |
membio_test.c | 1 gadu atpakaļ | |
memleaktest.c | 3 gadi atpakaļ | |
modes_internal_test.c | 3 gadi atpakaļ | |
moduleloadtest.c | 3 gadi atpakaļ | |
namemap_internal_test.c | 3 gadi atpakaļ | |
nodefltctxtest.c | 1 gadu atpakaļ | |
null.cnf | 1 gadu atpakaļ | |
ocspapitest.c | 1 gadu atpakaļ | |
ossl_store_test.c | 3 gadi atpakaļ | |
p_minimal.c | 11 mēneši atpakaļ | |
p_test.c | 1 gadu atpakaļ | |
packettest.c | 1 gadu atpakaļ | |
pairwise_fail_test.c | 8 mēneši atpakaļ | |
param_build_test.c | 1 gadu atpakaļ | |
params_api_test.c | 10 mēneši atpakaļ | |
params_conversion_test.c | 2 gadi atpakaļ | |
params_test.c | 9 mēneši atpakaļ | |
pbelutest.c | 6 gadi atpakaļ | |
pbetest.c | 1 gadu atpakaļ | |
pem_read_depr_test.c | 3 gadi atpakaļ | |
pemtest.c | 1 gadu atpakaļ | |
pkcs12_api_test.c | 1 gadu atpakaļ | |
pkcs12_format_test.c | 1 gadu atpakaļ | |
pkcs7-1.pem | 26 gadi atpakaļ | |
pkcs7.pem | 26 gadi atpakaļ | |
pkcs7_test.c | 3 gadi atpakaļ | |
pkey_meth_kdf_test.c | 4 gadi atpakaļ | |
pkey_meth_test.c | 4 gadi atpakaļ | |
pkits-test.pl | 6 gadi atpakaļ | |
poly1305_internal_test.c | 5 gadi atpakaļ | |
priority_queue_test.c | 1 gadu atpakaļ | |
property_test.c | 11 mēneši atpakaļ | |
prov_config_test.c | 10 mēneši atpakaļ | |
provfetchtest.c | 1 gadu atpakaļ | |
provider_default_search_path_test.c | 1 gadu atpakaļ | |
provider_fallback_test.c | 3 gadi atpakaļ | |
provider_internal_test.c | 1 gadu atpakaļ | |
provider_internal_test.cnf.in | 3 gadi atpakaļ | |
provider_pkey_test.c | 1 gadu atpakaļ | |
provider_status_test.c | 3 gadi atpakaļ | |
provider_test.c | 1 gadu atpakaļ | |
proxy.cnf | 3 gadi atpakaļ | |
punycode_test.c | 1 gadu atpakaļ | |
quic_ackm_test.c | 1 gadu atpakaļ | |
quic_cc_test.c | 1 gadu atpakaļ | |
quic_cfq_test.c | 1 gadu atpakaļ | |
quic_client_test.c | 1 gadu atpakaļ | |
quic_fc_test.c | 8 mēneši atpakaļ | |
quic_fifd_test.c | 8 mēneši atpakaļ | |
quic_lcidm_test.c | 11 mēneši atpakaļ | |
quic_multistream_test.c | 8 mēneši atpakaļ | |
quic_newcid_test.c | 1 gadu atpakaļ | |
quic_qlog_test.c | 8 mēneši atpakaļ | |
quic_rcidm_test.c | 10 mēneši atpakaļ | |
quic_record_test.c | 10 mēneši atpakaļ | |
quic_record_test_util.h | 1 gadu atpakaļ | |
quic_srt_gen_test.c | 11 mēneši atpakaļ | |
quic_srtm_test.c | 11 mēneši atpakaļ | |
quic_stream_test.c | 1 gadu atpakaļ | |
quic_tserver_test.c | 1 gadu atpakaļ | |
quic_txp_test.c | 10 mēneši atpakaļ | |
quic_txpim_test.c | 2 gadi atpakaļ | |
quic_wire_test.c | 1 gadu atpakaļ | |
quicapitest.c | 8 mēneši atpakaļ | |
quicfaultstest.c | 8 mēneši atpakaļ | |
rand_status_test.c | 4 gadi atpakaļ | |
rand_test.c | 1 gadu atpakaļ | |
rc2test.c | 4 gadi atpakaļ | |
rc4test.c | 4 gadi atpakaļ | |
rc5test.c | 4 gadi atpakaļ | |
rdcpu_sanitytest.c | 2 gadi atpakaļ | |
recordlentest.c | 1 gadu atpakaļ | |
recursive.cnf | 10 mēneši atpakaļ | |
rpktest.c | 1 gadu atpakaļ | |
rsa_complex.c | 2 gadi atpakaļ | |
rsa_mp_test.c | 1 gadu atpakaļ | |
rsa_sp800_56b_test.c | 1 gadu atpakaļ | |
rsa_test.c | 1 gadu atpakaļ | |
rsa_x931_test.c | 1 gadu atpakaļ | |
run_tests.pl | 10 mēneši atpakaļ | |
safe_math_test.c | 2 gadi atpakaļ | |
sanitytest.c | 1 gadu atpakaļ | |
secmemtest.c | 2 gadi atpakaļ | |
serverinfo.pem | 11 gadi atpakaļ | |
serverinfo2.pem | 7 gadi atpakaļ | |
servername_test.c | 3 gadi atpakaļ | |
session.pem | 6 gadi atpakaļ | |
sha_test.c | 3 gadi atpakaļ | |
shibboleth.pfx | 8 gadi atpakaļ | |
shlibloadtest.c | 3 gadi atpakaļ | |
simpledynamic.c | 3 gadi atpakaļ | |
simpledynamic.h | 3 gadi atpakaļ | |
siphash_internal_test.c | 9 mēneši atpakaļ | |
sm2_internal_test.c | 3 gadi atpakaļ | |
sm3_internal_test.c | 2 gadi atpakaļ | |
sm4_internal_test.c | 3 gadi atpakaļ | |
smcont.bin | 3 gadi atpakaļ | |
smcont.txt | 8 gadi atpakaļ | |
smcont_zero.txt | 4 gadi atpakaļ | |
sparse_array_test.c | 3 gadi atpakaļ | |
srptest.c | 3 gadi atpakaļ | |
ssl_cert_table_internal_test.c | 2 gadi atpakaļ | |
ssl_ctx_test.c | 1 gadu atpakaļ | |
ssl_handshake_rtt_test.c | 1 gadu atpakaļ | |
ssl_old_test.c | 10 mēneši atpakaļ | |
ssl_test.c | 1 gadu atpakaļ | |
ssl_test.tmpl | 8 gadi atpakaļ | |
ssl_test_ctx_test.c | 4 gadi atpakaļ | |
ssl_test_ctx_test.cnf | 4 gadi atpakaļ | |
sslapitest.c | 8 mēneši atpakaļ | |
sslbuffertest.c | 1 gadu atpakaļ | |
sslcorrupttest.c | 2 gadi atpakaļ | |
stack_test.c | 3 gadi atpakaļ | |
sysdefault.cnf | 11 mēneši atpakaļ | |
sysdefaulttest.c | 6 gadi atpakaļ | |
test.cnf | 3 gadi atpakaļ | |
test_asn1_parse.cnf | 11 mēneši atpakaļ | |
test_test.c | 2 gadi atpakaļ | |
testcrl.pem | 26 gadi atpakaļ | |
testdsa.pem | 9 gadi atpakaļ | |
testdsapub.pem | 9 gadi atpakaļ | |
testec-p112r1.pem | 2 gadi atpakaļ | |
testec-p256.pem | 9 gadi atpakaļ | |
testecpub-p256.pem | 9 gadi atpakaļ | |
tested25519.pem | 4 gadi atpakaļ | |
tested25519pub.pem | 4 gadi atpakaļ | |
tested448.pem | 4 gadi atpakaļ | |
tested448pub.pem | 4 gadi atpakaļ | |
testp7.pem | 24 gadi atpakaļ | |
testreq2.pem | 26 gadi atpakaļ | |
testrsa.pem | 4 gadi atpakaļ | |
testrsa2048.pem | 4 gadi atpakaļ | |
testrsa2048pub.pem | 2 gadi atpakaļ | |
testrsa_withattrs.der | 3 gadi atpakaļ | |
testrsa_withattrs.pem | 3 gadi atpakaļ | |
testrsapss.pem | 3 gadi atpakaļ | |
testrsapssmandatory.pem | 3 gadi atpakaļ | |
testrsapub.pem | 9 gadi atpakaļ | |
testsid.pem | 3 gadi atpakaļ | |
testutil.h | 1 gadu atpakaļ | |
testx509.pem | 4 gadi atpakaļ | |
threadpool_test.c | 2 gadi atpakaļ | |
threadstest.c | 9 mēneši atpakaļ | |
threadstest.h | 3 gadi atpakaļ | |
threadstest_fips.c | 3 gadi atpakaļ | |
time_offset_test.c | 6 gadi atpakaļ | |
time_test.c | 1 gadu atpakaļ | |
timing_load_creds.c | 1 gadu atpakaļ | |
tls-provider.c | 8 mēneši atpakaļ | |
tls13ccstest.c | 1 gadu atpakaļ | |
tls13encryptiontest.c | 9 mēneši atpakaļ | |
tls13secretstest.c | 1 gadu atpakaļ | |
trace_api_test.c | 1 gadu atpakaļ | |
uitest.c | 2 gadi atpakaļ | |
upcallstest.c | 1 gadu atpakaļ | |
user_property_test.c | 1 gadu atpakaļ | |
v3-cert1.pem | 26 gadi atpakaļ | |
v3-cert2.pem | 26 gadi atpakaļ | |
v3_ca_exts.cnf | 3 gadi atpakaļ | |
v3ext.c | 2 gadi atpakaļ | |
v3nametest.c | 1 gadu atpakaļ | |
verify_extra_test.c | 2 gadi atpakaļ | |
versions.c | 6 gadi atpakaļ | |
wpackettest.c | 1 gadu atpakaļ | |
x509_check_cert_pkey_test.c | 1 gadu atpakaļ | |
x509_dup_cert_test.c | 3 gadi atpakaļ | |
x509_internal_test.c | 3 gadi atpakaļ | |
x509_load_cert_file_test.c | 8 mēneši atpakaļ | |
x509_test.c | 2 gadi atpakaļ | |
x509_time_test.c | 8 mēneši atpakaļ | |
x509aux.c | 2 gadi atpakaļ |
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/build.info. Please refer to the section "Changes to test/build.info" below.
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:
00-04 sanity, internal and essential API tests
05-09 individual symmetric cipher algorithms
10-14 math (bignum)
15-19 individual asymmetric cipher algorithms
20-24 openssl commands (some otherwise not tested)
25-29 certificate forms, generation and verification
30-35 engine and evp
60-79 APIs:
60 X509 subsystem
61 BIO subsystem
65 CMP subsystem
70 PACKET layer
80-89 "larger" protocols (CA, CMS, OCSP, SSL, TSA)
90-98 misc
99 most time consuming tests [such as test_fuzz]
A script that just runs a program looks like this:
#! /usr/bin/env 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 util/perl/OpenSSL/Test/Simple.pm
.
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 util/perl/OpenSSL/Test.pm
.
A script to start from could be this:
#! /usr/bin/env 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
}
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):
add {name}
to the list of programs under PROGRAMS_NO_INST
create a three line description of how to build the test, you will have to modify the include paths and source files if you don't want to use the basic test framework:
SOURCE[{name}]={name}.c INCLUDE[{name}]=.. ../include ../apps/include DEPEND[{name}]=../libcrypto libtestutil.a
#include "testutil.h"
static int my_test(void)
{
int testresult = 0; /* Assume the test will fail */
int observed;
observed = function(); /* Call the code under test */
if (!TEST_int_eq(observed, 2)) /* Check the result is correct */
goto end; /* Exit on failure - optional */
testresult = 1; /* Mark the test case a success */
end:
cleanup(); /* Any cleanup you require */
return testresult;
}
int setup_tests(void)
{
ADD_TEST(my_test); /* Add each test separately */
return 1; /* Indicates success. Return 0 */
/* to produce an error with a */
/* usage message and -1 for */
/* failure to set up with no */
/* usage message. */
}
You should use the TEST_xxx
macros provided by testutil.h
to test all failure
conditions. These macros produce an error message in a standard format if the
condition is not met (and nothing if the condition is met). Additional
information can be presented with the TEST_info
macro that takes a printf
format string and arguments. TEST_error
is useful for complicated conditions,
it also takes a printf
format string and argument. In all cases the TEST_xxx
macros are guaranteed to evaluate their arguments exactly once. This means
that expressions with side effects are allowed as parameters. Thus,
if (!TEST_ptr(ptr = OPENSSL_malloc(..)))
works fine and can be used in place of:
ptr = OPENSSL_malloc(..);
if (!TEST_ptr(ptr))
The former produces a more meaningful message on failure than the latter.
Note that the test infrastructure automatically sets up all required environment
variables (such as OPENSSL_MODULES
, OPENSSL_CONF
, etc.) for the tests.
Individual tests may choose to override the default settings as required.