Skip to content

Commit

Permalink
Mark "net tests" that need to create a valid TLS ctx (#85)
Browse files Browse the repository at this point in the history
In some environments, we can't set up TLS, so don't run these tests.
  • Loading branch information
graebm authored Mar 21, 2023
1 parent 4d0ac36 commit 03c7ca4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
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

0 comments on commit 03c7ca4

Please sign in to comment.