summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-02-23 12:39:47 +0100
committerChristian Breunig <christian@breunig.cc>2025-02-23 12:39:47 +0100
commitdc6b7f451ba3409c725dcded440f4847e150de93 (patch)
tree202403cce29bfc29b93bdc5ae11dda5604b8300d /smoketest/scripts
parent5d9d232fd93ad5bf89ba44a2d0ec3b196599fa74 (diff)
downloadvyos-1x-dc6b7f451ba3409c725dcded440f4847e150de93.tar.gz
vyos-1x-dc6b7f451ba3409c725dcded440f4847e150de93.zip
bond: T7191: fix error message when member interface is used multiple times
Sharing the same physical interface among multiple bond interfaces causes information to be lost within the error message set interfaces bonding bond10 member interface eth1 set interfaces bonding bond10 member interface eth2 set interfaces bonding bond20 member interface eth1 set interfaces bonding bond20 member interface eth2 commit Results in: [ interfaces bonding bond10 ] Can not add interface "eth1" to bond, it is already a member of bond "b"! [[interfaces bonding bond10]] failed [ interfaces bonding bond20 ] Can not add interface "eth1" to bond, it is already a member of bond "b"! It should infact output the full name of the bond interface.
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_bonding.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py
index 1a72f9dc4..f99fd0363 100755
--- a/smoketest/scripts/cli/test_interfaces_bonding.py
+++ b/smoketest/scripts/cli/test_interfaces_bonding.py
@@ -167,18 +167,25 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase):
def test_bonding_multi_use_member(self):
# Define available bonding hash policies
- for interface in ['bond10', 'bond20']:
+ bonds = ['bond10', 'bond20', 'bond30']
+ for interface in bonds:
for member in self._members:
self.cli_set(self._base_path + [interface, 'member', 'interface', member])
# check validate() - can not use the same member interfaces multiple times
with self.assertRaises(ConfigSessionError):
self.cli_commit()
-
- self.cli_delete(self._base_path + ['bond20'])
+ # only keep the first bond interface configuration
+ for interface in bonds[1:]:
+ self.cli_delete(self._base_path + [interface])
self.cli_commit()
+ bond = bonds[0]
+ member_ifaces = read_file(f'/sys/class/net/{bond}/bonding/slaves').split()
+ for member in self._members:
+ self.assertIn(member, member_ifaces)
+
def test_bonding_source_interface(self):
# Re-use member interface that is already a source-interface
bond = 'bond99'