}
}
+ if (action == DNSAction::Action::Drop) {
+ continue;
+ }
+
if(dq.dh->qr) { // something turned it into a response
char* response = query;
uint16_t responseLen = dq.len;
mySMN = newSuffixMatchNode()
mySMN:add(newDNSName("nameAndQtype.tests.powerdns.com."))
addAction(AndRule{SuffixMatchNodeRule(mySMN), QTypeRule("TXT")}, RCodeAction(4))
+ addAction(makeRule("drop.test.powerdns.com."), DropAction())
block=newDNSName("powerdns.org.")
function blockFilter(dq)
if(dq.qname:isPartOf(block))
class TestBasics(DNSDistTest):
+ def testDropped(self):
+ """
+ Basics: Dropped query
+
+ Send an A query for drop.test.powerdns.com. domain,
+ which is dropped by configuration. We expect
+ no response.
+ """
+ name = 'drop.test.powerdns.com.'
+ query = dns.message.make_query(name, 'A', 'IN')
+ (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
+ self.assertEquals(receivedResponse, None)
+
+ (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
+ self.assertEquals(receivedResponse, None)
+
def testBlockedA(self):
"""
Basics: Blocked A query