summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-10 22:28:12 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-11 08:17:33 +0200
commitd88912616a7d1fe221069773a1102e17880739ed (patch)
tree0fd40af4caa3f4de3e429a84b2db68ee9701a482
parent3907233b51e721ea894f383b51e42118a2012d78 (diff)
downloadvyos-1x-d88912616a7d1fe221069773a1102e17880739ed.tar.gz
vyos-1x-d88912616a7d1fe221069773a1102e17880739ed.zip
smoketest: bond: add testcase for conflicting bridge member
A bond member can not also be used as a member of a bridge interface. (cherry picked from commit 19bfed0abd75adacb61f170606fff8b4d2e7713f)
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_bonding.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py
index a6e5ea59c..af70c004b 100755
--- a/smoketest/scripts/cli/test_interfaces_bonding.py
+++ b/smoketest/scripts/cli/test_interfaces_bonding.py
@@ -185,6 +185,26 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase):
slaves = read_file(f'/sys/class/net/{bond}/bonding/slaves').split()
self.assertIn(member, slaves)
+ def test_bonding_source_bridge_interface(self):
+ # Re-use member interface that is already a source-interface
+ bond = 'bond1097'
+ bridge = 'br6327'
+ member = next(iter(self._members))
+
+ self.cli_set(self._base_path + [bond, 'member', 'interface', member])
+ self.cli_set(['interfaces', 'bridge', bridge, 'member', 'interface', member])
+
+ # check validate() - can not add interface to bond, it is a member of bridge ...
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+
+ self.cli_delete(['interfaces', 'bridge', bridge])
+ self.cli_commit()
+
+ # verify config
+ slaves = read_file(f'/sys/class/net/{bond}/bonding/slaves').split()
+ self.assertIn(member, slaves)
+
def test_bonding_uniq_member_description(self):
ethernet_path = ['interfaces', 'ethernet']
for interface in self._interfaces: