From: Colin Vidal Date: Wed, 10 Sep 2025 13:17:11 +0000 (+0200) Subject: apply_configuration: log subroutines for tests X-Git-Tag: v9.21.14~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fe239e5cfa859557ed63fa2d08ffb9a484e265c;p=thirdparty%2Fbind9.git 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. --- diff --git a/bin/named/server.c b/bin/named/server.c index ef0a7451f54..fad8716f809 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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"). */ diff --git a/bin/tests/system/configloading/tests_configloading.py b/bin/tests/system/configloading/tests_configloading.py index f0a136cc36f..92a19077412 100644 --- a/bin/tests/system/configloading/tests_configloading.py +++ b/bin/tests/system/configloading/tests_configloading.py @@ -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", ]