Replace the autouse fixtures which were only used to change the initial
server configuration into proper bootstrap() functions. This gets rid of
an extraneous reconfigure.
In the tests_validation_many_anchors.py, split the fixture into a proper
bootstrap() and a separate test for checking the expected log lines for
the ignored keys. Previously, the test was broken - it should check for
all the messages being present in the log, and some of the keys are
actually initial-key rather than static-key. This has been fixed in the
parametrized test.
(cherry picked from commit
fb4345afd43263f8c4c842e731f9262a75d4f61b)
]
-def reconfigure_servers(ftype, family, servers, templates):
- for server_id in ["ns1", "ns2", "ns3", "ns4"]:
- templates.render(
- f"{server_id}/named.conf", {"family": family, "filtertype": ftype}
- )
- servers[server_id].reconfigure(log=False)
-
-
def check_filtertype_only(dest, source, qname, ftype, expected, adflag):
qname = dns.name.from_text(qname)
check_filter,
check_filter_other_family,
prime_cache,
- reconfigure_servers,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)
+def bootstrap():
+ return {
+ "family": "v4",
+ "filtertype": "a",
+ }
+
+
@pytest.fixture(scope="module", autouse=True)
-def setup_filters(servers, templates):
- isctest.log.info("configuring server to filter A on V4")
- reconfigure_servers("a", "v4", servers, templates)
+def setup_filters():
prime_cache("10.53.0.2")
prime_cache("10.53.0.3")
check_filter,
check_filter_other_family,
prime_cache,
- reconfigure_servers,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)
+def bootstrap():
+ return {
+ "family": "v6",
+ "filtertype": "a",
+ }
+
+
@pytest.fixture(scope="module", autouse=True)
-def setup_filters(servers, templates):
- isctest.log.info("configuring server to filter A on V6")
- reconfigure_servers("a", "v6", servers, templates)
+def setup_filters():
prime_cache("fd92:7065:b8e:ffff::2")
prime_cache("fd92:7065:b8e:ffff::3")
check_filter,
check_filter_other_family,
prime_cache,
- reconfigure_servers,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)
+def bootstrap():
+ return {
+ "family": "v4",
+ "filtertype": "aaaa",
+ }
+
+
@pytest.fixture(scope="module", autouse=True)
-def setup_filters(servers, templates):
- isctest.log.info("configuring server to filter AAAA on V4")
- reconfigure_servers("aaaa", "v4", servers, templates)
+def setup_filters():
prime_cache("10.53.0.2")
prime_cache("10.53.0.3")
check_filter,
check_filter_other_family,
prime_cache,
- reconfigure_servers,
)
pytestmark = pytest.mark.extra_artifacts(ARTIFACTS)
+def bootstrap():
+ return {
+ "family": "v6",
+ "filtertype": "aaaa",
+ }
+
+
@pytest.fixture(scope="module", autouse=True)
-def setup_filters(servers, templates):
- isctest.log.info("configuring server to filter AAAA on V6")
- reconfigure_servers("aaaa", "v6", servers, templates)
+def setup_filters():
prime_cache("fd92:7065:b8e:ffff::2")
prime_cache("fd92:7065:b8e:ffff::3")