diff options
| author | Michael Biebl <biebl@debian.org> | 2025-09-12 19:47:07 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-09-12 19:47:07 +0200 |
| commit | bc5f10851bffd6af1c2855635be7a28b6dba3195 (patch) | |
| tree | d47255895378efcdc0a32c2ddeed055f76935654 /src/core/tests/config/test-config.c | |
| parent | 7e9091a5960f67a84787c03153324915220e4816 (diff) | |
New upstream version 1.54.1 upstream/1.54.1
Diffstat (limited to 'src/core/tests/config/test-config.c')
| -rw-r--r-- | src/core/tests/config/test-config.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/tests/config/test-config.c b/src/core/tests/config/test-config.c index 2980cda7..78fd1057 100644 --- a/src/core/tests/config/test-config.c +++ b/src/core/tests/config/test-config.c @@ -387,7 +387,27 @@ test_config_global_dns(void) g_assert(dns); g_object_unref(config); - /* Check that a file with a domain domain, but without a default one gives a NULL configuration */ + /* Check that a file with an empty global-dns section gives a good configuration. + * Check also that searches and options are not NULL, as this is how we expose to + * D-Bus that global-dns is defined. */ + config = + setup_config(NULL, TEST_DIR "/global-dns-empty.conf", "", NULL, "/no/such/dir", "", NULL); + dns = nm_config_data_get_global_dns_config(nm_config_get_data_orig(config)); + g_assert(dns); + g_assert(nm_global_dns_config_get_searches(dns)); + g_assert(nm_global_dns_config_get_options(dns)); + g_object_unref(config); + + /* Check that a file with a domain, but no global-dns, assumes an implicit empty global-dns */ + config = + setup_config(NULL, TEST_DIR "/global-dns-not-set.conf", "", NULL, "/no/such/dir", "", NULL); + dns = nm_config_data_get_global_dns_config(nm_config_get_data_orig(config)); + g_assert(dns); + g_assert(nm_global_dns_config_get_searches(dns)); + g_assert(nm_global_dns_config_get_options(dns)); + g_object_unref(config); + + /* Check that a file with a domain, but without a default one, gives a NULL configuration */ config = setup_config(NULL, TEST_DIR "/global-dns-invalid.conf", "", NULL, "/no/such/dir", "", NULL); dns = nm_config_data_get_global_dns_config(nm_config_get_data_orig(config)); |