diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2020-04-28 00:27:38 -0400 |
---|---|---|
committer | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2020-04-28 15:43:28 +0000 |
commit | e64e5fff4ddea88f386657c5d95ae8dc78138d20 (patch) | |
tree | a4b91682810f8d64dfe2ae0934c21d1f67b94f9d /src/vpp-api/python/vpp_papi/vpp_format.py | |
parent | 58db6e16cf4f3bb1740ca2f62d7d887baad58d63 (diff) |
tests: implement ipaddress convenience methods
Add vpp specific properties to ip addresses for use in the api.
.vapi_af -- returns [ADDRESS_IP4, ADDRESS_IP6]
.vapi_af_name -- returns the string ['ip4', 'ip6']
Update tests to demonstrate usage.
Type: feature
Change-Id: I43447a1522769d99f89debdc714c51700068d771
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_format.py')
-rw-r--r-- | src/vpp-api/python/vpp_papi/vpp_format.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_format.py b/src/vpp-api/python/vpp_papi/vpp_format.py index 3e836c9da6b..4c26463bbb5 100644 --- a/src/vpp-api/python/vpp_papi/vpp_format.py +++ b/src/vpp-api/python/vpp_papi/vpp_format.py @@ -27,6 +27,11 @@ except NameError: ADDRESS_IP4 = 0 ADDRESS_IP6 = 1 + +def verify_enum_hint(e): + return (e.ADDRESS_IP4.value == ADDRESS_IP4) and\ + (e.ADDRESS_IP6.value == ADDRESS_IP6) + # # Type conversion for input arguments and return values # |