diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-11-20 21:24:32 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-11-21 20:39:06 +0100 |
| commit | 6e9fbf809391b80b8f4c6257af26a8f53b66b53e (patch) | |
| tree | ae5f52bc7e3ce10b3b4421fc3d54f6a26d78d3a3 /smoketest/scripts/cli | |
| parent | 4f2d7c38ca2a0c35e81e0bf8e9a0e4abdf7fdfcc (diff) | |
| download | vyos-1x-6e9fbf809391b80b8f4c6257af26a8f53b66b53e.tar.gz vyos-1x-6e9fbf809391b80b8f4c6257af26a8f53b66b53e.zip | |
bond: T8023: validate member interface min/max MTU
It is impossible to set the bond interface MTU to be larger or lower then the
limits of the underlaying interface MTU. Add proper commit validation and
smoketest.
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_interfaces_bonding.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py index 21918282d..b6eb5328d 100755 --- a/smoketest/scripts/cli/test_interfaces_bonding.py +++ b/smoketest/scripts/cli/test_interfaces_bonding.py @@ -334,5 +334,29 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase): id = int(id) + 1 + def test_bonding_member_mtu(self): + # This Smoketest only works on our CI platform where we force the NIC + # to virtio and an MTU of only 1500 bytes max + if not os.path.exists('/tmp/vyos.smoketests.hint'): + self.skipTest('Not running under VyOS CI/CD QEMU environment!') + + 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, 'mtu', '10000']) + + # check validate() - MTU of bond higher then virtio max MTU + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + for interface in self._interfaces: + for option in self._options.get(interface, []): + self.cli_set(self._base_path + [interface] + option.split()) + + self.cli_delete(self._base_path + [interface, 'mtu']) + + self.cli_commit() + if __name__ == '__main__': unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on()) |
