summaryrefslogtreecommitdiffstats
path: root/test/vpp_ip_route.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-06-07 23:48:20 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-07-09 21:10:53 +0000
commit947ea6222dad1ef04595c34273e9231395aef443 (patch)
tree8990854b2901ff8cc2241b9abfc99b0b4b54d517 /test/vpp_ip_route.py
parentdd47ecadcf63772a6037a1bb3715772d80e87f51 (diff)
IGMP improvements
- Enable/Disable an interface for IGMP - improve logging - refactor common code - no orphaned timers - IGMP state changes in main thread only - Large groups split over multiple state-change reports - SSM range configuration API. - more tests Change-Id: If5674f1044e7e97274a711f47807c9ba689d7b9a Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/vpp_ip_route.py')
-rw-r--r--test/vpp_ip_route.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py
index 17a42fec706..9e5c53184e3 100644
--- a/test/vpp_ip_route.py
+++ b/test/vpp_ip_route.py
@@ -60,6 +60,25 @@ def find_route(test, ip_addr, len, table_id=0, inet=AF_INET):
return False
+def find_mroute(test, grp_addr, src_addr, grp_addr_len,
+ table_id=0, inet=AF_INET):
+ if inet == AF_INET:
+ s = 4
+ routes = test.vapi.ip_mfib_dump()
+ else:
+ s = 16
+ routes = test.vapi.ip6_mfib_dump()
+ gaddr = inet_pton(inet, grp_addr)
+ saddr = inet_pton(inet, src_addr)
+ for e in routes:
+ if gaddr == e.grp_address[:s] \
+ and grp_addr_len == e.address_length \
+ and saddr == e.src_address[:s] \
+ and table_id == e.table_id:
+ return True
+ return False
+
+
class VppIpTable(VppObject):
def __init__(self,
@@ -324,6 +343,8 @@ class VppIpMRoute(VppObject):
self.is_ip6 = is_ip6
self.rpf_id = rpf_id
+ self.grp_addr_p = grp_addr
+ self.src_addr_p = src_addr
if is_ip6:
self.grp_addr = inet_pton(AF_INET6, grp_addr)
self.src_addr = inet_pton(AF_INET6, src_addr)
@@ -406,17 +427,12 @@ class VppIpMRoute(VppObject):
is_ipv6=self.is_ip6)
def query_vpp_config(self):
- if self.is_ip6:
- dump = self._test.vapi.ip6_mfib_dump()
- else:
- dump = self._test.vapi.ip_mfib_dump()
- for e in dump:
- if self.grp_addr == e.grp_address \
- and self.grp_addr_len == e.address_length \
- and self.src_addr == e.src_address \
- and self.table_id == e.table_id:
- return True
- return False
+ return find_mroute(self._test,
+ self.grp_addr_p,
+ self.src_addr_p,
+ self.grp_addr_len,
+ self.table_id,
+ inet=AF_INET6 if self.is_ip6 == 1 else AF_INET)
def __str__(self):
return self.object_id()