diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-07-31 15:27:06 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-07-31 15:27:06 +0200 |
commit | eb0c2efe324da5ff2287000a28b7270b8782f217 (patch) | |
tree | 1ce4c1a1f53fb33a92c922fb79835b1ad69092eb /scripts/cli/test_interfaces_bridge.py | |
parent | fa3e3915254df7d4bcb3c8964113954669413d12 (diff) | |
download | vyos-1x-eb0c2efe324da5ff2287000a28b7270b8782f217.tar.gz vyos-1x-eb0c2efe324da5ff2287000a28b7270b8782f217.zip |
ipv6: link-local: test address assignment on interfaces
Diffstat (limited to 'scripts/cli/test_interfaces_bridge.py')
-rwxr-xr-x | scripts/cli/test_interfaces_bridge.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/scripts/cli/test_interfaces_bridge.py b/scripts/cli/test_interfaces_bridge.py index 4402cad68..bc0bb69c6 100755 --- a/scripts/cli/test_interfaces_bridge.py +++ b/scripts/cli/test_interfaces_bridge.py @@ -24,27 +24,35 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): def setUp(self): super().setUp() + self._test_ipv6 = True + self._base_path = ['interfaces', 'bridge'] self._interfaces = ['br0'] - def test_add_remove_member(self): - members = [] + self._members = [] # we need to filter out VLAN interfaces identified by a dot (.) # in their name - just in case! if 'TEST_ETH' in os.environ: - members = os.environ['TEST_ETH'].split() + self._members = os.environ['TEST_ETH'].split() else: for tmp in Section.interfaces("ethernet"): - if not '.' in tmp: members.append(tmp) + if not '.' in tmp: + self._members.append(tmp) - for intf in self._interfaces: - base = self._base_path + [intf] + self._options['br0'] = [] + for member in self._members: + self._options['br0'].append(f'member interface {member}') + + def test_add_remove_member(self): + for interface in self._interfaces: + base = self._base_path + [interface] self.session.set(base + ['stp']) + self.session.set(base + ['address', '192.0.2.1/24']) cost = 1000 priority = 10 # assign members to bridge interface - for member in members: + for member in self._members: base_member = base + ['member', 'interface', member] self.session.set(base_member + ['cost', str(cost)]) self.session.set(base_member + ['priority', str(priority)]) @@ -53,8 +61,8 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest): self.session.commit() - for intf in self._interfaces: - self.session.delete(self._base_path + [intf, 'member']) + for interface in self._interfaces: + self.session.delete(self._base_path + [interface, 'member']) self.session.commit() |