apply_configuration: log subroutines for tests

In order to have a (minimal) test ensuring we don't move back
`apply_configuration` subroutines which can be done before the exclusive
lock is taken, `APPLY_CONFIGURATION_SUBROUTINE_LOG` macro is added and
used for the few subroutines already extracted from the exclusive mode.
Those expected logs are added in `configloading` system test checks.
This commit is contained in:
Colin Vidal 2025-09-10 15:17:11 +02:00
parent c225ba17c2
commit 3fe239e5cf
2 changed files with 18 additions and 2 deletions

View file

@ -7847,12 +7847,18 @@ cleanup:
#endif /* HAVE_LMDB */
#define APPLY_CONFIGURATION_SUBROUTINE_LOG \
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, \
ISC_LOG_DEBUG(1), "apply_configuration: %s", __func__);
static isc_result_t
create_views(cfg_obj_t *config, cfg_parser_t *parser,
cfg_aclconfctx_t *aclconfctx, dns_viewlist_t *viewlist) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *views = NULL;
APPLY_CONFIGURATION_SUBROUTINE_LOG;
(void)cfg_map_get(config, "view", &views);
CFG_LIST_FOREACH(views, element) {
cfg_obj_t *vconfig = cfg_listelt_value(element);
@ -7905,6 +7911,8 @@ configure_views(cfg_obj_t *config, const cfg_obj_t *bindkeys,
const cfg_obj_t *views = NULL;
dns_viewlist_t tmpviewlist;
APPLY_CONFIGURATION_SUBROUTINE_LOG;
/*
* Configure and freeze all explicit views. Explicit
* views that have zones were already created at parsing
@ -8010,6 +8018,8 @@ configure_keystores(const cfg_obj_t *config, dns_keystorelist_t *keystorelist) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *keystores = NULL;
APPLY_CONFIGURATION_SUBROUTINE_LOG;
/*
* Create the built-in key store ("key-directory").
*/
@ -8043,6 +8053,8 @@ configure_kasplist(const cfg_obj_t *config, dns_kasplist_t *kasplist,
dns_kasp_t *default_kasp = NULL;
const cfg_obj_t *kasps = NULL;
APPLY_CONFIGURATION_SUBROUTINE_LOG;
/*
* Create the built-in kasp policies ("default", "insecure").
*/

View file

@ -13,8 +13,9 @@
def test_configloading_log(ns1):
"""
This test is a "guard/warning" to make sure the named.conf loading
(parsing) is done outside of the exclusive mode (so, named is still able to
answer queries and operating normally in case of configuration reload). It
(parsing), keystore building, kasplist building and view creation is done
outside of the exclusive mode (so, named is still able to answer queries
and operating normally in case of configuration reload). It
is currently based on logging, so it's quite brittle.
"""
@ -22,6 +23,9 @@ def test_configloading_log(ns1):
"load_configuration",
"parsing user configuration from ",
"apply_configuration",
"apply_configuration: configure_keystores",
"apply_configuration: configure_kasplist",
"apply_configuration: create_views",
"loop exclusive mode: starting",
]