summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-10 12:50:35 +0100
committerChristian Breunig <christian@breunig.cc>2024-03-10 12:50:35 +0100
commita72ededa0b29c25efaab52f2db170c34eba50248 (patch)
tree02896be9cc62e29b42ca82cd26f7a22a1e86489e /smoketest/scripts
parent91a48de5f169519025826bb1783706055fdf5dfd (diff)
downloadvyos-1x-a72ededa0b29c25efaab52f2db170c34eba50248.tar.gz
vyos-1x-a72ededa0b29c25efaab52f2db170c34eba50248.zip
xml: T5738: lower maximum description to 255 characters
e.g. Linux Kernel only supports 255 and not 256 characters for the ifalias field.
Diffstat (limited to 'smoketest/scripts')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index a40b762a8..9b705c801 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -318,6 +318,22 @@ class BasicInterfaceTest:
self.assertEqual(tmp, str())
self.assertEqual(Interface(intf).get_alias(), str())
+ # Test maximum interface description lengt (255 characters)
+ test_string='abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789___'
+ for intf in self._interfaces:
+
+ self.cli_set(self._base_path + [intf, 'description', test_string])
+ for option in self._options.get(intf, []):
+ self.cli_set(self._base_path + [intf] + option.split())
+
+ self.cli_commit()
+
+ # Validate interface description
+ for intf in self._interfaces:
+ tmp = read_file(f'/sys/class/net/{intf}/ifalias')
+ self.assertEqual(tmp, test_string)
+ self.assertEqual(Interface(intf).get_alias(), test_string)
+
def test_add_single_ip_address(self):
addr = '192.0.2.0/31'
for intf in self._interfaces: