Пример #1
0
    def test_l2vpn_encode(self):
        '''
		we are encoding routes and testing em against what we have recvd from
		Juniper
		'''
        encoded_l2vpn = VPLS(None, None, None, None, None)
        encoded_l2vpn = self.decoded_l2vpn_nlri1
        self.assertEqual(encoded_l2vpn.pack().encode('hex'),
                         str(self.encoded_l2vpn_nlri1).encode('hex'))
        encoded_l2vpn.nlri = self.decoded_l2vpn_nlri2
        encoded_l2vpn.rd = self.decoded_l2vpn_nlri2.rd
        self.assertEqual(encoded_l2vpn.pack().encode('hex'),
                         str(self.encoded_l2vpn_nlri2).encode('hex'))
Пример #2
0
	def test_l2vpn_encode (self):
		'''
		we are encoding routes and testing em against what we have recvd from
		Juniper
		'''
		encoded_l2vpn = VPLS(None,None,None,None,None)
		encoded_l2vpn = self.decoded_l2vpn_nlri1
		self.assertEqual(
			encoded_l2vpn.pack().encode('hex'),
			str(self.encoded_l2vpn_nlri1).encode('hex')
		)
		encoded_l2vpn.nlri = self.decoded_l2vpn_nlri2
		encoded_l2vpn.rd = self.decoded_l2vpn_nlri2.rd
		self.assertEqual(
			encoded_l2vpn.pack().encode('hex'),
			str(self.encoded_l2vpn_nlri2).encode('hex')
		)