summaryrefslogtreecommitdiffstats
path: root/test/vpp_ip_route.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-06-03 13:21:40 +0000
committerNeale Ranns <nranns@cisco.com>2019-06-06 12:12:58 +0000
commit922077505b43f9560550653f530cf93acc81044d (patch)
tree99bbd28d90de7b1b4db986a5586c04143a8f0c61 /test/vpp_ip_route.py
parent831f4200cab2b363f2a8ea340331343c14407b7d (diff)
IP-Punt-redirect: allow the use of a FIB path to describe how to
redirect Change-Id: I2a3ba2a3d73ea8511e3a511855b041432328f0a8 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/vpp_ip_route.py')
-rw-r--r--test/vpp_ip_route.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py
index 0bd6dd33735..db5f4b636bf 100644
--- a/test/vpp_ip_route.py
+++ b/test/vpp_ip_route.py
@@ -287,7 +287,7 @@ class VppRoutePath(object):
self.next_hop_id = next_hop_id
self.is_dvr = is_dvr
- def encode_labels(self):
+ def encode_labels(self, pad_labels=False):
lstack = []
for l in self.nh_labels:
if type(l) == VppMplsLabel:
@@ -295,9 +295,12 @@ class VppRoutePath(object):
else:
lstack.append({'label': l,
'ttl': 255})
+ if (pad_labels):
+ while (len(lstack) < 16):
+ lstack.append({})
return lstack
- def encode(self):
+ def encode(self, pad_labels=False):
return {'next_hop': self.nh_addr,
'weight': 1,
'preference': 0,
@@ -307,7 +310,7 @@ class VppRoutePath(object):
'afi': self.proto,
'is_udp_encap': self.is_udp_encap,
'n_labels': len(self.nh_labels),
- 'label_stack': self.encode_labels()}
+ 'label_stack': self.encode_labels(pad_labels)}
def __eq__(self, other):
if isinstance(other, self.__class__):