X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_ip_route.py;h=17a42fec706d2de9c0b24c6b38a6f44815504c4e;hb=e821ab100aea2fb3f740a98650eb750ff5911c49;hp=ca0ae1ad47ddf8fb503a8bba71d2f0277f38c247;hpb=31ed74407643595fdce206e9d7487108fb8b33ab;p=vpp.git diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py index ca0ae1ad47d..17a42fec706 100644 --- a/test/vpp_ip_route.py +++ b/test/vpp_ip_route.py @@ -168,16 +168,31 @@ class VppRoutePath(object): 'ttl': 255}) return lstack + def encode(self): + return {'next_hop': self.nh_addr, + 'weight': 1, + 'afi': 0, + 'preference': 0, + 'table_id': self.nh_table_id, + 'next_hop_id': self.next_hop_id, + 'sw_if_index': self.nh_itf, + 'afi': self.proto, + 'is_udp_encap': self.is_udp_encap, + 'n_labels': len(self.nh_labels), + 'label_stack': self.encode_labels()} + class VppMRoutePath(VppRoutePath): def __init__(self, nh_sw_if_index, flags, + nh=None, proto=DpoProto.DPO_PROTO_IP4, bier_imp=0): - super(VppMRoutePath, self).__init__( - "::" if proto is DpoProto.DPO_PROTO_IP6 else "0.0.0.0", - nh_sw_if_index, - proto=proto) + if not nh: + nh = "::" if proto is DpoProto.DPO_PROTO_IP6 else "0.0.0.0" + super(VppMRoutePath, self).__init__(nh, + nh_sw_if_index, + proto=proto) self.nh_i_flags = flags self.bier_imp = bier_imp @@ -324,6 +339,7 @@ class VppIpMRoute(VppObject): self.e_flags, path.proto, path.nh_itf, + path.nh_addr, path.nh_i_flags, bier_imp=path.bier_imp, rpf_id=self.rpf_id, @@ -339,6 +355,7 @@ class VppIpMRoute(VppObject): self.e_flags, path.proto, path.nh_itf, + path.nh_addr, path.nh_i_flags, table_id=self.table_id, bier_imp=path.bier_imp, @@ -353,6 +370,7 @@ class VppIpMRoute(VppObject): self.e_flags, 0, 0xffffffff, + "", 0, table_id=self.table_id, is_ipv6=self.is_ip6) @@ -365,6 +383,7 @@ class VppIpMRoute(VppObject): self.e_flags, 0, 0xffffffff, + "", 0, rpf_id=self.rpf_id, table_id=self.table_id, @@ -381,6 +400,7 @@ class VppIpMRoute(VppObject): self.e_flags, path.proto, path.nh_itf, + path.nh_addr, path.nh_i_flags, table_id=self.table_id, is_ipv6=self.is_ip6)