Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
VPP-1508: Python3 tests. Explicitly specify string formatting.
[vpp.git]
/
test
/
test_l2_fib.py
diff --git
a/test/test_l2_fib.py
b/test/test_l2_fib.py
index
436aa10
..
ac70c8a
100644
(file)
--- a/
test/test_l2_fib.py
+++ b/
test/test_l2_fib.py
@@
-69,6
+69,7
@@
from scapy.layers.inet import IP, UDP
from framework import VppTestCase, VppTestRunner
from util import Host, ppp
from framework import VppTestCase, VppTestRunner
from util import Host, ppp
+from vpp_papi import mac_pton
# from src/vnet/l2/l2_fib.h
MAC_EVENT_ACTION_ADD = 0
# from src/vnet/l2/l2_fib.h
MAC_EVENT_ACTION_ADD = 0
@@
-205,7
+206,7
@@
class TestL2fib(VppTestCase):
swif = pg_if.sw_if_index
for host in hosts[swif]:
self.vapi.l2fib_add_del(
swif = pg_if.sw_if_index
for host in hosts[swif]:
self.vapi.l2fib_add_del(
-
host.mac
, bd_id, swif, static_mac=1)
+
mac_pton(host.mac)
, bd_id, swif, static_mac=1)
def delete_l2_fib_entry(self, bd_id, hosts):
"""
def delete_l2_fib_entry(self, bd_id, hosts):
"""
@@
-218,7
+219,7
@@
class TestL2fib(VppTestCase):
swif = pg_if.sw_if_index
for host in hosts[swif]:
self.vapi.l2fib_add_del(
swif = pg_if.sw_if_index
for host in hosts[swif]:
self.vapi.l2fib_add_del(
-
host.mac
, bd_id, swif, is_add=0)
+
mac_pton(host.mac)
, bd_id, swif, is_add=0)
def flush_int(self, swif, learned_hosts):
"""
def flush_int(self, swif, learned_hosts):
"""
@@
-481,7
+482,7
@@
class TestL2fib(VppTestCase):
bd1 = 1
hosts = self.create_hosts(10, subnet=39)
bd1 = 1
hosts = self.create_hosts(10, subnet=39)
- self.vapi.want_
macs_learn
_events()
+ self.vapi.want_
l2_macs
_events()
self.learn_hosts(bd1, hosts)
self.sleep(1)
self.learn_hosts(bd1, hosts)
self.sleep(1)
@@
-492,7
+493,7
@@
class TestL2fib(VppTestCase):
if e.mac[i].action == MAC_EVENT_ACTION_ADD}
macs = {h.bin_mac for swif in self.bd_ifs(bd1)
for h in hosts[self.pg_interfaces[swif].sw_if_index]}
if e.mac[i].action == MAC_EVENT_ACTION_ADD}
macs = {h.bin_mac for swif in self.bd_ifs(bd1)
for h in hosts[self.pg_interfaces[swif].sw_if_index]}
- self.vapi.want_
macs_learn
_events(enable_disable=0)
+ self.vapi.want_
l2_macs
_events(enable_disable=0)
self.assertEqual(len(learned_macs ^ macs), 0)
def test_l2_fib_macs_learn_max(self):
self.assertEqual(len(learned_macs ^ macs), 0)
def test_l2_fib_macs_learn_max(self):
@@
-502,13
+503,13
@@
class TestL2fib(VppTestCase):
hosts = self.create_hosts(10, subnet=40)
ev_macs = 1
hosts = self.create_hosts(10, subnet=40)
ev_macs = 1
- self.vapi.want_
macs_learn
_events(max_macs_in_event=ev_macs)
+ self.vapi.want_
l2_macs
_events(max_macs_in_event=ev_macs)
self.learn_hosts(bd1, hosts)
self.sleep(1)
self.logger.info(self.vapi.ppcli("show l2fib"))
evs = self.vapi.collect_events()
self.learn_hosts(bd1, hosts)
self.sleep(1)
self.logger.info(self.vapi.ppcli("show l2fib"))
evs = self.vapi.collect_events()
- self.vapi.want_
macs_learn
_events(enable_disable=0)
+ self.vapi.want_
l2_macs
_events(enable_disable=0)
self.assertGreater(len(evs), 0)
learned_macs = {
self.assertGreater(len(evs), 0)
learned_macs = {