diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2021-06-25 15:00:37 +0000 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-06-25 18:56:51 +0200 |
commit | 150b1760230b6d7be3b7afd479f05e6bc5d861f7 (patch) | |
tree | f39ad61e819b9bd5f51ee8d1e5b1d7362c320e20 /smoketest | |
parent | 705eddbc7a2caf09c37ecafb27418a764217975a (diff) | |
download | vyos-1x-150b1760230b6d7be3b7afd479f05e6bc5d861f7.tar.gz vyos-1x-150b1760230b6d7be3b7afd479f05e6bc5d861f7.zip |
T3649: bonding: Add additional hash policies
(cherry picked from commit 9431383abc926ca4513928c56924e942ea250cc8)
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bonding.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py index 4771eb6b6..880a822a7 100755 --- a/smoketest/scripts/cli/test_interfaces_bonding.py +++ b/smoketest/scripts/cli/test_interfaces_bonding.py @@ -130,5 +130,22 @@ class BondingInterfaceTest(BasicInterfaceTest.BaseTest): self.assertEqual(0, tmp['linkinfo']['info_data']['min_links']) self.assertEqual(lacp_rate, tmp['linkinfo']['info_data']['ad_lacp_rate']) + def test_bonding_hash_policy(self): + # Define available bonding hash policies + hash_policies = ['layer2', 'layer2+3', 'layer2+3', 'encap2+3', 'encap3+4'] + for hash_policy in hash_policies: + for interface in self._interfaces: + for option in self._options.get(interface, []): + self.session.set(self._base_path + [interface] + option.split()) + + self.session.set(self._base_path + [interface, 'hash-policy', hash_policy]) + + self.session.commit() + + # verify config + for interface in self._interfaces: + defined_policy = read_file(f'/sys/class/net/{interface}/bonding/xmit_hash_policy').split() + self.assertEqual(defined_policy[0], hash_policy) + if __name__ == '__main__': unittest.main(verbosity=2) |