diff options
Diffstat (limited to 'test/test_l2_flood.py')
-rw-r--r-- | test/test_l2_flood.py | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/test/test_l2_flood.py b/test/test_l2_flood.py index 9f3ef533091..7fe5214dcde 100644 --- a/test/test_l2_flood.py +++ b/test/test_l2_flood.py @@ -47,19 +47,23 @@ class TestL2Flood(VppTestCase): # # Create a single bridge Domain # - self.vapi.bridge_domain_add_del(1) + self.vapi.bridge_domain_add_del(bd_id=1) # # add each interface to the BD. 3 interfaces per split horizon group # for i in self.pg_interfaces[0:4]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 0) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=0) for i in self.pg_interfaces[4:8]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 1) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=1) for i in self.pg_interfaces[8:12]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 2) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=2) for i in self.lo_interfaces: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 2, + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=2, port_type=L2_PORT_TYPE.BVI) p = (Ether(dst="ff:ff:ff:ff:ff:ff", @@ -136,13 +140,15 @@ class TestL2Flood(VppTestCase): # cleanup # for i in self.pg_interfaces[:12]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, enable=0) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, enable=0) for i in self.lo_interfaces: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 2, + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=2, port_type=L2_PORT_TYPE.BVI, enable=0) - self.vapi.bridge_domain_add_del(1, is_add=0) + self.vapi.bridge_domain_add_del(bd_id=1, is_add=0) def test_flood_one(self): """ L2 no-Flood Test """ @@ -150,14 +156,15 @@ class TestL2Flood(VppTestCase): # # Create a single bridge Domain # - self.vapi.bridge_domain_add_del(1) + self.vapi.bridge_domain_add_del(bd_id=1) # # add 2 interfaces to the BD. this means a flood goes to only # one member # for i in self.pg_interfaces[:2]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 0) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=0) p = (Ether(dst="ff:ff:ff:ff:ff:ff", src="00:00:de:ad:be:ef") / @@ -174,8 +181,9 @@ class TestL2Flood(VppTestCase): # cleanup # for i in self.pg_interfaces[:2]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, enable=0) - self.vapi.bridge_domain_add_del(1, is_add=0) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, enable=0) + self.vapi.bridge_domain_add_del(bd_id=1, is_add=0) def test_uu_fwd(self): """ UU Flood """ @@ -183,13 +191,14 @@ class TestL2Flood(VppTestCase): # # Create a single bridge Domain # - self.vapi.bridge_domain_add_del(1, uu_flood=1) + self.vapi.bridge_domain_add_del(bd_id=1, uu_flood=1) # # add each interface to the BD. 3 interfaces per split horizon group # for i in self.pg_interfaces[0:4]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, 0) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, shg=0) # # an unknown unicast and braodcast packets @@ -225,8 +234,9 @@ class TestL2Flood(VppTestCase): # # use pg8 as the uu-fwd interface # - self.vapi.sw_interface_set_l2_bridge(self.pg8.sw_if_index, 1, 0, - port_type=L2_PORT_TYPE.UU_FWD) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=self.pg8.sw_if_index, bd_id=1, shg=0, + port_type=L2_PORT_TYPE.UU_FWD) # # expect the UU packet on the uu-fwd interface and not be flooded @@ -250,9 +260,9 @@ class TestL2Flood(VppTestCase): # # remove the uu-fwd interface and expect UU to be flooded again # - self.vapi.sw_interface_set_l2_bridge(self.pg8.sw_if_index, 1, 0, - port_type=L2_PORT_TYPE.UU_FWD, - enable=0) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=self.pg8.sw_if_index, bd_id=1, shg=0, + port_type=L2_PORT_TYPE.UU_FWD, enable=0) self.pg0.add_stream(p_uu*65) self.pg_enable_capture(self.pg_interfaces) @@ -264,15 +274,16 @@ class TestL2Flood(VppTestCase): # # change the BD config to not support UU-flood # - self.vapi.bridge_flags(1, 0, BRIDGE_FLAGS.UU_FLOOD) + self.vapi.bridge_flags(bd_id=1, is_set=0, flags=BRIDGE_FLAGS.UU_FLOOD) self.send_and_assert_no_replies(self.pg0, p_uu) # # re-add the uu-fwd interface # - self.vapi.sw_interface_set_l2_bridge(self.pg8.sw_if_index, 1, 0, - port_type=L2_PORT_TYPE.UU_FWD) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=self.pg8.sw_if_index, bd_id=1, shg=0, + port_type=L2_PORT_TYPE.UU_FWD) self.logger.info(self.vapi.cli("sh bridge 1 detail")) self.pg0.add_stream(p_uu*65) @@ -287,18 +298,19 @@ class TestL2Flood(VppTestCase): # # remove the uu-fwd interface # - self.vapi.sw_interface_set_l2_bridge(self.pg8.sw_if_index, 1, 0, - port_type=L2_PORT_TYPE.UU_FWD, - enable=0) + self.vapi.sw_interface_set_l2_bridge( + rx_sw_if_index=self.pg8.sw_if_index, bd_id=1, shg=0, + port_type=L2_PORT_TYPE.UU_FWD, enable=0) self.send_and_assert_no_replies(self.pg0, p_uu) # # cleanup # for i in self.pg_interfaces[:4]: - self.vapi.sw_interface_set_l2_bridge(i.sw_if_index, 1, enable=0) + self.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=i.sw_if_index, + bd_id=1, enable=0) - self.vapi.bridge_domain_add_del(1, is_add=0) + self.vapi.bridge_domain_add_del(bd_id=1, is_add=0) if __name__ == '__main__': |