summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-10 22:28:12 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-10 22:35:50 +0200
commit19bfed0abd75adacb61f170606fff8b4d2e7713f (patch)
tree2fa248a73b0512e4cf62f1600b2e29f872fe9d25 /smoketest
parent6fca4854aa2e950795ff0411abe4601f86bdeac0 (diff)
downloadvyos-1x-19bfed0abd75adacb61f170606fff8b4d2e7713f.tar.gz
vyos-1x-19bfed0abd75adacb61f170606fff8b4d2e7713f.zip
smoketest: bond: add testcase for conflicting bridge member
A bond member can not also be used as a member of a bridge interface.
Diffstat (limited to 'smoketest')
-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 29a055124..c97392708 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: