Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark "net tests" that need to create a valid TLS ctx #85

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ if (UNIX AND NOT APPLE)
add_test_case(devicedefender_publish_failure_callback_invoked)
endif()

add_test_case(secure_tunneling_functionality_connect_test)
add_test_case(secure_tunneling_functionality_client_token_test)
add_test_case(secure_tunneling_fail_and_retry_connection_test)
add_test_case(secure_tunneling_store_service_ids_test)
add_test_case(secure_tunneling_receive_stream_start_test)
add_test_case(secure_tunneling_rejected_service_id_stream_start_test)
add_test_case(secure_tunneling_close_stream_on_stream_reset_test)
add_test_case(secure_tunneling_session_reset_test)
add_test_case(secure_tunneling_serializer_data_message_test)
add_net_test_case(secure_tunneling_functionality_connect_test)
add_net_test_case(secure_tunneling_functionality_client_token_test)
add_net_test_case(secure_tunneling_fail_and_retry_connection_test)
add_net_test_case(secure_tunneling_store_service_ids_test)
add_net_test_case(secure_tunneling_receive_stream_start_test)
add_net_test_case(secure_tunneling_rejected_service_id_stream_start_test)
add_net_test_case(secure_tunneling_close_stream_on_stream_reset_test)
add_net_test_case(secure_tunneling_session_reset_test)
add_net_test_case(secure_tunneling_serializer_data_message_test)

generate_test_driver(${PROJECT_NAME}-tests)

Expand Down
5 changes: 5 additions & 0 deletions tests/secure_tunnel_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,14 @@ int aws_secure_tunnel_mock_test_fixture_init(
test_fixture->socket_options = socket_options;

test_fixture->secure_tunnel_elg = aws_event_loop_group_new_default(allocator, 4, NULL);
ASSERT_NOT_NULL(test_fixture->secure_tunnel_elg);

struct aws_host_resolver_default_options resolver_options = {
.el_group = test_fixture->secure_tunnel_elg,
.max_entries = 1,
};
test_fixture->host_resolver = aws_host_resolver_new_default(allocator, &resolver_options);
ASSERT_NOT_NULL(test_fixture->host_resolver);

struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = test_fixture->secure_tunnel_elg,
Expand All @@ -456,6 +459,7 @@ int aws_secure_tunnel_mock_test_fixture_init(
};

test_fixture->secure_tunnel_bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);
ASSERT_NOT_NULL(test_fixture->secure_tunnel_bootstrap);

uint64_t timestamp = 0;
ASSERT_SUCCESS(aws_sys_clock_get_ticks(&timestamp));
Expand Down Expand Up @@ -485,6 +489,7 @@ int aws_secure_tunnel_mock_test_fixture_init(
options->secure_tunnel_options->secure_tunnel_on_termination_user_data = test_fixture;

test_fixture->secure_tunnel = aws_secure_tunnel_new(allocator, options->secure_tunnel_options);
ASSERT_NOT_NULL(test_fixture->secure_tunnel);

/* Replace Secure Tunnel's vtable functions */
test_fixture->secure_tunnel_vtable = *aws_secure_tunnel_get_default_vtable();
Expand Down