diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-02-24 17:42:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-24 17:42:12 +0000 |
commit | 7aa82226e3bcc15ed957a8bed6c2fba25da35525 (patch) | |
tree | faf06970fadb8141b3e2ba7cc7534aa90b83368e /smoketest | |
parent | d50ce12c521b5dbe5b70619c78eaf1de24e308f9 (diff) | |
parent | dc6b7f451ba3409c725dcded440f4847e150de93 (diff) | |
download | vyos-1x-7aa82226e3bcc15ed957a8bed6c2fba25da35525.tar.gz vyos-1x-7aa82226e3bcc15ed957a8bed6c2fba25da35525.zip |
Merge pull request #4362 from c-po/bond-T7191
bond: T7191: fix error message when member interface is used multiple times
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bonding.py | 13 |
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' |