diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-05-13 10:49:31 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-05-13 11:06:50 +0200 |
commit | 1d2531075269ee627ff2a138f5bf65b1ed3933a5 (patch) | |
tree | bff6826a74d58d6360d93ae1858d142b349550ff /smoketest/scripts | |
parent | 7bf6f5179dfe53ef990e0183bbd335da994090fc (diff) | |
download | vyos-1x-1d2531075269ee627ff2a138f5bf65b1ed3933a5.tar.gz vyos-1x-1d2531075269ee627ff2a138f5bf65b1ed3933a5.zip |
smoketest: bonding: test minimum link assignment
(cherry picked from commit ca75162b3bbace38fcad5c91ad07c4fedac8444c)
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bonding.py | 20 |
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 b65d97d30..b98cc30f9 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_json_iface_options from vyos.util import read_file class BondingInterfaceTest(BasicInterfaceTest.BaseTest): @@ -91,5 +92,24 @@ class BondingInterfaceTest(BasicInterfaceTest.BaseTest): 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.session.set(self._base_path + [interface] + option.split()) + + self.session.set(self._base_path + [interface, 'min-links', str(min_links)]) + + self.session.commit() + + # verify config + for interface in self._interfaces: + tmp = get_json_iface_options(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) |