- def test_l2bd_learnlimit02(self):
- """ L2BD test with learn Limit
- """
- self.vapi.want_l2_macs_events(enable_disable=1, learn_limit=10)
- hosts = self.create_hosts(self.pg_interfaces[0], 20, 1)
- fhosts = self.create_hosts(self.pg_interfaces[1], 1, 2)
-
- # inject 20 mac addresses on bd1
- self.learn_hosts(self.pg_interfaces[0], 1, hosts)
-
- # inject 1 mac address on bd2
- self.learn_hosts(self.pg_interfaces[1], 2, fhosts)
-
- lfs1 = self.vapi.l2_fib_table_dump(1)
- lfs2 = self.vapi.l2_fib_table_dump(2)
-
- # check that only 10 macs are learned.
- self.assertEqual(len(lfs1), 10)
-
- # check that bd2 was not able to learn
- self.assertEqual(len(lfs2), 0)
-