diff options
author | Eyal Bari <ebari@cisco.com> | 2017-09-27 21:43:51 +0300 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2017-10-02 01:30:12 +0000 |
commit | bd70c2f2e39b85939714aa025355eac973b2451f (patch) | |
tree | 9eb5595405e55fc744eb3fb4cf487ba6cf52c781 /test/test_l2_fib.py | |
parent | 1808f3c00a7bcdea7f0c004ef0613db2156c2065 (diff) |
L2-FIB:add mac learn events test
fixes an issue where events were not sent if BD doesn't enable mac aging
Change-Id: Iddc53cb5c45e560633e6c5cff2731dccfc70ad5b
Signed-off-by: Eyal Bari <ebari@cisco.com>
(cherry picked from commit 24db0ec78fb651c4c585ebf30e07108240574045)
Diffstat (limited to 'test/test_l2_fib.py')
-rw-r--r-- | test/test_l2_fib.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_l2_fib.py b/test/test_l2_fib.py index 9249a2ced23..52bf9c864ae 100644 --- a/test/test_l2_fib.py +++ b/test/test_l2_fib.py @@ -519,6 +519,24 @@ class TestL2fib(VppTestCase): self.run_verify_negat_test(bd_id=1, dst_hosts=flushed) self.run_verify_negat_test(bd_id=2, dst_hosts=flushed) + def test_l2_fib_09(self): + """ L2 FIB test 9 - mac learning events + """ + self.create_hosts(10, subnet=39) + + self.vapi.want_macs_learn_events() + 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) + self.assertEqual(len(learned_macs ^ macs), 0) + if __name__ == '__main__': unittest.main(testRunner=VppTestRunner) |