aws-crt 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/aws-crt-ffi/CMakeLists.txt +49 -41
- data/aws-crt-ffi/crt/aws-c-auth/CMakeLists.txt +0 -10
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/credentials.h +3 -2
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/credentials_utils.h +4 -4
- data/aws-crt-ffi/crt/aws-c-auth/source/auth.c +1 -14
- data/aws-crt-ffi/crt/aws-c-auth/source/aws_imds_client.c +206 -68
- data/aws-crt-ffi/crt/aws-c-auth/source/aws_signing.c +5 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_cached.c +6 -6
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_default_chain.c +16 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_ecs.c +0 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_process.c +0 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_sts_web_identity.c +0 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_x509.c +10 -7
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_utils.c +35 -26
- data/aws-crt-ffi/crt/aws-c-auth/source/signable_chunk.c +3 -2
- data/aws-crt-ffi/crt/aws-c-auth/tests/CMakeLists.txt +3 -2
- data/aws-crt-ffi/crt/aws-c-auth/tests/aws_imds_client_test.c +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_ecs_tests.c +3 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_process_tests.c +65 -16
- data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_tests.c +125 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/sigv4_signing_tests.c +68 -46
- data/aws-crt-ffi/crt/aws-c-cal/CMakeLists.txt +8 -3
- data/aws-crt-ffi/crt/aws-c-cal/bin/run_x_platform_fuzz_corpus/main.c +9 -0
- data/aws-crt-ffi/crt/aws-c-cal/builder.json +11 -3
- data/aws-crt-ffi/crt/aws-c-cal/cmake/aws-c-cal-config.cmake +14 -5
- data/aws-crt-ffi/crt/aws-c-cal/source/darwin/securityframework_ecc.c +6 -6
- data/aws-crt-ffi/crt/aws-c-cal/source/windows/bcrypt_ecc.c +12 -12
- data/aws-crt-ffi/crt/aws-c-cal/tests/test_case_helper.h +14 -14
- data/aws-crt-ffi/crt/aws-c-common/CMakeLists.txt +21 -1
- data/aws-crt-ffi/crt/aws-c-common/README.md +8 -0
- data/aws-crt-ffi/crt/aws-c-common/cmake/AwsCFlags.cmake +20 -5
- data/aws-crt-ffi/crt/aws-c-common/cmake/AwsFeatureTests.cmake +7 -1
- data/aws-crt-ffi/crt/aws-c-common/format-check.sh +1 -1
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/byte_buf.h +14 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/config.h.in +1 -0
- data/aws-crt-ffi/crt/{aws-c-auth/include/aws/auth → aws-c-common/include/aws/common}/external/cJSON.h +82 -74
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/json.h +335 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/logging.h +1 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/math.inl +2 -2
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/private/json_impl.h +22 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/testing/aws_test_harness.h +2 -0
- data/aws-crt-ffi/crt/aws-c-common/source/byte_buf.c +36 -0
- data/aws-crt-ffi/crt/aws-c-common/source/common.c +5 -2
- data/aws-crt-ffi/crt/aws-c-common/source/external/cJSON.c +3113 -0
- data/aws-crt-ffi/crt/aws-c-common/source/file.c +9 -0
- data/aws-crt-ffi/crt/aws-c-common/source/json.c +348 -0
- data/aws-crt-ffi/crt/aws-c-common/source/logging.c +7 -2
- data/aws-crt-ffi/crt/aws-c-common/source/posix/system_info.c +8 -0
- data/aws-crt-ffi/crt/aws-c-common/source/ref_count.c +3 -1
- data/aws-crt-ffi/crt/aws-c-common/source/windows/file.c +47 -0
- data/aws-crt-ffi/crt/aws-c-common/source/windows/system_info.c +2 -1
- data/aws-crt-ffi/crt/aws-c-common/tests/CMakeLists.txt +5 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/byte_buf_test.c +69 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/json_test.c +134 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/memtrace_test.c +6 -2
- data/aws-crt-ffi/crt/aws-c-event-stream/README.md +18 -35
- data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream.h +21 -2
- data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream_rpc_client.h +14 -2
- data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream_rpc_server.h +13 -0
- data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/private/event_stream_rpc_priv.h +7 -7
- data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream.c +257 -141
- data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_channel_handler.c +1 -1
- data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_rpc_client.c +31 -8
- data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_rpc_server.c +63 -10
- data/aws-crt-ffi/crt/aws-c-event-stream/tests/CMakeLists.txt +2 -0
- data/aws-crt-ffi/crt/aws-c-event-stream/tests/event_stream_rpc_client_connection_test.c +157 -106
- data/aws-crt-ffi/crt/aws-c-event-stream/tests/event_stream_rpc_server_connection_test.c +168 -1
- data/aws-crt-ffi/crt/aws-c-event-stream/tests/message_deserializer_test.c +4 -2
- data/aws-crt-ffi/crt/aws-c-http/CMakeLists.txt +1 -0
- data/aws-crt-ffi/crt/aws-c-http/README.md +8 -0
- data/aws-crt-ffi/crt/aws-c-http/bin/elasticurl/main.c +1 -1
- data/aws-crt-ffi/crt/aws-c-http/builder.json +4 -3
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection.h +8 -1
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection_manager.h +45 -1
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/http2_stream_manager.h +63 -12
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_impl.h +2 -1
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_connection.h +20 -2
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_frames.h +1 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_stream.h +42 -13
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/http2_stream_manager_impl.h +17 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/http_impl.h +3 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/random_access_set.h +10 -3
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/request_response_impl.h +3 -17
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/request_response.h +108 -4
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/statistics.h +22 -0
- data/aws-crt-ffi/crt/aws-c-http/source/connection.c +8 -3
- data/aws-crt-ffi/crt/aws-c-http/source/connection_manager.c +22 -3
- data/aws-crt-ffi/crt/aws-c-http/source/connection_monitor.c +32 -14
- data/aws-crt-ffi/crt/aws-c-http/source/h1_connection.c +14 -0
- data/aws-crt-ffi/crt/aws-c-http/source/h1_encoder.c +7 -4
- data/aws-crt-ffi/crt/aws-c-http/source/h2_connection.c +161 -45
- data/aws-crt-ffi/crt/aws-c-http/source/h2_decoder.c +37 -8
- data/aws-crt-ffi/crt/aws-c-http/source/h2_frames.c +13 -1
- data/aws-crt-ffi/crt/aws-c-http/source/h2_stream.c +345 -87
- data/aws-crt-ffi/crt/aws-c-http/source/hpack.c +3 -0
- data/aws-crt-ffi/crt/aws-c-http/source/http.c +3 -0
- data/aws-crt-ffi/crt/aws-c-http/source/http2_stream_manager.c +266 -39
- data/aws-crt-ffi/crt/aws-c-http/source/random_access_set.c +9 -3
- data/aws-crt-ffi/crt/aws-c-http/source/request_response.c +80 -20
- data/aws-crt-ffi/crt/aws-c-http/source/statistics.c +11 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/CMakeLists.txt +28 -1
- data/aws-crt-ffi/crt/aws-c-http/tests/fuzz/fuzz_h2_decoder_correct.c +5 -3
- data/aws-crt-ffi/crt/aws-c-http/tests/h2_test_helper.c +133 -29
- data/aws-crt-ffi/crt/aws-c-http/tests/h2_test_helper.h +6 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/README.md +40 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/non_tls_server.py +56 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/server.py +329 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_manager.c +1 -1
- data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_monitor.c +2 -2
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_client.c +47 -34
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_encoder.c +4 -4
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_server.c +15 -12
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h2_client.c +582 -25
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h2_encoder.c +3 -3
- data/aws-crt-ffi/crt/aws-c-http/tests/test_localhost_integ.c +530 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/test_stream_manager.c +459 -67
- data/aws-crt-ffi/crt/aws-c-io/CMakeLists.txt +4 -0
- data/aws-crt-ffi/crt/aws-c-io/builder.json +3 -2
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/channel.h +21 -0
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/io.h +3 -0
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/socket.h +6 -0
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/stream.h +35 -5
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/tls_channel_handler.h +211 -15
- data/aws-crt-ffi/crt/aws-c-io/source/channel.c +56 -30
- data/aws-crt-ffi/crt/aws-c-io/source/darwin/secure_transport_tls_channel_handler.c +0 -24
- data/aws-crt-ffi/crt/aws-c-io/source/io.c +9 -0
- data/aws-crt-ffi/crt/aws-c-io/source/{pkcs11.c → pkcs11_lib.c} +162 -22
- data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_private.h +18 -20
- data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_tls_op_handler.c +221 -0
- data/aws-crt-ffi/crt/aws-c-io/source/posix/socket.c +135 -81
- data/aws-crt-ffi/crt/aws-c-io/source/retry_strategy.c +12 -8
- data/aws-crt-ffi/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c +252 -215
- data/aws-crt-ffi/crt/aws-c-io/source/stream.c +65 -82
- data/aws-crt-ffi/crt/aws-c-io/source/tls_channel_handler.c +188 -57
- data/aws-crt-ffi/crt/aws-c-io/source/windows/iocp/socket.c +271 -256
- data/aws-crt-ffi/crt/aws-c-io/tests/CMakeLists.txt +21 -12
- data/aws-crt-ffi/crt/aws-c-io/tests/channel_test.c +32 -4
- data/aws-crt-ffi/crt/aws-c-io/tests/io_lib_test.c +37 -0
- data/aws-crt-ffi/crt/aws-c-io/tests/pkcs11_test.c +412 -93
- data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.crt +15 -0
- data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.key +5 -0
- data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.p12 +0 -0
- data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.p8 +5 -0
- data/aws-crt-ffi/crt/aws-c-io/tests/resources/generateCerts.sh +24 -15
- data/aws-crt-ffi/crt/aws-c-io/tests/socket_test.c +72 -1
- data/aws-crt-ffi/crt/s2n/CMakeLists.txt +6 -1
- data/aws-crt-ffi/crt/s2n/bindings/rust/Cargo.toml +1 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/generate/src/main.rs +105 -82
- data/aws-crt-ffi/crt/s2n/bindings/rust/generate.sh +1 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/Cargo.toml +2 -2
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/src/raw/config.rs +1 -1
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/Cargo.toml +1 -1
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/build.rs +84 -30
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/src/lib.rs +4 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/Cargo.toml +21 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/certs/cert.pem +14 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/certs/key.pem +8 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/client.rs +45 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/server.rs +60 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/src/lib.rs +150 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/tests/handshake.rs +51 -0
- data/aws-crt-ffi/crt/s2n/crypto/s2n_drbg.c +98 -77
- data/aws-crt-ffi/crt/s2n/crypto/s2n_drbg.h +10 -7
- data/aws-crt-ffi/crt/s2n/crypto/s2n_openssl.h +2 -0
- data/aws-crt-ffi/crt/s2n/error/s2n_errno.c +1 -1
- data/aws-crt-ffi/crt/s2n/error/s2n_errno.h +1 -0
- data/aws-crt-ffi/crt/s2n/s2n.mk +7 -0
- data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/repository.py +233 -0
- data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/setup-proof.py +8 -7
- data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/setup.py +17 -18
- data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/util.py +41 -23
- data/aws-crt-ffi/crt/s2n/tests/fuzz/LD_PRELOAD/global_overrides.c +3 -3
- data/aws-crt-ffi/crt/s2n/tests/integration/s2n_client_endpoint_handshake_test.py +2 -2
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/Makefile +13 -42
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/README.md +6 -1
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/common.py +118 -53
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/configuration.py +108 -88
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/conftest.py +6 -3
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/constants.py +6 -4
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/fixtures.py +21 -12
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/global_flags.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/processes.py +62 -19
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/providers.py +304 -48
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_client_authentication.py +20 -11
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_cross_compatibility.py +41 -17
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_dynamic_record_sizes.py +6 -3
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_early_data.py +105 -48
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_external_psk.py +160 -76
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_fragmentation.py +59 -26
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_happy_path.py +42 -28
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_hello_retry_requests.py +33 -13
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_key_update.py +29 -11
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_ocsp.py +138 -0
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_pq_handshake.py +103 -36
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_session_resumption.py +52 -25
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_signature_algorithms.py +47 -21
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_sni_match.py +13 -9
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_sslyze.py +88 -17
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_version_negotiation.py +71 -22
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_well_known_endpoints.py +4 -3
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/tox.ini +1 -0
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/utils.py +50 -15
- data/aws-crt-ffi/crt/s2n/tests/litani/CHANGELOG +131 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/CONTRIBUTING.md +16 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/README.md +36 -14
- data/aws-crt-ffi/crt/s2n/tests/litani/THIRD-PARTY +205 -41
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/bin/build-html-doc +7 -7
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/configure +27 -23
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-add-job.scdoc +7 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-dump-run.scdoc +7 -5
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-transform-jobs.scdoc +248 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani.scdoc +2 -2
- data/aws-crt-ffi/crt/s2n/tests/litani/doc/templates/index.jinja.html +4 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/README +12 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/original-run.sh +52 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/run-all.py +71 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/README +13 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-1.sh +34 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-2.sh +35 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-3.sh +34 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-all.py +60 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/README.md +10 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/assumptions.html +42 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/file.dat +7 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/histogram.dat +7 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-1.sh +41 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-2.sh +47 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-3.sh +41 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-all.py +34 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib-table.py +40 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib.plt +5 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib.py +32 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin-output.py +40 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin.plt +5 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin.py +30 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/templates/fib-table.jinja.html +45 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/templates/sin-output.jinja.html +30 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/add_job.py +55 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/graph.py +2 -2
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/litani.py +6 -1
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/litani_report.py +18 -21
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/ninja.py +2 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/run_printer.py +26 -7
- data/aws-crt-ffi/crt/s2n/tests/litani/lib/transform_jobs.py +84 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/litani +28 -33
- data/aws-crt-ffi/crt/s2n/tests/litani/script/release +220 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/templates/dashboard.jinja.html +78 -15
- data/aws-crt-ffi/crt/s2n/tests/litani/templates/pipeline.jinja.html +21 -5
- data/aws-crt-ffi/crt/s2n/tests/litani/test/README +15 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/run +56 -33
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/custom_stages.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/cwd.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/dump_run.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/graph_line_break.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/html_node.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/job_id_env.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/multiproc_dump_run.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_pool_serialize.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_pool_serialize_graph.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out_timeout_ignored.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out_timeout_ok.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pipeline_order.py +53 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pool_serialize.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pool_serialize_graph.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/single_pool.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess_multi_shell.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess_shell.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_timeout_ignored.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_timeout_ok.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_delete_job.py +54 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_modify_job.py +46 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_no_change_job.py +44 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/zero_pool.py +1 -0
- data/aws-crt-ffi/crt/s2n/tests/litani/test/run +82 -12
- data/aws-crt-ffi/crt/s2n/tests/s2n_test.h +58 -33
- data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_key_schedule_testlib.c +18 -6
- data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_pq_kat_test_utils.c +4 -4
- data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_testlib.h +2 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_retry_test.c +66 -2
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_drbg_test.c +34 -14
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_fork_generation_number_test.c +28 -5
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_mem_usage_test.c +6 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_override_openssl_random_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_random_test.c +60 -41
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_broken_pipe_test.c +2 -2
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_handshake_early_data_test.c +3 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_hybrid_shared_secret_test.c +9 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_key_schedule_rfc8448_test.c +31 -130
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_key_schedule_test.c +2 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_pq_handshake_test.c +11 -6
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_secrets_rfc8448_test.c +19 -21
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_secrets_test.c +109 -60
- data/aws-crt-ffi/crt/s2n/tls/s2n_config.c +1 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_config.h +1 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_connection.c +29 -24
- data/aws-crt-ffi/crt/s2n/tls/s2n_connection.h +5 -5
- data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_hashes.h +1 -7
- data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_io.c +2 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_transcript.c +0 -44
- data/aws-crt-ffi/crt/s2n/tls/s2n_internal.h +0 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.h +1 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_key_schedule.c +1 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_secrets.c +84 -44
- data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_secrets.h +3 -9
- data/aws-crt-ffi/crt/s2n/utils/s2n_blob.h +15 -8
- data/aws-crt-ffi/crt/s2n/utils/s2n_fork_detection.c +2 -6
- data/aws-crt-ffi/crt/s2n/utils/s2n_random.c +9 -9
- data/aws-crt-ffi/src/input_stream.c +32 -15
- data/ext/compile.rb +13 -5
- data/lib/aws-crt/platforms.rb +14 -5
- data/lib/aws-crt/string_blob.rb +3 -3
- metadata +61 -7
- data/aws-crt-ffi/crt/aws-c-auth/source/external/cJSON.c +0 -2987
- data/aws-crt-ffi/crt/aws-c-auth/tests/external/cJSON.c +0 -2986
- data/aws-crt-ffi/crt/aws-c-io/tests/error_test.c +0 -20
@@ -18,6 +18,23 @@
|
|
18
18
|
|
19
19
|
static const char *s_test_host_name = "127.0.0.1";
|
20
20
|
|
21
|
+
struct client_test_data {
|
22
|
+
struct aws_allocator *allocator;
|
23
|
+
int received_message_flags;
|
24
|
+
struct aws_mutex sync_lock;
|
25
|
+
struct aws_condition_variable sync_cvar;
|
26
|
+
enum aws_event_stream_rpc_message_type received_message_type;
|
27
|
+
struct aws_byte_buf received_payload;
|
28
|
+
struct aws_event_stream_rpc_server_continuation_token *server_token;
|
29
|
+
struct aws_byte_buf last_seen_operation_name;
|
30
|
+
bool client_message_sent;
|
31
|
+
bool client_message_received;
|
32
|
+
bool server_message_sent;
|
33
|
+
bool server_message_received;
|
34
|
+
bool client_token_closed;
|
35
|
+
bool server_token_closed;
|
36
|
+
};
|
37
|
+
|
21
38
|
struct test_data {
|
22
39
|
struct aws_allocator *allocator;
|
23
40
|
struct aws_event_loop_group *el_group;
|
@@ -34,6 +51,8 @@ struct test_data {
|
|
34
51
|
|
35
52
|
aws_event_stream_rpc_client_connection_protocol_message_fn *on_client_message_received;
|
36
53
|
|
54
|
+
struct client_test_data client_test_data;
|
55
|
+
|
37
56
|
void *user_data;
|
38
57
|
void *server_continuation_user_data;
|
39
58
|
struct aws_mutex shutdown_lock;
|
@@ -274,6 +293,10 @@ static int s_fixture_setup(struct aws_allocator *allocator, void *ctx) {
|
|
274
293
|
ASSERT_SUCCESS(aws_mutex_init(&test_data->shutdown_lock));
|
275
294
|
ASSERT_SUCCESS(aws_condition_variable_init(&test_data->shutdown_cvar));
|
276
295
|
|
296
|
+
ASSERT_SUCCESS(aws_mutex_init(&test_data->client_test_data.sync_lock));
|
297
|
+
ASSERT_SUCCESS(aws_condition_variable_init(&test_data->client_test_data.sync_cvar));
|
298
|
+
test_data->client_test_data.allocator = allocator;
|
299
|
+
|
277
300
|
struct aws_socket_options socket_options = {
|
278
301
|
.connect_timeout_ms = 3000,
|
279
302
|
.domain = AWS_SOCKET_IPV4,
|
@@ -350,10 +373,13 @@ static int s_fixture_shutdown(struct aws_allocator *allocator, int setup_result,
|
|
350
373
|
aws_condition_variable_wait_pred(
|
351
374
|
&test_data->shutdown_cvar, &test_data->shutdown_lock, s_event_loop_shutdown_pred, test_data);
|
352
375
|
aws_mutex_unlock(&test_data->shutdown_lock);
|
376
|
+
aws_thread_join_all_managed();
|
353
377
|
aws_mutex_clean_up(&test_data->shutdown_lock);
|
354
378
|
aws_condition_variable_clean_up(&test_data->shutdown_cvar);
|
355
379
|
aws_mutex_clean_up(&test_data->setup_lock);
|
356
380
|
aws_condition_variable_clean_up(&test_data->setup_cvar);
|
381
|
+
aws_mutex_clean_up(&test_data->client_test_data.sync_lock);
|
382
|
+
aws_condition_variable_clean_up(&test_data->client_test_data.sync_cvar);
|
357
383
|
}
|
358
384
|
|
359
385
|
aws_event_stream_library_clean_up();
|
@@ -378,34 +404,36 @@ AWS_TEST_CASE_FIXTURE(
|
|
378
404
|
s_fixture_shutdown,
|
379
405
|
&s_test_data)
|
380
406
|
|
381
|
-
struct client_test_data {
|
382
|
-
struct aws_allocator *allocator;
|
383
|
-
int received_message_flags;
|
384
|
-
struct aws_mutex sync_lock;
|
385
|
-
struct aws_condition_variable sync_cvar;
|
386
|
-
enum aws_event_stream_rpc_message_type received_message_type;
|
387
|
-
struct aws_byte_buf received_payload;
|
388
|
-
struct aws_event_stream_rpc_server_continuation_token *server_token;
|
389
|
-
struct aws_byte_buf last_seen_operation_name;
|
390
|
-
bool message_sent;
|
391
|
-
bool message_received;
|
392
|
-
bool client_token_closed;
|
393
|
-
bool server_token_closed;
|
394
|
-
};
|
395
|
-
|
396
407
|
static void s_rpc_client_message_flush(int error_code, void *user_data) {
|
397
408
|
(void)error_code;
|
398
409
|
|
399
410
|
struct client_test_data *client_test_data = user_data;
|
400
411
|
aws_mutex_lock(&client_test_data->sync_lock);
|
401
|
-
client_test_data->
|
412
|
+
client_test_data->client_message_sent = true;
|
413
|
+
aws_condition_variable_notify_one(&client_test_data->sync_cvar);
|
414
|
+
/* make these pessimistic to prevent a cleanup race. */
|
402
415
|
aws_mutex_unlock(&client_test_data->sync_lock);
|
416
|
+
}
|
417
|
+
|
418
|
+
static void s_rpc_server_message_flush(int error_code, void *user_data) {
|
419
|
+
(void)error_code;
|
420
|
+
|
421
|
+
struct client_test_data *client_test_data = user_data;
|
422
|
+
aws_mutex_lock(&client_test_data->sync_lock);
|
423
|
+
client_test_data->server_message_sent = true;
|
403
424
|
aws_condition_variable_notify_one(&client_test_data->sync_cvar);
|
425
|
+
/* make these pessimistic to prevent a cleanup race. */
|
426
|
+
aws_mutex_unlock(&client_test_data->sync_lock);
|
404
427
|
}
|
405
428
|
|
406
429
|
static bool s_rpc_client_message_transmission_completed_pred(void *arg) {
|
407
430
|
struct client_test_data *client_test_data = arg;
|
408
|
-
return client_test_data->
|
431
|
+
return client_test_data->client_message_sent && client_test_data->server_message_received;
|
432
|
+
}
|
433
|
+
|
434
|
+
static bool s_rpc_server_message_transmission_completed_pred(void *arg) {
|
435
|
+
struct client_test_data *client_test_data = arg;
|
436
|
+
return client_test_data->server_message_sent && client_test_data->client_message_received;
|
409
437
|
}
|
410
438
|
|
411
439
|
static void s_rpc_server_connection_protocol_message(
|
@@ -416,7 +444,7 @@ static void s_rpc_server_connection_protocol_message(
|
|
416
444
|
|
417
445
|
struct client_test_data *client_test_data = user_data;
|
418
446
|
aws_mutex_lock(&client_test_data->sync_lock);
|
419
|
-
client_test_data->
|
447
|
+
client_test_data->server_message_received = true;
|
420
448
|
client_test_data->received_message_type = message_args->message_type;
|
421
449
|
aws_byte_buf_init_copy(&client_test_data->received_payload, client_test_data->allocator, message_args->payload);
|
422
450
|
aws_mutex_unlock(&client_test_data->sync_lock);
|
@@ -431,7 +459,7 @@ static void s_rpc_client_connection_protocol_message(
|
|
431
459
|
struct client_test_data *client_test_data = user_data;
|
432
460
|
|
433
461
|
aws_mutex_lock(&client_test_data->sync_lock);
|
434
|
-
client_test_data->
|
462
|
+
client_test_data->client_message_received = true;
|
435
463
|
client_test_data->received_message_type = message_args->message_type;
|
436
464
|
client_test_data->received_message_flags = message_args->message_flags;
|
437
465
|
aws_byte_buf_init_copy(&client_test_data->received_payload, client_test_data->allocator, message_args->payload);
|
@@ -480,19 +508,21 @@ static int s_test_event_stream_rpc_client_connection_connect(struct aws_allocato
|
|
480
508
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
481
509
|
|
482
510
|
client_test_data.received_message_type = 0;
|
483
|
-
client_test_data.
|
484
|
-
client_test_data.
|
511
|
+
client_test_data.client_message_received = false;
|
512
|
+
client_test_data.client_message_sent = false;
|
513
|
+
client_test_data.server_message_received = false;
|
514
|
+
client_test_data.server_message_sent = false;
|
485
515
|
|
486
516
|
connect_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK;
|
487
517
|
connect_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_CONNECTION_ACCEPTED;
|
488
518
|
|
489
519
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
490
|
-
test_data->server_connection, &connect_args,
|
520
|
+
test_data->server_connection, &connect_args, s_rpc_server_message_flush, &client_test_data));
|
491
521
|
|
492
522
|
aws_condition_variable_wait_pred(
|
493
523
|
&client_test_data.sync_cvar,
|
494
524
|
&client_test_data.sync_lock,
|
495
|
-
|
525
|
+
s_rpc_server_message_transmission_completed_pred,
|
496
526
|
&client_test_data);
|
497
527
|
|
498
528
|
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data.received_message_type);
|
@@ -594,19 +624,21 @@ static int s_test_event_stream_rpc_client_connection_protocol_message(struct aws
|
|
594
624
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
595
625
|
|
596
626
|
client_test_data.received_message_type = 0;
|
597
|
-
client_test_data.
|
598
|
-
client_test_data.
|
627
|
+
client_test_data.client_message_received = false;
|
628
|
+
client_test_data.client_message_sent = false;
|
629
|
+
client_test_data.server_message_received = false;
|
630
|
+
client_test_data.server_message_sent = false;
|
599
631
|
|
600
632
|
connect_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK;
|
601
633
|
connect_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_CONNECTION_ACCEPTED;
|
602
634
|
|
603
635
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
604
|
-
test_data->server_connection, &connect_args,
|
636
|
+
test_data->server_connection, &connect_args, s_rpc_server_message_flush, &client_test_data));
|
605
637
|
|
606
638
|
aws_condition_variable_wait_pred(
|
607
639
|
&client_test_data.sync_cvar,
|
608
640
|
&client_test_data.sync_lock,
|
609
|
-
|
641
|
+
s_rpc_server_message_transmission_completed_pred,
|
610
642
|
&client_test_data);
|
611
643
|
|
612
644
|
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data.received_message_type);
|
@@ -618,8 +650,10 @@ static int s_test_event_stream_rpc_client_connection_protocol_message(struct aws
|
|
618
650
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
619
651
|
|
620
652
|
client_test_data.received_message_type = 0;
|
621
|
-
client_test_data.
|
622
|
-
client_test_data.
|
653
|
+
client_test_data.client_message_received = false;
|
654
|
+
client_test_data.client_message_sent = false;
|
655
|
+
client_test_data.server_message_received = false;
|
656
|
+
client_test_data.server_message_sent = false;
|
623
657
|
|
624
658
|
struct aws_byte_buf ping_payload =
|
625
659
|
aws_byte_buf_from_c_str("{ \"message\": \"hello device that will further isolate humans from each other "
|
@@ -652,16 +686,18 @@ static int s_test_event_stream_rpc_client_connection_protocol_message(struct aws
|
|
652
686
|
ping_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_PING_RESPONSE;
|
653
687
|
|
654
688
|
client_test_data.received_message_type = 0;
|
655
|
-
client_test_data.
|
656
|
-
client_test_data.
|
689
|
+
client_test_data.client_message_received = false;
|
690
|
+
client_test_data.client_message_sent = false;
|
691
|
+
client_test_data.server_message_received = false;
|
692
|
+
client_test_data.server_message_sent = false;
|
657
693
|
|
658
694
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
659
|
-
test_data->server_connection, &ping_args,
|
695
|
+
test_data->server_connection, &ping_args, s_rpc_server_message_flush, &client_test_data));
|
660
696
|
|
661
697
|
aws_condition_variable_wait_pred(
|
662
698
|
&client_test_data.sync_cvar,
|
663
699
|
&client_test_data.sync_lock,
|
664
|
-
|
700
|
+
s_rpc_server_message_transmission_completed_pred,
|
665
701
|
&client_test_data);
|
666
702
|
|
667
703
|
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_PING_RESPONSE, client_test_data.received_message_type);
|
@@ -697,7 +733,7 @@ static void s_rpc_client_stream_continuation(
|
|
697
733
|
struct client_test_data *client_test_data = user_data;
|
698
734
|
|
699
735
|
aws_mutex_lock(&client_test_data->sync_lock);
|
700
|
-
client_test_data->
|
736
|
+
client_test_data->client_message_received = true;
|
701
737
|
client_test_data->received_message_type = message_args->message_type;
|
702
738
|
aws_byte_buf_init_copy(&client_test_data->received_payload, client_test_data->allocator, message_args->payload);
|
703
739
|
aws_mutex_unlock(&client_test_data->sync_lock);
|
@@ -746,7 +782,7 @@ static void s_rpc_server_stream_continuation(
|
|
746
782
|
|
747
783
|
struct client_test_data *client_test_data = user_data;
|
748
784
|
aws_mutex_lock(&client_test_data->sync_lock);
|
749
|
-
client_test_data->
|
785
|
+
client_test_data->server_message_received = true;
|
750
786
|
client_test_data->received_message_type = message_args->message_type;
|
751
787
|
aws_byte_buf_init_copy(&client_test_data->received_payload, client_test_data->allocator, message_args->payload);
|
752
788
|
aws_mutex_unlock(&client_test_data->sync_lock);
|
@@ -809,19 +845,21 @@ static int s_test_event_stream_rpc_client_connection_continuation_flow(struct aw
|
|
809
845
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
810
846
|
|
811
847
|
client_test_data.received_message_type = 0;
|
812
|
-
client_test_data.
|
813
|
-
client_test_data.
|
848
|
+
client_test_data.client_message_received = false;
|
849
|
+
client_test_data.client_message_sent = false;
|
850
|
+
client_test_data.server_message_received = false;
|
851
|
+
client_test_data.server_message_sent = false;
|
814
852
|
|
815
853
|
connect_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK;
|
816
854
|
connect_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_CONNECTION_ACCEPTED;
|
817
855
|
|
818
856
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
819
|
-
test_data->server_connection, &connect_args,
|
857
|
+
test_data->server_connection, &connect_args, s_rpc_server_message_flush, &client_test_data));
|
820
858
|
|
821
859
|
aws_condition_variable_wait_pred(
|
822
860
|
&client_test_data.sync_cvar,
|
823
861
|
&client_test_data.sync_lock,
|
824
|
-
|
862
|
+
s_rpc_server_message_transmission_completed_pred,
|
825
863
|
&client_test_data);
|
826
864
|
|
827
865
|
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data.received_message_type);
|
@@ -833,8 +871,10 @@ static int s_test_event_stream_rpc_client_connection_continuation_flow(struct aw
|
|
833
871
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
834
872
|
|
835
873
|
client_test_data.received_message_type = 0;
|
836
|
-
client_test_data.
|
837
|
-
client_test_data.
|
874
|
+
client_test_data.client_message_received = false;
|
875
|
+
client_test_data.client_message_sent = false;
|
876
|
+
client_test_data.server_message_received = false;
|
877
|
+
client_test_data.server_message_sent = false;
|
838
878
|
|
839
879
|
struct aws_event_stream_rpc_client_stream_continuation_options continuation_options = {
|
840
880
|
.user_data = &client_test_data,
|
@@ -881,19 +921,21 @@ static int s_test_event_stream_rpc_client_connection_continuation_flow(struct aw
|
|
881
921
|
aws_byte_buf_clean_up(&client_test_data.last_seen_operation_name);
|
882
922
|
|
883
923
|
client_test_data.received_message_type = 0;
|
884
|
-
client_test_data.
|
885
|
-
client_test_data.
|
924
|
+
client_test_data.client_message_received = false;
|
925
|
+
client_test_data.client_message_sent = false;
|
926
|
+
client_test_data.server_message_received = false;
|
927
|
+
client_test_data.server_message_sent = false;
|
886
928
|
|
887
929
|
operation_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_TERMINATE_STREAM;
|
888
930
|
operation_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_APPLICATION_ERROR;
|
889
931
|
|
890
932
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_continuation_send_message(
|
891
|
-
client_test_data.server_token, &operation_args,
|
933
|
+
client_test_data.server_token, &operation_args, s_rpc_server_message_flush, &client_test_data));
|
892
934
|
|
893
935
|
aws_condition_variable_wait_pred(
|
894
936
|
&client_test_data.sync_cvar,
|
895
937
|
&client_test_data.sync_lock,
|
896
|
-
|
938
|
+
s_rpc_server_message_transmission_completed_pred,
|
897
939
|
&client_test_data);
|
898
940
|
|
899
941
|
aws_condition_variable_wait_pred(
|
@@ -977,19 +1019,21 @@ static int s_test_event_stream_rpc_client_connection_unactivated_continuation_fa
|
|
977
1019
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
978
1020
|
|
979
1021
|
client_test_data.received_message_type = 0;
|
980
|
-
client_test_data.
|
981
|
-
client_test_data.
|
1022
|
+
client_test_data.client_message_received = false;
|
1023
|
+
client_test_data.client_message_sent = false;
|
1024
|
+
client_test_data.server_message_received = false;
|
1025
|
+
client_test_data.server_message_sent = false;
|
982
1026
|
|
983
1027
|
connect_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK;
|
984
1028
|
connect_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_CONNECTION_ACCEPTED;
|
985
1029
|
|
986
1030
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
987
|
-
test_data->server_connection, &connect_args,
|
1031
|
+
test_data->server_connection, &connect_args, s_rpc_server_message_flush, &client_test_data));
|
988
1032
|
|
989
1033
|
aws_condition_variable_wait_pred(
|
990
1034
|
&client_test_data.sync_cvar,
|
991
1035
|
&client_test_data.sync_lock,
|
992
|
-
|
1036
|
+
s_rpc_server_message_transmission_completed_pred,
|
993
1037
|
&client_test_data);
|
994
1038
|
|
995
1039
|
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data.received_message_type);
|
@@ -1001,8 +1045,10 @@ static int s_test_event_stream_rpc_client_connection_unactivated_continuation_fa
|
|
1001
1045
|
aws_byte_buf_clean_up(&client_test_data.received_payload);
|
1002
1046
|
|
1003
1047
|
client_test_data.received_message_type = 0;
|
1004
|
-
client_test_data.
|
1005
|
-
client_test_data.
|
1048
|
+
client_test_data.client_message_received = false;
|
1049
|
+
client_test_data.client_message_sent = false;
|
1050
|
+
client_test_data.server_message_received = false;
|
1051
|
+
client_test_data.server_message_sent = false;
|
1006
1052
|
|
1007
1053
|
struct aws_event_stream_rpc_client_stream_continuation_options continuation_options = {
|
1008
1054
|
.user_data = &client_test_data,
|
@@ -1097,20 +1143,22 @@ static int s_test_event_stream_rpc_client_connection_continuation_send_message_o
|
|
1097
1143
|
|
1098
1144
|
/* server sends CONNECT_ACK */
|
1099
1145
|
client_test_data.received_message_type = 0;
|
1100
|
-
client_test_data.
|
1101
|
-
client_test_data.
|
1146
|
+
client_test_data.client_message_received = false;
|
1147
|
+
client_test_data.client_message_sent = false;
|
1148
|
+
client_test_data.server_message_received = false;
|
1149
|
+
client_test_data.server_message_sent = false;
|
1102
1150
|
|
1103
1151
|
connect_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK;
|
1104
1152
|
connect_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_CONNECTION_ACCEPTED;
|
1105
1153
|
|
1106
1154
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
1107
|
-
test_data->server_connection, &connect_args,
|
1155
|
+
test_data->server_connection, &connect_args, s_rpc_server_message_flush, &client_test_data));
|
1108
1156
|
|
1109
1157
|
/* ...wait until sent and received... */
|
1110
1158
|
aws_condition_variable_wait_pred(
|
1111
1159
|
&client_test_data.sync_cvar,
|
1112
1160
|
&client_test_data.sync_lock,
|
1113
|
-
|
1161
|
+
s_rpc_server_message_transmission_completed_pred,
|
1114
1162
|
&client_test_data);
|
1115
1163
|
|
1116
1164
|
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data.received_message_type);
|
@@ -1123,8 +1171,10 @@ static int s_test_event_stream_rpc_client_connection_continuation_send_message_o
|
|
1123
1171
|
|
1124
1172
|
/* client sends message creating new stream */
|
1125
1173
|
client_test_data.received_message_type = 0;
|
1126
|
-
client_test_data.
|
1127
|
-
client_test_data.
|
1174
|
+
client_test_data.client_message_received = false;
|
1175
|
+
client_test_data.client_message_sent = false;
|
1176
|
+
client_test_data.server_message_received = false;
|
1177
|
+
client_test_data.server_message_sent = false;
|
1128
1178
|
|
1129
1179
|
struct aws_event_stream_rpc_client_stream_continuation_options continuation_options = {
|
1130
1180
|
.user_data = &client_test_data,
|
@@ -1173,20 +1223,22 @@ static int s_test_event_stream_rpc_client_connection_continuation_send_message_o
|
|
1173
1223
|
|
1174
1224
|
/* server sends response with TERMINATE_STREAM flag set */
|
1175
1225
|
client_test_data.received_message_type = 0;
|
1176
|
-
client_test_data.
|
1177
|
-
client_test_data.
|
1226
|
+
client_test_data.client_message_received = false;
|
1227
|
+
client_test_data.client_message_sent = false;
|
1228
|
+
client_test_data.server_message_received = false;
|
1229
|
+
client_test_data.server_message_sent = false;
|
1178
1230
|
|
1179
1231
|
operation_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_TERMINATE_STREAM;
|
1180
1232
|
operation_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_APPLICATION_ERROR;
|
1181
1233
|
|
1182
1234
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_continuation_send_message(
|
1183
|
-
client_test_data.server_token, &operation_args,
|
1235
|
+
client_test_data.server_token, &operation_args, s_rpc_server_message_flush, &client_test_data));
|
1184
1236
|
|
1185
1237
|
/* ...wait until sent and received... */
|
1186
1238
|
aws_condition_variable_wait_pred(
|
1187
1239
|
&client_test_data.sync_cvar,
|
1188
1240
|
&client_test_data.sync_lock,
|
1189
|
-
|
1241
|
+
s_rpc_server_message_transmission_completed_pred,
|
1190
1242
|
&client_test_data);
|
1191
1243
|
|
1192
1244
|
/* ...wait until client stream closed... */
|
@@ -1234,6 +1286,7 @@ AWS_TEST_CASE_FIXTURE(
|
|
1234
1286
|
static int s_test_event_stream_rpc_client_connection_continuation_duplicated_activate_fails(
|
1235
1287
|
struct aws_allocator *allocator,
|
1236
1288
|
void *ctx) {
|
1289
|
+
(void)allocator;
|
1237
1290
|
|
1238
1291
|
struct test_data *test_data = ctx;
|
1239
1292
|
test_data->on_server_message_received = s_rpc_server_connection_protocol_message;
|
@@ -1242,14 +1295,10 @@ static int s_test_event_stream_rpc_client_connection_continuation_duplicated_act
|
|
1242
1295
|
test_data->on_new_server_continuation = s_rpc_server_stream_continuation;
|
1243
1296
|
test_data->on_server_continuation_closed = s_rpc_server_stream_continuation_closed;
|
1244
1297
|
|
1245
|
-
struct client_test_data client_test_data =
|
1246
|
-
.allocator = allocator,
|
1247
|
-
.sync_cvar = AWS_CONDITION_VARIABLE_INIT,
|
1248
|
-
.sync_lock = AWS_MUTEX_INIT,
|
1249
|
-
};
|
1298
|
+
struct client_test_data *client_test_data = &test_data->client_test_data;
|
1250
1299
|
|
1251
|
-
test_data->user_data =
|
1252
|
-
test_data->server_continuation_user_data =
|
1300
|
+
test_data->user_data = client_test_data;
|
1301
|
+
test_data->server_continuation_user_data = client_test_data;
|
1253
1302
|
|
1254
1303
|
struct aws_byte_buf connect_payload = aws_byte_buf_from_c_str("{ \"message\": \" connect message \" }");
|
1255
1304
|
struct aws_event_stream_rpc_message_args connect_args = {
|
@@ -1260,53 +1309,57 @@ static int s_test_event_stream_rpc_client_connection_continuation_duplicated_act
|
|
1260
1309
|
};
|
1261
1310
|
|
1262
1311
|
ASSERT_SUCCESS(aws_event_stream_rpc_client_connection_send_protocol_message(
|
1263
|
-
test_data->client_connection, &connect_args, s_rpc_client_message_flush,
|
1312
|
+
test_data->client_connection, &connect_args, s_rpc_client_message_flush, client_test_data));
|
1264
1313
|
|
1265
|
-
aws_mutex_lock(&client_test_data
|
1314
|
+
aws_mutex_lock(&client_test_data->sync_lock);
|
1266
1315
|
aws_condition_variable_wait_pred(
|
1267
|
-
&client_test_data
|
1268
|
-
&client_test_data
|
1316
|
+
&client_test_data->sync_cvar,
|
1317
|
+
&client_test_data->sync_lock,
|
1269
1318
|
s_rpc_client_message_transmission_completed_pred,
|
1270
|
-
|
1319
|
+
client_test_data);
|
1271
1320
|
|
1272
|
-
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT, client_test_data
|
1321
|
+
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT, client_test_data->received_message_type);
|
1273
1322
|
ASSERT_BIN_ARRAYS_EQUALS(
|
1274
1323
|
connect_payload.buffer,
|
1275
1324
|
connect_payload.len,
|
1276
|
-
client_test_data
|
1277
|
-
client_test_data
|
1278
|
-
aws_byte_buf_clean_up(&client_test_data
|
1325
|
+
client_test_data->received_payload.buffer,
|
1326
|
+
client_test_data->received_payload.len);
|
1327
|
+
aws_byte_buf_clean_up(&client_test_data->received_payload);
|
1279
1328
|
|
1280
|
-
client_test_data
|
1281
|
-
client_test_data
|
1282
|
-
client_test_data
|
1329
|
+
client_test_data->received_message_type = 0;
|
1330
|
+
client_test_data->client_message_received = false;
|
1331
|
+
client_test_data->client_message_sent = false;
|
1332
|
+
client_test_data->server_message_received = false;
|
1333
|
+
client_test_data->server_message_sent = false;
|
1283
1334
|
|
1284
1335
|
connect_args.message_type = AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK;
|
1285
1336
|
connect_args.message_flags = AWS_EVENT_STREAM_RPC_MESSAGE_FLAG_CONNECTION_ACCEPTED;
|
1286
1337
|
|
1287
1338
|
ASSERT_SUCCESS(aws_event_stream_rpc_server_connection_send_protocol_message(
|
1288
|
-
test_data->server_connection, &connect_args,
|
1339
|
+
test_data->server_connection, &connect_args, s_rpc_server_message_flush, client_test_data));
|
1289
1340
|
|
1290
1341
|
aws_condition_variable_wait_pred(
|
1291
|
-
&client_test_data
|
1292
|
-
&client_test_data
|
1293
|
-
|
1294
|
-
|
1342
|
+
&client_test_data->sync_cvar,
|
1343
|
+
&client_test_data->sync_lock,
|
1344
|
+
s_rpc_server_message_transmission_completed_pred,
|
1345
|
+
client_test_data);
|
1295
1346
|
|
1296
|
-
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data
|
1347
|
+
ASSERT_INT_EQUALS(AWS_EVENT_STREAM_RPC_MESSAGE_TYPE_CONNECT_ACK, client_test_data->received_message_type);
|
1297
1348
|
ASSERT_BIN_ARRAYS_EQUALS(
|
1298
1349
|
connect_payload.buffer,
|
1299
1350
|
connect_payload.len,
|
1300
|
-
client_test_data
|
1301
|
-
client_test_data
|
1302
|
-
aws_byte_buf_clean_up(&client_test_data
|
1351
|
+
client_test_data->received_payload.buffer,
|
1352
|
+
client_test_data->received_payload.len);
|
1353
|
+
aws_byte_buf_clean_up(&client_test_data->received_payload);
|
1303
1354
|
|
1304
|
-
client_test_data
|
1305
|
-
client_test_data
|
1306
|
-
client_test_data
|
1355
|
+
client_test_data->received_message_type = 0;
|
1356
|
+
client_test_data->client_message_received = false;
|
1357
|
+
client_test_data->client_message_sent = false;
|
1358
|
+
client_test_data->server_message_received = false;
|
1359
|
+
client_test_data->server_message_sent = false;
|
1307
1360
|
|
1308
1361
|
struct aws_event_stream_rpc_client_stream_continuation_options continuation_options = {
|
1309
|
-
.user_data =
|
1362
|
+
.user_data = client_test_data,
|
1310
1363
|
.on_continuation = s_rpc_client_stream_continuation,
|
1311
1364
|
.on_continuation_closed = s_rpc_client_stream_continuation_closed,
|
1312
1365
|
};
|
@@ -1326,20 +1379,20 @@ static int s_test_event_stream_rpc_client_connection_continuation_duplicated_act
|
|
1326
1379
|
};
|
1327
1380
|
|
1328
1381
|
ASSERT_SUCCESS(aws_event_stream_rpc_client_continuation_activate(
|
1329
|
-
client_token, operation_name, &operation_args, s_rpc_client_message_flush,
|
1382
|
+
client_token, operation_name, &operation_args, s_rpc_client_message_flush, client_test_data));
|
1330
1383
|
|
1331
1384
|
aws_condition_variable_wait_pred(
|
1332
|
-
&client_test_data
|
1333
|
-
&client_test_data
|
1385
|
+
&client_test_data->sync_cvar,
|
1386
|
+
&client_test_data->sync_lock,
|
1334
1387
|
s_rpc_client_message_transmission_completed_pred,
|
1335
|
-
|
1336
|
-
aws_byte_buf_clean_up(&client_test_data
|
1337
|
-
aws_byte_buf_clean_up(&client_test_data
|
1388
|
+
client_test_data);
|
1389
|
+
aws_byte_buf_clean_up(&client_test_data->received_payload);
|
1390
|
+
aws_byte_buf_clean_up(&client_test_data->last_seen_operation_name);
|
1338
1391
|
|
1339
1392
|
ASSERT_ERROR(
|
1340
1393
|
AWS_ERROR_INVALID_STATE,
|
1341
1394
|
aws_event_stream_rpc_client_continuation_activate(
|
1342
|
-
client_token, operation_name, &operation_args, s_rpc_client_message_flush,
|
1395
|
+
client_token, operation_name, &operation_args, s_rpc_client_message_flush, client_test_data));
|
1343
1396
|
|
1344
1397
|
aws_event_stream_rpc_client_continuation_release(client_token);
|
1345
1398
|
|
@@ -1347,14 +1400,12 @@ static int s_test_event_stream_rpc_client_connection_continuation_duplicated_act
|
|
1347
1400
|
aws_event_stream_rpc_server_connection_close(test_data->server_connection, AWS_ERROR_SUCCESS);
|
1348
1401
|
|
1349
1402
|
aws_condition_variable_wait_pred(
|
1350
|
-
&client_test_data
|
1351
|
-
&client_test_data
|
1403
|
+
&client_test_data->sync_cvar,
|
1404
|
+
&client_test_data->sync_lock,
|
1352
1405
|
s_rpc_client_continuation_token_closed_pred,
|
1353
|
-
|
1406
|
+
client_test_data);
|
1354
1407
|
|
1355
|
-
aws_mutex_unlock(&client_test_data
|
1356
|
-
aws_mutex_clean_up(&client_test_data.sync_lock);
|
1357
|
-
aws_condition_variable_clean_up(&client_test_data.sync_cvar);
|
1408
|
+
aws_mutex_unlock(&client_test_data->sync_lock);
|
1358
1409
|
|
1359
1410
|
return AWS_OP_SUCCESS;
|
1360
1411
|
}
|