self.assertTrue(msg.question.HasField('qName'))
self.assertEquals(msg.question.qName, qname)
- def checkProtobufIncomingResponse(self, msg, protocol, response, initiator='127.0.0.1'):
+ def checkProtobufIncomingResponse(self, msg, protocol, response, initiator='127.0.0.1', length=None):
self.assertEquals(msg.type, dnsmessage_pb2.PBDNSMessage.DNSIncomingResponseType)
- self.checkOutgoingProtobufBase(msg, protocol, response, initiator)
+ self.checkOutgoingProtobufBase(msg, protocol, response, initiator, length=length)
self.assertTrue(msg.HasField('response'))
+ self.assertTrue(msg.response.HasField('rcode'))
self.assertTrue(msg.response.HasField('queryTimeSec'))
+ def checkProtobufIncomingNetworkErrorResponse(self, msg, protocol, response, initiator='127.0.0.1'):
+ self.checkProtobufIncomingResponse(msg, protocol, response, initiator, length=0)
+ self.assertEquals(msg.response.rcode, 65536)
+
+ def checkProtobufIdentity(self, msg, requestorId, deviceId, deviceName):
+ self.assertTrue(msg.HasField('requestorId'))
+ self.assertTrue(msg.HasField('deviceId'))
+ self.assertTrue(msg.HasField('deviceName'))
+ self.assertEquals(msg.requestorId, requestorId)
+ self.assertEquals(msg.deviceId, deviceId)
+ self.assertEquals(msg.deviceName, deviceName)
+
@classmethod
def setUpClass(cls):