aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-06-18 07:57:53 -0400
committerNeale Ranns <nranns@cisco.com>2019-06-26 11:36:04 +0000
commit941da4a224bbfc153bfe7c2344ae00e294d92798 (patch)
treebb2a4203843da9fd66c493f8e6f3bda00db4ad8b
parenta608afeec3478c1cdf3f640376d97277b5d06a84 (diff)
tests: set object_id for routes.
Object id's are used as keys in the object repository. They need to be unique. Also useful for debugging in log.txt. Type: test Change-Id: I69b5f3a7508918a5780ff8f20d27d4a3c34a5699 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--test/vpp_ip_route.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py
index 5175de7dd0f..031415e9ee0 100644
--- a/test/vpp_ip_route.py
+++ b/test/vpp_ip_route.py
@@ -149,6 +149,7 @@ def fib_interface_ip_prefix(test, address, length, sw_if_index):
prefix = IPv6Network("%s/%d" % (text_type(address), length),
strict=False)
+ # TODO: refactor this to VppIpPrefix.__eq__
for a in addrs:
if a.sw_if_index == sw_if_index and \
a.prefix == prefix:
@@ -426,6 +427,7 @@ class VppIpRoute(VppObject):
self.table_id = table_id
self.prefix = VppIpPrefix(dest_addr, dest_addr_len)
self.register = register
+ self.stats_index = None
self.encoded_paths = []
for path in self.paths:
@@ -482,10 +484,11 @@ class VppIpRoute(VppObject):
self.table_id)
def object_id(self):
- return ("%d:%s/%d"
- % (self.table_id,
- self.prefix.address,
- self.prefix.len))
+ return ("%s:table-%d-%s/%d" % (
+ 'ip6-route' if self.prefix.addr.version == 6 else 'ip-route',
+ self.table_id,
+ self.prefix.address,
+ self.prefix.len))
def get_stats_to(self):
c = self._test.statistics.get_counter("/net/route/to")
@@ -721,7 +724,7 @@ class VppMplsRoute(VppObject):
self.local_label, self.eos_bit)
def object_id(self):
- return ("%d:%s/%d"
+ return ("mpls-route-%d:%s/%d"
% (self.table_id,
self.local_label,
20 + self.eos_bit))