mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +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:
@@ -354,8 +354,6 @@ void
|
|||||||
connect_connect_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
|
connect_connect_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
|
||||||
isc_nmhandle_t *readhandle = NULL;
|
isc_nmhandle_t *readhandle = NULL;
|
||||||
|
|
||||||
UNUSED(cbarg);
|
|
||||||
|
|
||||||
F();
|
F();
|
||||||
|
|
||||||
isc_refcount_decrement(&active_cconnects);
|
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);
|
do_cconnects_shutdown(loopmgr);
|
||||||
} else if (do_send) {
|
} else if (do_send) {
|
||||||
isc_job_run(loopmgr, stream_recv_send_connect,
|
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);
|
isc_refcount_increment0(&active_creads);
|
||||||
|
@@ -61,7 +61,7 @@ start_listening(uint32_t nworkers, isc_nm_accept_cb_t accept_cb,
|
|||||||
static void
|
static void
|
||||||
tcpdns_connect(isc_nm_t *nm) {
|
tcpdns_connect(isc_nm_t *nm) {
|
||||||
isc_nm_tcpdnsconnect(nm, &tcp_connect_addr, &tcp_listen_addr,
|
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) {
|
ISC_LOOP_TEST_IMPL(tcpdns_noop) {
|
||||||
@@ -70,7 +70,7 @@ ISC_LOOP_TEST_IMPL(tcpdns_noop) {
|
|||||||
connect_readcb = NULL;
|
connect_readcb = NULL;
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
isc_nm_tcpdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
|
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) {
|
ISC_LOOP_TEST_IMPL(tcpdns_noresponse) {
|
||||||
@@ -78,7 +78,7 @@ ISC_LOOP_TEST_IMPL(tcpdns_noresponse) {
|
|||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
isc_nm_tcpdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
|
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) {
|
ISC_LOOP_TEST_IMPL(tcpdns_timeout_recovery) {
|
||||||
|
@@ -60,7 +60,7 @@ start_listening(uint32_t nworkers, isc_nm_accept_cb_t accept_cb,
|
|||||||
static void
|
static void
|
||||||
tlsdns_connect(isc_nm_t *nm) {
|
tlsdns_connect(isc_nm_t *nm) {
|
||||||
isc_nm_tlsdnsconnect(nm, &tcp_connect_addr, &tcp_listen_addr,
|
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);
|
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ ISC_LOOP_TEST_IMPL(tlsdns_noop) {
|
|||||||
connect_readcb = NULL;
|
connect_readcb = NULL;
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
isc_nm_tlsdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
|
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);
|
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ ISC_LOOP_TEST_IMPL(tlsdns_noresponse) {
|
|||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
isc_nm_tlsdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
|
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);
|
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_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT);
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
isc_nm_tlsdnsconnect(connect_nm, &tcp_connect_addr, &tcp_listen_addr,
|
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);
|
tcp_connect_tlsctx, tcp_tlsctx_client_sess_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ ISC_TEST_LIST_END
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
tlsdns_setup(void **state __attribute__((__unused__))) {
|
tlsdns_setup(void **state __attribute__((__unused__))) {
|
||||||
stream_port = TCPDNS_TEST_PORT;
|
stream_port = TLSDNS_TEST_PORT;
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user