]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remote: add ALSO-NOTIFY unit test 8701/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 14 Jan 2020 15:58:59 +0000 (16:58 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 17 Jan 2020 08:31:54 +0000 (09:31 +0100)
modules/remotebackend/test-remotebackend.cc

index acabae29336a86ec513cda617d410f7ea0fb5bd8..13d803b560450d5378d6bd17a09752235a000a91 100644 (file)
@@ -89,6 +89,17 @@ BOOST_AUTO_TEST_CASE(test_method_setDomainMetadata) {
    BOOST_CHECK(be->setDomainMetadata(DNSName("unit.test."),"TEST", meta));
 }
 
+BOOST_AUTO_TEST_CASE(test_method_alsoNotifies) {
+   BOOST_CHECK(be->setDomainMetadata(DNSName("unit.test."),"ALSO-NOTIFY", {"192.0.2.1"}));
+   std::set<std::string> alsoNotifies;
+   BOOST_TEST_MESSAGE("Testing alsoNotifies method");
+   be->alsoNotifies(DNSName("unit.test."), &alsoNotifies);
+   BOOST_CHECK_EQUAL(alsoNotifies.size(), 1);
+   if (alsoNotifies.size() > 0)
+      BOOST_CHECK_EQUAL(alsoNotifies.count("192.0.2.1"), 1);
+   BOOST_CHECK(be->setDomainMetadata(DNSName("unit.test."),"ALSO-NOTIFY", std::vector<std::string>()));
+}
+
 BOOST_AUTO_TEST_CASE(test_method_getDomainMetadata) {
    std::vector<std::string> meta;
    BOOST_TEST_MESSAGE("Testing getDomainMetadata method");