self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(query, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(query, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
def testSpoofAAAA(self):
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
def testSpoofCNAME(self):
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
class TestAdvancedPoolRouting(DNSDistTest):
(receivedQuery, receivedResponse) = self.sendUDPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
(receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
for idx in range(numberOfQueries):
(receivedQuery, receivedResponse) = self.sendUDPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
for idx in range(numberOfQueries):
(receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
for idx in range(numberOfQueries):
(receivedQuery, receivedResponse) = self.sendUDPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
for idx in range(numberOfQueries):
(receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
(receivedQuery, receivedResponse) = self.sendUDPQuery(query, response)
end = datetime.now()
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue((end - begin) > timedelta(0, 1));
(receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
end = datetime.now()
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue((end - begin) < timedelta(0, 1));
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
def testLuaSpoofAAAA(self):
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
def testLuaSpoofAWithCNAME(self):
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
def testLuaSpoofAAAAWithCNAME(self):
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
self.assertTrue(receivedResponse)
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedResponse, receivedResponse)
class TestAdvancedTruncateAnyAndTCP(DNSDistTest):
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(receivedResponse, response)
expectedResponse.flags |= dns.flags.TC
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
class TestAdvancedAndNot(DNSDistTest):
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(receivedResponse, response)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(receivedResponse, response)
expectedResponse.set_rcode(dns.rcode.NOTIMP)
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
response = dns.message.make_response(query)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(receivedResponse, response)
expectedResponse.set_rcode(dns.rcode.NOTIMP)
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
(receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(receivedResponse, response)
expectedResponse.set_rcode(dns.rcode.NOTIMP)
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
(receivedQuery, receivedResponse) = self.sendUDPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
(receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
expectedResponse.flags |= dns.flags.TC
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
response = dns.message.make_response(query)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(receivedResponse, response)
(receivedQuery, receivedResponse) = self.sendUDPQuery(query, response)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response.flags, receivedResponse.flags)
self.assertEquals(response.question, receivedResponse.question)
expectedResponse.set_rcode(dns.rcode.REFUSED)
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
def testDomainAndQTypeReturnsNotImplemented(self):
expectedResponse.set_rcode(dns.rcode.NOTIMP)
(_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
(_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
- receivedResponse.id = expectedResponse.id
self.assertEquals(receivedResponse, expectedResponse)
def testDomainWithoutQTypeIsNotAffected(self):
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = query.id
- receivedResponse.id = response.id
self.assertEquals(query, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = expectedResponse.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(expectedResponse, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)
self.assertTrue(receivedQuery)
self.assertTrue(receivedResponse)
receivedQuery.id = expectedQuery.id
- receivedResponse.id = response.id
self.assertEquals(expectedQuery, receivedQuery)
self.assertEquals(response, receivedResponse)