diff options
author | eyal bari <royalbee@gmail.com> | 2017-10-03 12:25:07 +0300 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2017-10-03 17:17:16 +0000 |
commit | c6038c91ad0d12945877cdcd451ce27da06a40e9 (patch) | |
tree | a4412c5b1052e700d93bf53ff587ff3ccd74747e /test | |
parent | a096f2d182537cb292241af4cc842d21e5369617 (diff) |
L2FIB,TEST:add max macs in event test
Change-Id: Ied72d44f8695af524751ffc54196cc3ac1addc85
Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/test_l2_fib.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_l2_fib.py b/test/test_l2_fib.py index 52bf9c864ae..7476af41000 100644 --- a/test/test_l2_fib.py +++ b/test/test_l2_fib.py @@ -537,6 +537,28 @@ class TestL2fib(VppTestCase): self.vapi.want_macs_learn_events(enable_disable=0) self.assertEqual(len(learned_macs ^ macs), 0) + def test_l2_fib_10(self): + """ L2 FIB test 10 - mac learning max macs in event + """ + flushed = self.flush_all() + self.create_hosts(10, subnet=40) + + ev_macs = 1 + self.vapi.want_macs_learn_events(max_macs_in_event=ev_macs) + self.learn_hosts(bd_id=1, n_hosts_per_if=10) + + self.sleep(1) + self.logger.info(self.vapi.ppcli("show l2fib")) + evs = self.vapi.collect_events() + learned_macs = { + e.mac[i].mac_addr for e in evs for i in range(e.n_macs)} + macs = {h.bin_mac for swif_hs in self.learned_hosts.itervalues() + for h in swif_hs} + self.vapi.want_macs_learn_events(enable_disable=0) + for e in evs: + self.assertLess(len(e), ev_macs * 10) + self.assertEqual(len(learned_macs ^ macs), 0) + if __name__ == '__main__': unittest.main(testRunner=VppTestRunner) |