diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-02-06 20:56:37 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-02-06 20:57:07 +0100 |
commit | 8a8d363d65cab77f2617a3519471c856e92342db (patch) | |
tree | 00516bf4809793864a43e99d6db31a8bf4d617dd /smoketest/scripts/cli | |
parent | 073bd082337272d846080fc86e56ed696287ba69 (diff) | |
download | vyos-1x-8a8d363d65cab77f2617a3519471c856e92342db.tar.gz vyos-1x-8a8d363d65cab77f2617a3519471c856e92342db.zip |
smoketest: bond: T4228: verify bond member is only used once
(cherry picked from commit b4185f8356d69476292906ebe32daf1c4867601a)
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bonding.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py index 86000553e..1d9a887bd 100755 --- a/smoketest/scripts/cli/test_interfaces_bonding.py +++ b/smoketest/scripts/cli/test_interfaces_bonding.py @@ -36,7 +36,6 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase): cls._test_vlan = True cls._test_qinq = True cls._base_path = ['interfaces', 'bonding'] - cls._interfaces = ['bond0'] cls._mirror_interfaces = ['dum21354'] cls._members = [] @@ -52,6 +51,7 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase): cls._options['bond0'] = [] for member in cls._members: cls._options['bond0'].append(f'member interface {member}') + cls._interfaces = list(cls._options) # call base-classes classmethod super(cls, cls).setUpClass() @@ -150,5 +150,19 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase): defined_policy = read_file(f'/sys/class/net/{interface}/bonding/xmit_hash_policy').split() self.assertEqual(defined_policy[0], hash_policy) + def test_bonding_multi_use_member(self): + # Define available bonding hash policies + for interface in ['bond10', 'bond20']: + 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']) + + self.cli_commit() + if __name__ == '__main__': unittest.main(verbosity=2) |