summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-17 20:48:27 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-17 21:04:08 +0100
commitbcd124eb8db82c0a857d5351a1b6fccf615d05dc (patch)
treefb9327846f0751c3b4156032e8c81d9429525bdb /scripts
parent7311b15f601a7aedae96f545f752b208153bb73f (diff)
downloadvyos-1x-bcd124eb8db82c0a857d5351a1b6fccf615d05dc.tar.gz
vyos-1x-bcd124eb8db82c0a857d5351a1b6fccf615d05dc.zip
bridge: automatically detect available interfaces
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cli/test_interfaces_bridge.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/cli/test_interfaces_bridge.py b/scripts/cli/test_interfaces_bridge.py
index 1d462645e..28ba218a6 100755
--- a/scripts/cli/test_interfaces_bridge.py
+++ b/scripts/cli/test_interfaces_bridge.py
@@ -26,19 +26,27 @@ class BridgeInterfaceTest(BasicInterfaceTest.BaseTest):
self._interfaces = ['br0']
def test_add_remove_member(self):
- members = list_interfaces_of_type("ethernet")
+ members = []
+ # we need to filter out VLAN interfaces identified by a dot (.)
+ # in their name - just in case!
+ for tmp in list_interfaces_of_type("ethernet"):
+ if not '.' in tmp:
+ members.append(tmp)
for intf in self._interfaces:
cost = 1000
priority = 10
self.session.set(self._base_path + [intf, 'stp'])
+
+ # assign members to bridge interface
for member in members:
self.session.set(self._base_path + [intf, 'member', 'interface', member])
self.session.set(self._base_path + [intf, 'member', 'interface', member, 'cost', str(cost)])
self.session.set(self._base_path + [intf, 'member', 'interface', member, 'priority', str(priority)])
cost += 1
priority += 1
+
self.session.commit()
for intf in self._interfaces: