2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Merge branch 'artem-fix-tlsdns-tcpdns-unit-tests-connect-func-passing' into 'main'

Fix TCP and TLS DNS tests: properly pass connection callback

See merge request isc-projects/bind9!6986
This commit is contained in:
Artem Boldariev
2022-11-01 13:24:23 +00:00
3 changed files with 10 additions and 11 deletions

View File

@@ -354,8 +354,6 @@ void
connect_connect_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
isc_nmhandle_t *readhandle = NULL;
UNUSED(cbarg);
F();
isc_refcount_decrement(&active_cconnects);
@@ -369,7 +367,8 @@ connect_connect_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
do_cconnects_shutdown(loopmgr);
} else if (do_send) {
isc_job_run(loopmgr, stream_recv_send_connect,
get_stream_connect_function());
(cbarg == NULL ? get_stream_connect_function()
: (stream_connect_function)cbarg));
}
isc_refcount_increment0(&active_creads);

View File

@@ -61,7 +61,7 @@ start_listening(uint32_t nworkers, isc_nm_accept_cb_t accept_cb,
static void
tcpdns_connect(isc_nm_t *nm) {
isc_nm_tcpdnsconnect(nm, &tcp_connect_addr, &tcp_listen_addr,
connect_connect_cb, NULL, T_CONNECT);
connect_connect_cb, tcpdns_connect, T_CONNECT);
}
ISC_LOOP_TEST_IMPL(tcpdns_noop) {
@@ -70,7 +70,7 @@ ISC_LOOP_TEST_IMPL(tcpdns_noop) {
connect_readcb = NULL;
isc_refcount_increment0(&active_cconnects);
isc_nm_tcpdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
connect_success_cb, NULL, T_CONNECT);
connect_success_cb, tcpdns_connect, T_CONNECT);
}
ISC_LOOP_TEST_IMPL(tcpdns_noresponse) {
@@ -78,7 +78,7 @@ ISC_LOOP_TEST_IMPL(tcpdns_noresponse) {
isc_refcount_increment0(&active_cconnects);
isc_nm_tcpdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
connect_connect_cb, NULL, T_CONNECT);
connect_connect_cb, tcpdns_connect, T_CONNECT);
}
ISC_LOOP_TEST_IMPL(tcpdns_timeout_recovery) {

View File

@@ -60,7 +60,7 @@ start_listening(uint32_t nworkers, isc_nm_accept_cb_t accept_cb,
static void
tlsdns_connect(isc_nm_t *nm) {
isc_nm_tlsdnsconnect(nm, &tcp_connect_addr, &tcp_listen_addr,
connect_connect_cb, NULL, T_CONNECT,
connect_connect_cb, tlsdns_connect, T_CONNECT,
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
}
@@ -70,7 +70,7 @@ ISC_LOOP_TEST_IMPL(tlsdns_noop) {
connect_readcb = NULL;
isc_refcount_increment0(&active_cconnects);
isc_nm_tlsdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
connect_success_cb, NULL, T_CONNECT,
connect_success_cb, tlsdns_connect, T_CONNECT,
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
}
@@ -79,7 +79,7 @@ ISC_LOOP_TEST_IMPL(tlsdns_noresponse) {
isc_refcount_increment0(&active_cconnects);
isc_nm_tlsdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
connect_connect_cb, NULL, T_CONNECT,
connect_connect_cb, tlsdns_connect, T_CONNECT,
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
}
@@ -100,7 +100,7 @@ ISC_LOOP_TEST_IMPL(tlsdns_timeout_recovery) {
isc_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT);
isc_refcount_increment0(&active_cconnects);
isc_nm_tlsdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
connect_connect_cb, NULL, T_SOFT,
connect_connect_cb, tlsdns_connect, T_SOFT,
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
}
@@ -150,7 +150,7 @@ ISC_TEST_LIST_END
static int
tlsdns_setup(void **state __attribute__((__unused__))) {
stream_port = TCPDNS_TEST_PORT;
stream_port = TLSDNS_TEST_PORT;
return (0);
}