| 1 |
include(AwsTestHarness) |
| 2 |
enable_testing() |
| 3 |
|
| 4 |
# See PKCS11.md for instructions on running these tests |
| 5 |
option(ENABLE_PKCS11_TESTS "Build and run PKCS#11 tests" OFF) |
| 6 |
|
| 7 |
file(GLOB TEST_SRC "*.c") |
| 8 |
file(GLOB TEST_HDRS "*.h") |
| 9 |
file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC}) |
| 10 |
|
| 11 |
# Each pipe test runs in 2 different configurations |
| 12 |
macro(add_pipe_test_case name) |
| 13 |
add_test_case("${name}") |
| 14 |
add_test_case("${name}_2loops") |
| 15 |
endmacro() |
| 16 |
|
| 17 |
add_test_case(io_library_init) |
| 18 |
add_test_case(io_library_init_cleanup_init_cleanup) |
| 19 |
add_test_case(io_library_error_order) |
| 20 |
|
| 21 |
# Dispatch Queue does not support pipe |
| 22 |
if(NOT AWS_USE_APPLE_NETWORK_FRAMEWORK) |
| 23 |
add_pipe_test_case(pipe_open_close) |
| 24 |
add_pipe_test_case(pipe_read_write) |
| 25 |
add_pipe_test_case(pipe_read_write_large_buffer) |
| 26 |
add_pipe_test_case(pipe_readable_event_sent_after_write) |
| 27 |
add_pipe_test_case(pipe_readable_event_sent_once) |
| 28 |
add_pipe_test_case(pipe_readable_event_sent_on_subscribe_if_data_present) |
| 29 |
add_pipe_test_case(pipe_readable_event_sent_on_resubscribe_if_data_present) |
| 30 |
add_pipe_test_case(pipe_readable_event_sent_again_after_all_data_read) |
| 31 |
add_pipe_test_case(pipe_error_event_sent_after_write_end_closed) |
| 32 |
add_pipe_test_case(pipe_error_event_sent_on_subscribe_if_write_end_already_closed) |
| 33 |
add_pipe_test_case(pipe_writes_are_fifo) |
| 34 |
add_pipe_test_case(pipe_clean_up_cancels_pending_writes) |
| 35 |
endif() |
| 36 |
|
| 37 |
|
| 38 |
add_test_case(event_loop_xthread_scheduled_tasks_execute) |
| 39 |
add_test_case(event_loop_canceled_tasks_run_in_el_thread) |
| 40 |
|
| 41 |
if(USE_IO_COMPLETION_PORTS) |
| 42 |
add_test_case(event_loop_completion_events) |
| 43 |
elseif(NOT AWS_USE_APPLE_NETWORK_FRAMEWORK) # Dispatch Queue does not support pipe |
| 44 |
add_test_case(event_loop_subscribe_unsubscribe) |
| 45 |
add_test_case(event_loop_writable_event_on_subscribe) |
| 46 |
add_test_case(event_loop_no_readable_event_before_write) |
| 47 |
add_test_case(event_loop_readable_event_after_write) |
| 48 |
add_test_case(event_loop_readable_event_on_subscribe_if_data_present) |
| 49 |
add_test_case(event_loop_readable_event_on_2nd_time_readable) |
| 50 |
add_test_case(event_loop_no_events_after_unsubscribe) |
| 51 |
endif() |
| 52 |
|
| 53 |
add_test_case(event_loop_stop_then_restart) |
| 54 |
add_test_case(event_loop_multiple_stops) |
| 55 |
add_test_case(event_loop_group_setup_and_shutdown) |
| 56 |
add_test_case(event_loop_group_setup_and_shutdown_async) |
| 57 |
add_test_case(numa_aware_event_loop_group_setup_and_shutdown) |
| 58 |
add_test_case(event_loop_epoll_creation) |
| 59 |
add_test_case(event_loop_iocp_creation) |
| 60 |
add_test_case(event_loop_kqueue_creation) |
| 61 |
add_test_case(event_loop_dispatch_queue_creation) |
| 62 |
add_test_case(event_loop_serialized_scheduling) |
| 63 |
|
| 64 |
add_test_case(io_testing_channel) |
| 65 |
|
| 66 |
add_test_case(socket_posix_creation) |
| 67 |
add_test_case(socket_winsock_creation) |
| 68 |
add_test_case(local_socket_communication) |
| 69 |
add_net_test_case(tcp_socket_communication) |
| 70 |
add_net_test_case(udp_socket_communication) |
| 71 |
add_net_test_case(test_socket_with_bind_to_interface) |
| 72 |
add_net_test_case(test_socket_with_bind_to_invalid_interface) |
| 73 |
add_net_test_case(test_is_network_interface_name_valid) |
| 74 |
add_net_test_case(connect_timeout) |
| 75 |
|
| 76 |
|
| 77 |
if(USE_VSOCK) |
| 78 |
add_test_case(vsock_loopback_socket_communication) |
| 79 |
endif() |
| 80 |
|
| 81 |
add_test_case(outgoing_local_sock_errors) |
| 82 |
add_test_case(outgoing_tcp_sock_error) |
| 83 |
add_test_case(incoming_tcp_sock_errors) |
| 84 |
add_net_test_case(bind_on_zero_port_tcp_ipv4) |
| 85 |
add_net_test_case(bind_on_zero_port_udp_ipv4) |
| 86 |
add_test_case(incoming_udp_sock_errors) |
| 87 |
|
| 88 |
add_test_case(cleanup_in_accept_doesnt_explode) |
| 89 |
add_test_case(cleanup_in_write_cb_doesnt_explode) |
| 90 |
add_test_case(sock_write_cb_is_async) |
| 91 |
add_test_case(socket_validate_port) |
| 92 |
|
| 93 |
add_test_case(parse_ipv4_valid_addresses) |
| 94 |
add_test_case(parse_ipv4_invalid_addresses) |
| 95 |
add_test_case(parse_ipv6_valid_addresses) |
| 96 |
add_test_case(parse_ipv6_invalid_addresses) |
| 97 |
|
| 98 |
if(NOT AWS_USE_APPLE_NETWORK_FRAMEWORK) |
| 99 |
# Apple Network Framework does not support bind+connect |
| 100 |
add_test_case(udp_bind_connect_communication) |
| 101 |
# The read/write will always run a different thread for Apple Network Framework |
| 102 |
add_test_case(wrong_thread_read_write_fails) |
| 103 |
# Apple Network Framework would not validate the binding endpoint until we start the |
| 104 |
# listen. The test does not apply here. |
| 105 |
add_test_case(incoming_duplicate_tcp_bind_errors) |
| 106 |
# nw_socket does not allow clean up event loop before socket shutdown, thus the following tests triggered |
| 107 |
# by event loop shutdown would not apply to Apple Network Framework |
| 108 |
add_net_test_case(connect_timeout_cancelation) |
| 109 |
add_net_test_case(cleanup_before_connect_or_timeout_doesnt_explode) |
| 110 |
endif() |
| 111 |
|
| 112 |
if(WIN32) |
| 113 |
string(REPLACE "." ";" BUILD_VERSION ${CMAKE_HOST_SYSTEM_VERSION}) |
| 114 |
list(GET BUILD_VERSION 2 BUILD_V) |
| 115 |
message("Windows Version " ${CMAKE_HOST_SYSTEM_VERSION} ", build " ${BUILD_V}) |
| 116 |
|
| 117 |
if(${BUILD_V} GREATER_EQUAL 20348) |
| 118 |
message("Building for version 20348 or higher: supporting TLS1.3") |
| 119 |
add_net_test_case(tls_client_channel_negotiation_success_mtls_tls13) |
| 120 |
endif() |
| 121 |
add_test_case(local_socket_pipe_connected_race) |
| 122 |
add_test_case(tls_client_channel_negotiation_success_ecc384_deprecated) |
| 123 |
endif() |
| 124 |
|
| 125 |
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
| 126 |
add_net_test_case(tls_client_channel_negotiation_success_mtls_tls13) |
| 127 |
add_net_test_case(tls_client_channel_negotiation_success_mtls_from_keychain) |
| 128 |
add_net_test_case(tls_client_channel_negotiation_failure_mtls_untrusted_server_from_keychain) |
| 129 |
add_net_test_case(tls_client_channel_negotiation_failure_tls13_to_tls12_server) |
| 130 |
endif() |
| 131 |
|
| 132 |
add_test_case(channel_setup) |
| 133 |
add_test_case(channel_single_slot_cleans_up) |
| 134 |
add_test_case(channel_slots_clean_up) |
| 135 |
add_test_case(channel_refcount_delays_clean_up) |
| 136 |
add_test_case(channel_tasks_run) |
| 137 |
add_test_case(channel_tasks_serialized_run) |
| 138 |
add_test_case(channel_rejects_post_shutdown_tasks) |
| 139 |
add_test_case(channel_cancels_pending_tasks) |
| 140 |
add_test_case(channel_duplicate_shutdown) |
| 141 |
add_test_case(channel_keeps_event_loop_group_alive) |
| 142 |
add_net_test_case(channel_connect_some_hosts_timeout) |
| 143 |
|
| 144 |
add_net_test_case(test_default_with_ipv6_lookup) |
| 145 |
add_net_test_case(test_default_host_resolver_ipv6_address_variations) |
| 146 |
add_test_case(test_resolver_ipv6_address_lookup) |
| 147 |
add_net_test_case(test_default_with_multiple_lookups) |
| 148 |
add_test_case(test_resolver_ipv4_address_lookup) |
| 149 |
add_test_case(test_resolver_purge_host_cache) |
| 150 |
add_test_case(test_resolver_purge_cache) |
| 151 |
add_net_test_case(test_default_with_ipv4_only_lookup) |
| 152 |
add_test_case(test_resolver_ttls) |
| 153 |
add_test_case(test_resolver_connect_failure_recording) |
| 154 |
add_test_case(test_resolver_ttl_refreshes_on_resolve) |
| 155 |
add_test_case(test_resolver_bad_list_expires_eventually) |
| 156 |
add_test_case(test_resolver_low_frequency_starvation) |
| 157 |
|
| 158 |
add_test_case(test_pem_single_cert_parse) |
| 159 |
add_test_case(test_pem_private_key_parse) |
| 160 |
add_test_case(test_pem_dsa_private_key_parse) |
| 161 |
add_test_case(test_pem_dsa_public_key_parse) |
| 162 |
add_test_case(test_pem_cert_chain_parse) |
| 163 |
add_test_case(test_pem_cert_parse_from_file) |
| 164 |
add_test_case(test_pem_cert_parse_from_file_crlf) |
| 165 |
add_test_case(test_pem_private_key_parse_from_file) |
| 166 |
add_test_case(test_pem_cert_chain_comments_and_whitespace) |
| 167 |
add_test_case(test_pem_invalid_parse) |
| 168 |
add_test_case(test_pem_valid_data_invalid_parse) |
| 169 |
add_test_case(test_pem_invalid_in_chain_parse) |
| 170 |
|
| 171 |
add_test_case(pem_sanitize_comments_around_pem_object_removed) |
| 172 |
add_test_case(pem_sanitize_empty_file_rejected) |
| 173 |
add_test_case(pem_sanitize_wrong_format_rejected) |
| 174 |
add_test_case(pem_sanitize_bad_format_rejected) |
| 175 |
|
| 176 |
add_test_case(test_der_cert_to_pem_typical) |
| 177 |
add_test_case(test_der_cert_to_pem_small) |
| 178 |
add_test_case(test_der_cert_to_pem_output_format) |
| 179 |
add_test_case(test_der_cert_to_pem_empty_input_fails) |
| 180 |
|
| 181 |
add_test_case(socket_handler_echo_and_backpressure) |
| 182 |
add_test_case(socket_handler_close) |
| 183 |
|
| 184 |
|
| 185 |
# These tests fail on Windows due to some bug in our server code where, if the socket is closed |
| 186 |
# immediately after data is written, that data does not flush cleanly to the client. |
| 187 |
# I've lost days to this bug, and no one is using our Windows server funcionality, |
| 188 |
# so disabling these tests on Windows and moving along for now. |
| 189 |
# I tried the following: |
| 190 |
# 1) Wrote 2 simple standalone Windows programs, server and client, using simple synchronous socket code. |
| 191 |
# WORKED PERFECTLY. So it's not a fundamental issue with Windows. |
| 192 |
# 2) Commented out server part of this failing test, and used the simple standalone server instead. |
| 193 |
# WORKED PERFECTLY. So it's not a problem with our actual client code. |
| 194 |
# 3) Copy/pasted the simple standlone server code into this test, and used that instead of our actual server code. |
| 195 |
# WORKED PERFECTLY. So it's not a problem with the server and client sockets being in the same process. |
| 196 |
# 4) Commented out the client part of this failing test, and used the simple standalone client instead. |
| 197 |
# FAILED. The standalone client got WSAECONNRESET (Connection reset by peer) before receiving all the data. |
| 198 |
# So it's something with our complicated non-blocking server code. |
| 199 |
# The last interesting thing I noticed before giving up was: we call shutdown() immediately |
| 200 |
# before calling closesocket() but shutdown() gets error WSAENOTCONN, even |
| 201 |
# though, at that moment, the socket should be connected just fine. |
| 202 |
if(NOT WIN32) |
| 203 |
add_net_test_case(socket_handler_read_to_eof_after_peer_hangup) |
| 204 |
add_net_test_case(socket_handler_ipv4_read_to_eof_after_peer_hangup) |
| 205 |
add_net_test_case(socket_handler_ipv6_read_to_eof_after_peer_hangup) |
| 206 |
endif() |
| 207 |
add_test_case(socket_pinned_event_loop) |
| 208 |
add_net_test_case(socket_pinned_event_loop_dns_failure) |
| 209 |
|
| 210 |
if(NOT BYO_CRYPTO) |
| 211 |
if(USE_S2N) |
| 212 |
add_net_test_case(default_pki_path_exists) |
| 213 |
endif() |
| 214 |
|
| 215 |
# Badssl-based tests (https://badssl.com/dashboard/) - use remote endpoints for now, later transition to |
| 216 |
# internal hosting using the bad ssl container/server setup and dns redirects per |
| 217 |
# https://github.com/chromium/badssl.com |
| 218 |
# |
| 219 |
# We don't use the interception suite since that's a host configuration issue |
| 220 |
# We also don't check the domain security policy suite: |
| 221 |
# 1. s2n does not support revocation checks and we do not currently enable any revocation checks |
| 222 |
# in windows or osx, although we may add configurable support to those platforms(off-by-default) at a |
| 223 |
# later date |
| 224 |
# 2. s2n does not support public key pinning and, given its deprecated and http-centric position, there are no |
| 225 |
# plans to add support nor investigate osx/windows support as well. |
| 226 |
|
| 227 |
# Badssl - Certificate Validation endpoint suite |
| 228 |
# For each failure case, we also include a positive test that verifies success when peer verification is disabled |
| 229 |
add_net_test_case(tls_client_channel_negotiation_error_expired) |
| 230 |
add_net_test_case(tls_client_channel_negotiation_error_wrong_host) |
| 231 |
add_net_test_case(tls_client_channel_negotiation_error_wrong_host_with_ca_override) |
| 232 |
add_net_test_case(tls_client_channel_negotiation_error_self_signed) |
| 233 |
add_net_test_case(tls_client_channel_negotiation_error_untrusted_root) |
| 234 |
add_net_test_case(tls_client_channel_negotiation_error_untrusted_root_due_to_ca_override) |
| 235 |
add_net_test_case(tls_client_channel_negotiation_no_verify_expired) |
| 236 |
add_net_test_case(tls_client_channel_negotiation_no_verify_wrong_host) |
| 237 |
add_net_test_case(tls_client_channel_negotiation_no_verify_self_signed) |
| 238 |
add_net_test_case(tls_client_channel_negotiation_no_verify_untrusted_root) |
| 239 |
|
| 240 |
# Badssl - Certificate Revocation (Windows only) |
| 241 |
# On Windows, SChannel performs CRL/OCSP revocation checks by default. |
| 242 |
if(WIN32) |
| 243 |
add_net_test_case(tls_client_channel_negotiation_error_revoked) |
| 244 |
endif() |
| 245 |
|
| 246 |
# This test verifies that our no_certificate_revocation option works. |
| 247 |
# Runs on Windows (proves revocation is skipped) and Linux (proves option doesn't break s2n). |
| 248 |
# Skipped on Apple where revocation is never checked and cert validity issues cause false failures. |
| 249 |
if(NOT APPLE) |
| 250 |
add_net_test_case(tls_client_channel_negotiation_revoked_no_check) |
| 251 |
endif() |
| 252 |
|
| 253 |
# Badssl - Broken Crypto endpoint suite |
| 254 |
# We don't include dh1024 as it succeeds on the windows baseline configuration and there does not seem |
| 255 |
# to be a way to disable it |
| 256 |
add_net_test_case(tls_client_channel_negotiation_error_broken_crypto_rc4) |
| 257 |
add_net_test_case(tls_client_channel_negotiation_error_broken_crypto_rc4_md5) |
| 258 |
add_net_test_case(tls_client_channel_negotiation_error_broken_crypto_dh480) |
| 259 |
add_net_test_case(tls_client_channel_negotiation_error_broken_crypto_dh512) |
| 260 |
add_net_test_case(tls_client_channel_negotiation_error_broken_crypto_null) |
| 261 |
|
| 262 |
# Badssl - Legacy crypto suite, includes both negative and positive tests, with override checks where appropriate |
| 263 |
# Our current baseline/default is platform-specific, whereas badssl expects a baseline of 1.2 |
| 264 |
# Linux - tls1.1 |
| 265 |
# Windows - system default (1.0 is the only thing we could reasonable fixate to given win7 support) |
| 266 |
# Mac - system default |
| 267 |
# We skip the cbc and 3des checks, as a positive connection result there does not yet represent a security risk |
| 268 |
# We don't include dh2048 as it succeeds on the windows baseline configuration and there does not seem |
| 269 |
# to be a way to disable it |
| 270 |
if(NOT(WIN32 AND NOT CMAKE_SYSTEM_VERSION MATCHES "10\.0\.1.*")) |
| 271 |
# Skip TLS 1.0 and TLS 1.1 test for windows later than windows server 2022, as they droped old TLS |
| 272 |
if(NOT AWS_USE_SECITEM) |
| 273 |
add_net_test_case(tls_client_channel_negotiation_error_legacy_crypto_tls10) |
| 274 |
# SecItem does not allow use of depricated TLS versions |
| 275 |
add_net_test_case(tls_client_channel_negotiation_override_legacy_crypto_tls10) |
| 276 |
add_net_test_case(tls_client_channel_negotiation_success_legacy_crypto_tls11) |
| 277 |
endif() |
| 278 |
add_net_test_case(tls_client_channel_negotiation_error_override_legacy_crypto_tls11) |
| 279 |
endif() |
| 280 |
|
| 281 |
# Badssl - Secure uncommon suite |
| 282 |
# We skip 10000san for now as its unclear the point or relevance especially with respect to the OS-based |
| 283 |
# TLS implementations |
| 284 |
# We skip 1000san, sha384, rsa8192 and sha512 because the public badssl certificate is expired and we haven't migrated to |
| 285 |
# internal hosting yet |
| 286 |
# We also defer the incomplete chain test for now until we can do some further study on how to get it to |
| 287 |
# properly fail on windows and osx. |
| 288 |
# add_net_test_case(tls_client_channel_negotiation_success_sha384) |
| 289 |
# add_net_test_case(tls_client_channel_negotiation_success_sha512) |
| 290 |
# add_net_test_case(tls_client_channel_negotiation_success_rsa8192) |
| 291 |
add_net_test_case(tls_client_channel_negotiation_error_no_subject) |
| 292 |
add_net_test_case(tls_client_channel_negotiation_success_no_verify_no_subject) |
| 293 |
add_net_test_case(tls_client_channel_negotiation_error_no_common_name) |
| 294 |
add_net_test_case(tls_client_channel_negotiation_success_no_verify_no_common_name) |
| 295 |
add_net_test_case(tls_client_channel_negotiation_success_no_verify_incomplete_chain) |
| 296 |
|
| 297 |
# Badssl - Secure common suite, all of these should succeed |
| 298 |
add_net_test_case(tls_client_channel_negotiation_success_tls12) |
| 299 |
add_net_test_case(tls_client_channel_negotiation_success_sha256) |
| 300 |
add_net_test_case(tls_client_channel_negotiation_success_rsa2048) |
| 301 |
add_net_test_case(tls_client_channel_negotiation_success_ecc256) |
| 302 |
add_net_test_case(tls_client_channel_negotiation_success_ecc384) |
| 303 |
|
| 304 |
# add_net_test_case(tls_client_channel_negotiation_success_extended_validation) test disabled until badssl updates cert (expired 2022.08.10) |
| 305 |
add_net_test_case(tls_client_channel_negotiation_success_mozilla_modern) |
| 306 |
|
| 307 |
# Misc non-badssl tls tests |
| 308 |
add_net_test_case(test_duplicate_cert_import) |
| 309 |
add_net_test_case(tls_channel_echo_and_backpressure_test) |
| 310 |
add_net_test_case(tls_channel_shutdown_with_cache_test) |
| 311 |
add_net_test_case(tls_channel_shutdown_with_cache_window_update_after_shutdown_test) |
| 312 |
add_net_test_case(tls_client_channel_negotiation_success) |
| 313 |
add_net_test_case(tls_server_multiple_connections) |
| 314 |
add_net_test_case(tls_server_hangup_during_negotiation) |
| 315 |
add_net_test_case(tls_client_channel_no_verify) |
| 316 |
add_net_test_case(test_tls_negotiation_timeout) |
| 317 |
add_net_test_case(alpn_successfully_negotiates) |
| 318 |
add_net_test_case(alpn_no_protocol_message) |
| 319 |
add_net_test_case(test_ecc_cert_import) |
| 320 |
add_net_test_case(test_tls_cipher_preference) |
| 321 |
|
| 322 |
if(NOT AWS_USE_SECITEM) |
| 323 |
# These tests require the test binary to be codesigned with an Apple Developer account with entitlements. |
| 324 |
# The entitlements also require a provisioning profile and require the binary to be run from within XCode or a |
| 325 |
# valid app bundle. |
| 326 |
add_net_test_case(test_concurrent_cert_import) |
| 327 |
|
| 328 |
# PKCS8 is not supported on iOS. We will not support PKCS8 on macOS using SecItem. |
| 329 |
# PKCS8 support for SecItem can be added in the future but it will require macOS |
| 330 |
# specific branching of logic and import of the key into the keychain. |
| 331 |
add_net_test_case(test_pkcs8_import) |
| 332 |
|
| 333 |
# This test shuts down the channel after a socket is established but while the TLS handshake is taking place |
| 334 |
# further up the channel. Apple Network Framework's connection handles both the socket connection as well |
| 335 |
# as the TLS handshake within the same create connection call without external notification that the socket |
| 336 |
# has succeeded prior to the TLS negotiation. As such, this test will not work for Secitem. |
| 337 |
add_net_test_case(tls_client_channel_negotiation_error_socket_closed) |
| 338 |
|
| 339 |
# TLS statistics tracks and handles the timeout of TLS. Using SecItem, the TLS handshake takes place within |
| 340 |
# the socket establishment and does not need a separate timeout task for TLS. |
| 341 |
add_net_test_case(tls_channel_statistics_test) |
| 342 |
endif() |
| 343 |
|
| 344 |
add_test_case(alpn_error_creating_handler) |
| 345 |
add_test_case(tls_destroy_null_context) |
| 346 |
add_net_test_case(tls_certificate_chain_test) |
| 347 |
|
| 348 |
else() |
| 349 |
add_test_case(byo_tls_handler_test) |
| 350 |
endif() |
| 351 |
|
| 352 |
add_test_case(future_by_value) |
| 353 |
add_test_case(future_void) |
| 354 |
add_test_case(future_callback_fires_immediately) |
| 355 |
add_test_case(future_callback_fires_on_another_thread) |
| 356 |
add_test_case(future_register_callback_if_not_done) |
| 357 |
add_test_case(future_register_event_loop_callback_after_done) |
| 358 |
add_test_case(future_register_event_loop_callback_before_done) |
| 359 |
add_test_case(future_register_event_loop_callback_always_scheduled) |
| 360 |
add_test_case(future_register_channel_callback) |
| 361 |
add_test_case(future_wait_timeout) |
| 362 |
add_test_case(future_wait_timeout_max) |
| 363 |
add_test_case(future_pointer_with_destroy) |
| 364 |
add_test_case(future_pointer_with_release) |
| 365 |
add_test_case(future_get_result_by_move) |
| 366 |
add_test_case(future_can_die_incomplete) |
| 367 |
add_test_case(future_by_pointer_accepts_null_result) |
| 368 |
add_test_case(future_set_multiple_times) |
| 369 |
add_test_case(future_set_error) |
| 370 |
|
| 371 |
add_test_case(test_input_stream_memory_simple) |
| 372 |
add_test_case(test_input_stream_memory_iterate) |
| 373 |
add_test_case(test_input_stream_memory_seek_beginning) |
| 374 |
add_test_case(test_input_stream_memory_seek_end) |
| 375 |
add_test_case(test_input_stream_memory_seek_multiple_times) |
| 376 |
add_test_case(test_input_stream_memory_seek_past_end) |
| 377 |
add_test_case(test_input_stream_memory_seek_before_start) |
| 378 |
add_test_case(test_input_stream_file_simple) |
| 379 |
add_test_case(test_input_stream_file_iterate) |
| 380 |
add_test_case(test_input_stream_file_seek_beginning) |
| 381 |
add_test_case(test_input_stream_file_seek_end) |
| 382 |
add_test_case(test_input_stream_memory_length) |
| 383 |
add_test_case(test_input_stream_file_length) |
| 384 |
add_test_case(test_input_stream_binary) |
| 385 |
add_test_case(test_input_stream_read_only) |
| 386 |
|
| 387 |
add_test_case(async_input_stream_fill_completes_on_thread) |
| 388 |
add_test_case(async_input_stream_fill_completes_immediately) |
| 389 |
add_test_case(async_input_stream_fill_completes_randomly) |
| 390 |
add_test_case(async_input_stream_fill_eof_requires_extra_read) |
| 391 |
add_test_case(async_input_stream_fill_reports_error) |
| 392 |
|
| 393 |
add_test_case(open_channel_statistics_test) |
| 394 |
|
| 395 |
add_test_case(shared_library_open_failure) |
| 396 |
|
| 397 |
if(BUILD_SHARED_LIBS) |
| 398 |
add_test_case(shared_library_open_success) |
| 399 |
add_test_case(shared_library_find_function_failure) |
| 400 |
add_test_case(shared_library_find_function_success) |
| 401 |
endif() |
| 402 |
|
| 403 |
add_test_case(test_exponential_backoff_retry_too_many_retries_no_jitter) |
| 404 |
add_test_case(test_exponential_backoff_retry_too_many_retries_full_jitter) |
| 405 |
add_test_case(test_exponential_backoff_retry_too_many_retries_decorrelated_jitter) |
| 406 |
add_test_case(test_exponential_backoff_retry_too_many_retries_default_jitter) |
| 407 |
add_test_case(test_exponential_backoff_retry_client_errors_do_not_count) |
| 408 |
add_test_case(test_exponential_backoff_retry_no_jitter_time_taken) |
| 409 |
add_test_case(test_exponential_max_backoff_retry_no_jitter) |
| 410 |
add_test_case(test_exponential_backoff_retry_invalid_options) |
| 411 |
add_test_case(test_no_retries) |
| 412 |
|
| 413 |
add_test_case(test_standard_retry_strategy_setup_shutdown) |
| 414 |
add_test_case(test_standard_retry_strategy_failure_exhausts_bucket) |
| 415 |
add_test_case(test_standard_retry_strategy_failure_recovers) |
| 416 |
|
| 417 |
# See PKCS11.md for instructions on running these tests |
| 418 |
if(ENABLE_PKCS11_TESTS) |
| 419 |
add_test_case(pkcs11_lib_sanity_check) |
| 420 |
add_test_case(pkcs11_lib_behavior_default) |
| 421 |
add_test_case(pkcs11_lib_behavior_omit_initialize) |
| 422 |
add_test_case(pkcs11_lib_behavior_strict_initialize_finalize) |
| 423 |
add_test_case(pkcs11_find_private_key) |
| 424 |
add_test_case(pkcs11_find_private_key_for_different_rsa_types) |
| 425 |
add_test_case(pkcs11_find_private_key_for_ec) |
| 426 |
add_test_case(pkcs11_find_multiple_private_key) |
| 427 |
add_test_case(pkcs11_sign_rsa_sha1) |
| 428 |
add_test_case(pkcs11_sign_rsa_sha224) |
| 429 |
add_test_case(pkcs11_sign_rsa_sha256) |
| 430 |
add_test_case(pkcs11_sign_rsa_sha384) |
| 431 |
add_test_case(pkcs11_sign_rsa_sha512) |
| 432 |
add_test_case(pkcs11_asn1_bigint) |
| 433 |
add_test_case(pkcs11_sign_ec_256) |
| 434 |
add_test_case(pkcs11_rsa_decrypt) |
| 435 |
add_test_case(pkcs11_find_slot) |
| 436 |
add_test_case(pkcs11_find_slot_many_tokens) |
| 437 |
add_test_case(pkcs11_session_tests) |
| 438 |
add_test_case(pkcs11_login_tests) |
| 439 |
|
| 440 |
# TLS with PKCS#11 not currently supported on every platform |
| 441 |
if(USE_S2N) |
| 442 |
add_test_case(pkcs11_tls_rsa_negotiation_succeeds) |
| 443 |
add_test_case(pkcs11_tls_ec_negotiation_succeeds) |
| 444 |
endif() |
| 445 |
endif() |
| 446 |
|
| 447 |
set(TEST_BINARY_NAME ${PROJECT_NAME}-tests) |
| 448 |
generate_test_driver(${TEST_BINARY_NAME}) |
| 449 |
|
| 450 |
if(USE_S2N) |
| 451 |
target_compile_definitions(${PROJECT_NAME}-tests PRIVATE "-DUSE_S2N") |
| 452 |
endif() |
| 453 |
|
| 454 |
# SSL certificates to use for testing. |
| 455 |
add_custom_command(TARGET ${TEST_BINARY_NAME} PRE_BUILD |
| 456 |
COMMAND ${CMAKE_COMMAND} -E copy_directory |
| 457 |
${CMAKE_CURRENT_SOURCE_DIR}/resources $<TARGET_FILE_DIR:${TEST_BINARY_NAME}>) |