diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-16 08:42:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-16 08:42:41 +0100 |
commit | 3315af9ab8b570ada24a3f68ab0a18f84274186b (patch) | |
tree | 8fe8d4459c88c2403803fbde983575d4bea696be /smoketest/scripts/cli/test_interfaces_bridge.py | |
parent | 56ec3259b67c6441d992948a8bae95039194eb6c (diff) | |
parent | 2d1e8a2fdba707aaae46b9f136aa8dd171ff8f3d (diff) | |
download | vyos-1x-3315af9ab8b570ada24a3f68ab0a18f84274186b.tar.gz vyos-1x-3315af9ab8b570ada24a3f68ab0a18f84274186b.zip |
Merge pull request #677 from jack9603301/T3137
bridge: T3137: Let VLAN aware bridge approach the behavior of professional equipment
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_bridge.py')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bridge.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bridge.py b/smoketest/scripts/cli/test_interfaces_bridge.py index 464226b6f..3367cca5c 100755 --- a/smoketest/scripts/cli/test_interfaces_bridge.py +++ b/smoketest/scripts/cli/test_interfaces_bridge.py @@ -25,6 +25,7 @@ from netifaces import interfaces from vyos.ifconfig import Section from vyos.util import cmd from vyos.util import read_file +from vyos.validate import is_intf_addr_assigned class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): def setUp(self): @@ -32,7 +33,6 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): self._test_ipv6 = True self._test_ipv6_pd = True self._test_vlan = True - self._test_qinq = True self._base_path = ['interfaces', 'bridge'] self._mirror_interfaces = ['dum21354'] self._members = [] @@ -52,6 +52,12 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): self._interfaces = list(self._options) super().setUp() + + def tearDown(self): + for intf in self._interfaces: + self.session.delete(self._base_path + [intf]) + + super().tearDown() def test_add_remove_bridge_member(self): # Add member interfaces to bridge and set STP cost/priority @@ -86,13 +92,23 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): self.session.delete(self._base_path + [interface, 'member']) self.session.commit() + + def test_8021q_vlan_interfaces(self): + for interface in self._interfaces: + base = self._base_path + [interface] + self.session.set(base + ['enable-vlan']) + super().test_8021q_vlan_interfaces() def test_bridge_vlan_filter(self): + + vif_vlan = 2 # Add member interface to bridge and set VLAN filter for interface in self._interfaces: base = self._base_path + [interface] - self.session.set(base + ['vif', '1', 'address', '192.0.2.1/24']) - self.session.set(base + ['vif', '2', 'address', '192.0.3.1/24']) + self.session.set(base + ['enable-vlan']) + self.session.set(base + ['address', '192.0.2.1/24']) + self.session.set(base + ['vif', str(vif_vlan), 'address', '192.0.3.1/24']) + self.session.set(base + ['vif', str(vif_vlan), 'mtu', self._mtu]) vlan_id = 101 allowed_vlan = 2 @@ -159,7 +175,7 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): for member in self._members: self.assertIn(member, bridge_members) - + # delete all members for interface in self._interfaces: self.session.delete(self._base_path + [interface, 'member']) |