Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anarthal committed Jul 11, 2024
1 parent 952e05b commit dfb8bdc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/integration/test/any_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ BOOST_AUTO_TEST_CASE(tcp_ssl_mode_enable)
BOOST_TEST(conn.uses_ssl());
}

#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
// UNIX connections never use SSL
BOOST_TEST_DECORATOR(*run_if(&server_features::unix_sockets))
BOOST_AUTO_TEST_CASE(unix_ssl)
Expand All @@ -137,6 +138,7 @@ BOOST_AUTO_TEST_CASE(unix_ssl)
// no point in using SSL with UNIX sockets
BOOST_TEST(!conn.uses_ssl());
}
#endif

// Spotcheck: users can log-in using the caching_sha2_password auth plugin
BOOST_TEST_DECORATOR(*run_if(&server_features::sha256))
Expand All @@ -156,6 +158,7 @@ BOOST_AUTO_TEST_CASE(tcp_caching_sha2_password)
BOOST_TEST(conn.uses_ssl());
}

#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
// Users can log-in using the caching_sha2_password auth plugin
// even if they're using UNIX sockets.
BOOST_TEST_DECORATOR(*run_if(&server_features::sha256, &server_features::unix_sockets))
Expand Down Expand Up @@ -185,6 +188,7 @@ BOOST_AUTO_TEST_CASE(unix_caching_sha2_password)
connect_fn(conn, params).validate_no_error();
BOOST_TEST(!conn.uses_ssl());
}
#endif

network_result<void> create_net_result()
{
Expand Down
2 changes: 2 additions & 0 deletions test/integration/test/connection_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ BOOST_FIXTURE_TEST_CASE(get_connection_timeout, fixture)
});
}

#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
// Spotcheck: pool works with unix sockets, too
BOOST_TEST_DECORATOR(*run_if(&server_features::unix_sockets))
BOOST_FIXTURE_TEST_CASE(unix_sockets, fixture)
Expand All @@ -538,6 +539,7 @@ BOOST_FIXTURE_TEST_CASE(unix_sockets, fixture)
conn->async_ping(yield);
});
}
#endif

// Spotcheck: pool works with TLS
BOOST_FIXTURE_TEST_CASE(ssl, fixture)
Expand Down
2 changes: 2 additions & 0 deletions test/integration/test/reconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ BOOST_FIXTURE_TEST_CASE(change_stream_type_tcp, change_stream_type_fixture)
run(test_cases);
}

#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
// UNIX cases. Note that some sync cases are not included, to save testing time
BOOST_TEST_DECORATOR(*run_if(&server_features::unix_sockets))
BOOST_FIXTURE_TEST_CASE(change_stream_type_unix, change_stream_type_fixture)
Expand All @@ -270,6 +271,7 @@ BOOST_FIXTURE_TEST_CASE(change_stream_type_unix, change_stream_type_fixture)
};
run(test_cases);
}
#endif

BOOST_AUTO_TEST_SUITE_END() // test_reconnect

Expand Down
4 changes: 3 additions & 1 deletion test/integration/test/snippets/any_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ BOOST_AUTO_TEST_CASE(section_any_connection_tcp)
create_and_connect(get_hostname(), mysql_username, mysql_password, "boost_mysql_examples");
}

// Intentionally not run, since it creates problems in Windows CIs
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS

//[any_connection_unix
void create_and_connect_unix(string_view username, string_view password, string_view database)
{
Expand Down Expand Up @@ -93,6 +94,7 @@ BOOST_AUTO_TEST_CASE(section_any_connection_unix)
{
create_and_connect_unix(mysql_username, mysql_password, "boost_mysql_examples");
}
#endif

//[any_connection_reconnect
error_code connect_with_retries(
Expand Down

0 comments on commit dfb8bdc

Please sign in to comment.