Exemplo n.º 1
0
	def testSameName(self):
		name = "paired.local."
		generated = r.DNSOutgoing(r._FLAGS_QR_RESPONSE)
		question = r.DNSQuestion(name, r._TYPE_SRV, r._CLASS_IN)
		generated.addQuestion(question)
		generated.addQuestion(question)
		parsed = r.DNSIncoming(generated.packet())
Exemplo n.º 2
0
	def testMatchQuestion(self):
		generated = r.DNSOutgoing(r._FLAGS_QR_QUERY)
		question = r.DNSQuestion("testname.local.", r._TYPE_SRV, r._CLASS_IN)
		generated.addQuestion(question)
		parsed = r.DNSIncoming(generated.packet())
		self.assertEqual(len(generated.questions), 1)
		self.assertEqual(len(generated.questions), len(parsed.questions))
		self.assertEqual(question, parsed.questions[0])
Exemplo n.º 3
0
	def testParseOwnPacketQuestion(self):
		generated = r.DNSOutgoing(r._FLAGS_QR_QUERY)
		generated.addQuestion(r.DNSQuestion("testname.local.", r._TYPE_SRV, r._CLASS_IN))
		parsed = r.DNSIncoming(generated.packet())
Exemplo n.º 4
0
	def testParseOwnPacketFlags(self):
		generated = r.DNSOutgoing(r._FLAGS_QR_QUERY)
		parsed = r.DNSIncoming(generated.packet())
Exemplo n.º 5
0
	def testParseOwnPacketSimpleUnicast(self):
		generated = r.DNSOutgoing(0, 0)
		parsed = r.DNSIncoming(generated.packet())
Exemplo n.º 6
0
	def testExceedinglyLongName(self):
		generated = r.DNSOutgoing(r._FLAGS_QR_RESPONSE)
		name = "%slocal." % ("part." * 1000)
		question = r.DNSQuestion(name, r._TYPE_SRV, r._CLASS_IN)
		generated.addQuestion(question)
		parsed = r.DNSIncoming(generated.packet())
Exemplo n.º 7
0
	def testLongName(self):
		generated = r.DNSOutgoing(r._FLAGS_QR_RESPONSE)
		question = r.DNSQuestion("this.is.a.very.long.name.with.lots.of.parts.in.it.local.", r._TYPE_SRV, r._CLASS_IN)
		generated.addQuestion(question)
		parsed = r.DNSIncoming(generated.packet())