summaryrefslogtreecommitdiffstats
path: root/test/vpp_igmp.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-12-11 13:04:01 +0100
committerDamjan Marion <dmarion@me.com>2018-12-12 00:34:43 +0000
commit0bcad32b3870f9998fa1393418081cdda685272f (patch)
tree0fcb518ffa5553bbec94c219cbc33fef48dbede3 /test/vpp_igmp.py
parent41b25cf6380d1420b24e191cd7e95cbce1e7cfdc (diff)
PAPI: Allow ipaddress object as argument and return values from API calls
The API calls that use any of vl_api_address_t, vl_api_ip4_address, vl_api_ip6_address_t, vl_api_prefix_t, vl_api_ip4_prefix_t, vl_api_ip6_prefix_t now accepts either the old style dictionary, a text string (2001:db8::/32) or an ipaddress ojbect. Unless it is called with '_no_type_conversion':True, it will also return an appropriate ipaddress object. Change-Id: I84e4a1577bd57f6b5ae725f316a523988b6a955b Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'test/vpp_igmp.py')
-rw-r--r--test/vpp_igmp.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/vpp_igmp.py b/test/vpp_igmp.py
index c4cbab13a0c..2403fbfd6ca 100644
--- a/test/vpp_igmp.py
+++ b/test/vpp_igmp.py
@@ -16,8 +16,7 @@ class IGMP_FILTER:
def find_igmp_state(states, itf, gaddr, saddr):
for s in states:
if s.sw_if_index == itf.sw_if_index and \
- s.gaddr == socket.inet_pton(socket.AF_INET, gaddr) and \
- s.saddr == socket.inet_pton(socket.AF_INET, saddr):
+ str(s.gaddr) == gaddr and str(s.saddr) == saddr:
return True
return False
@@ -25,8 +24,7 @@ def find_igmp_state(states, itf, gaddr, saddr):
def wait_for_igmp_event(test, timeout, itf, gaddr, saddr, ff):
ev = test.vapi.wait_for_event(timeout, "igmp_event")
if ev.sw_if_index == itf.sw_if_index and \
- ev.gaddr == socket.inet_pton(socket.AF_INET, gaddr) and \
- ev.saddr == socket.inet_pton(socket.AF_INET, saddr) and \
+ str(ev.gaddr) == gaddr and str(ev.saddr) == saddr and \
ev.filter == ff:
return True
return False