Report managed DNS secondary addresses for service inventory
This commit is contained in:
1 parent
62c1e9bf54
commit
805305f24b
7 files changed
+210
-5
No files matched your search
@@ -66,6 +66,33 @@ class DNSCatalogSandboxTests(unittest.TestCase):
|
||||
self.enterContext(patch("coulobre.node_files.locked_root_directory"))
|
||||
self.run_command = self.enterContext(patch.object(engine, "run"))
|
||||
|
||||
def test_inventory_reads_only_the_managed_primary_and_notify_address(self):
|
||||
primary = secondary.configuration("primary", "2001:0db8::53")
|
||||
primary = primary.replace(
|
||||
str(self.key), "/etc/bind/coulobre-transfer.key"
|
||||
)
|
||||
replica = secondary.configuration("secondary", self.peer)
|
||||
replica = replica.replace(
|
||||
str(self.key), "/etc/bind/coulobre-transfer.key"
|
||||
)
|
||||
for content, expected in (
|
||||
(primary, "2001:db8::53"),
|
||||
(replica, None),
|
||||
(roles.BIND_CONFIG, None),
|
||||
(primary.replace("2001:0db8::53", "bad.example"), None),
|
||||
):
|
||||
with (
|
||||
self.subTest(expected=expected),
|
||||
patch.object(dns_catalog, "BIND_CONFIG", self.config),
|
||||
patch.object(dns_catalog, "require_root_directory"),
|
||||
patch.object(
|
||||
dns_catalog, "read_root_file", return_value=content
|
||||
),
|
||||
):
|
||||
self.assertEqual(
|
||||
dns_catalog.managed_secondary_address(), expected
|
||||
)
|
||||
|
||||
def test_primary_can_write_only_the_catalog_directory(self):
|
||||
secondary.setup("primary", self.peer)
|
||||
|
||||
|
||||
Reference in new issue
Block a user