X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_l2bd_arp_term.py;h=ddba79b79f073639d09d6d9873a331570a0bd988;hb=7f99183a20d60cd5c648cc23d7a2f30a594a215b;hp=23742b17f859f3295f14a139f9c29b3e7d2ad648;hpb=4d5b917b1a74461abaa30182d4bf5c7761572323;p=vpp.git diff --git a/test/test_l2bd_arp_term.py b/test/test_l2bd_arp_term.py index 23742b17f85..ddba79b79f0 100644 --- a/test/test_l2bd_arp_term.py +++ b/test/test_l2bd_arp_term.py @@ -19,8 +19,8 @@ from scapy.layers.inet6 import IPv6, UDP, ICMPv6ND_NS, ICMPv6ND_RS, \ ICMPv6ND_NA, ICMPv6NDOptDstLLAddr, ICMPv6DestUnreach, icmp6types from framework import VppTestCase, VppTestRunner -from util import Host, ppp, mactobinary -from vpp_mac import VppMacAddress +from util import Host, ppp +from vpp_mac import VppMacAddress, mactobinary from vpp_ip import VppIpAddress @@ -156,12 +156,13 @@ class TestL2bdArpTerm(VppTestCase): def arp_resp_hosts(self, src_host, pkts): return {self.arp_resp_host(src_host, p) for p in pkts} - def inttoip4(self, ip): + @staticmethod + def inttoip4(ip): o1 = int(ip / 16777216) % 256 o2 = int(ip / 65536) % 256 o3 = int(ip / 256) % 256 o4 = int(ip) % 256 - return '%(o1)s.%(o2)s.%(o3)s.%(o4)s' % locals() + return '%s.%s.%s.%s' % (o1, o2, o3, o4) def arp_event_host(self, e): return Host(mac=':'.join(['%02x' % ord(char) for char in e.new_mac]),