X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Futil.py;h=d6b77f9d3c3e90756b087f419cadab49e6b0ba07;hb=39f9d8bd226ab5aa366f181a5cbf7c873f599e06;hp=3a8bd838b0037a4e7dbe3858cf89825abce848b7;hpb=3e7b569361f97368b0cad3468fac76ef2a398bfa;p=vpp.git diff --git a/test/util.py b/test/util.py index 3a8bd838b00..d6b77f9d3c3 100644 --- a/test/util.py +++ b/test/util.py @@ -47,6 +47,11 @@ def ip4n_range(ip4n, s, e): for ip in ip4_range(ip4, s, e)) +def mactobinary(mac): + """ Convert the : separated format into binary packet data for the API """ + return mac.replace(':', '').decode('hex') + + class NumericConstant(object): __metaclass__ = ABCMeta