summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-25 18:31:57 +0200
committerGitHub <noreply@github.com>2021-06-25 18:31:57 +0200
commitf33c6e856b2d4c0c7964d7b61d6aa7ccb9bc237b (patch)
treea2ecf9ee944c5e113f4003c6d32d17b6819edbad /smoketest
parentc8ef5e8bdce01bbf05297df39e6c6223d0b2a2ea (diff)
parent9431383abc926ca4513928c56924e942ea250cc8 (diff)
downloadvyos-1x-f33c6e856b2d4c0c7964d7b61d6aa7ccb9bc237b.tar.gz
vyos-1x-f33c6e856b2d4c0c7964d7b61d6aa7ccb9bc237b.zip
Merge pull request #898 from DmitriyEshenko/1x25062021
T3649: bonding: Add additional hash policies
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_bonding.py17
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 cf147fe58..43f661f6b 100755
--- a/smoketest/scripts/cli/test_interfaces_bonding.py
+++ b/smoketest/scripts/cli/test_interfaces_bonding.py
@@ -133,5 +133,22 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase):
self.assertEqual(0, tmp['linkinfo']['info_data']['min_links'])
self.assertEqual(lacp_rate, tmp['linkinfo']['info_data']['ad_lacp_rate'])
+ def test_bonding_hast_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.cli_set(self._base_path + [interface] + option.split())
+
+ self.cli_set(self._base_path + [interface, 'hash-policy', hash_policy])
+
+ self.cli_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)