summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_bonding.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-13 10:49:31 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-13 10:49:31 +0200
commitca75162b3bbace38fcad5c91ad07c4fedac8444c (patch)
treefd6005a2a1211f54812feac9bea17e9dd064be9c /smoketest/scripts/cli/test_interfaces_bonding.py
parent42ede6c76a8862c40dfa525a2be825251262b913 (diff)
downloadvyos-1x-ca75162b3bbace38fcad5c91ad07c4fedac8444c.tar.gz
vyos-1x-ca75162b3bbace38fcad5c91ad07c4fedac8444c.zip
smoketest: bonding: test minimum link assignment
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_bonding.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_bonding.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py
index 03cdafb8d..ab949c8bd 100755
--- a/smoketest/scripts/cli/test_interfaces_bonding.py
+++ b/smoketest/scripts/cli/test_interfaces_bonding.py
@@ -22,6 +22,7 @@ from base_interfaces_test import BasicInterfaceTest
from vyos.ifconfig import Section
from vyos.ifconfig.interface import Interface
from vyos.configsession import ConfigSessionError
+from vyos.util import get_interface_config
from vyos.util import read_file
class BondingInterfaceTest(BasicInterfaceTest.TestCase):
@@ -94,5 +95,24 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase):
state = Interface(remove_member).get_admin_state()
self.assertEqual('up', state)
+ def test_bonding_min_links(self):
+ # configure member interfaces
+ min_links = len(self._interfaces)
+ 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, 'min-links', str(min_links)])
+
+ self.cli_commit()
+
+ # verify config
+ for interface in self._interfaces:
+ tmp = get_interface_config(interface)
+
+ self.assertEqual(min_links, tmp['linkinfo']['info_data']['min_links'])
+ # check LACP default rate
+ self.assertEqual('slow', tmp['linkinfo']['info_data']['ad_lacp_rate'])
+
if __name__ == '__main__':
unittest.main(verbosity=2)