]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
apply_configuration: log subroutines for tests
authorColin Vidal <colin@isc.org>
Wed, 10 Sep 2025 13:17:11 +0000 (15:17 +0200)
committerColin Vidal <colin@isc.org>
Wed, 24 Sep 2025 08:54:50 +0000 (10:54 +0200)
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.

bin/named/server.c
bin/tests/system/configloading/tests_configloading.py

index ef0a7451f546865566aabc1a2ed6ba80a69977cb..fad8716f809d2ca7950a066fa8abfb101eef6b17 100644 (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").
         */
index f0a136cc36f6c1046ec4577a5527b2f09156f659..92a19077412c4e571249de4e7b6b7a5feab9f533 100644 (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",
     ]