def test_ipv6_mpls_vpn_construct_nexthop(self): nexthop = {'rd': '0:0', 'str': '::ffff:172.16.4.12'} nexthop_bin = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' \ b'\x00\x00\x00\x00\x00\x00\xff\xff\xac\x10\x04\x0c' self.assertEqual(nexthop_bin, MpReachNLRI.construct_mpls_vpn_nexthop(nexthop))
def test_ipv4_mpsl_vpn_construct_nexthop(self): nexthop = {'rd': '0:0', 'str': '2.2.2.2'} nexthop_bin = b'\x00\x00\x00\x00\x00\x00\x00\x00\x02\x02\x02\x02' self.assertEqual(nexthop_bin, MpReachNLRI.construct_mpls_vpn_nexthop(nexthop))