From bcd124eb8db82c0a857d5351a1b6fccf615d05dc Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 17 Feb 2020 20:48:27 +0100 Subject: bridge: automatically detect available interfaces --- scripts/cli/test_interfaces_bridge.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/cli') 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: -- cgit v1.2.3