diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-03-10 15:17:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 15:17:38 +0100 |
commit | f2fab1357f599ce29ed2ee0ee91b16046ffc4a2d (patch) | |
tree | dec0d1dd004e0fbb440c8cb955368f206247be7a /smoketest/scripts/cli | |
parent | e8a6d3ddb6eb36299dbced2e119ba0699e062350 (diff) | |
parent | 259ef4740413b39da9b122db19c549eeec88114c (diff) | |
download | vyos-1x-f2fab1357f599ce29ed2ee0ee91b16046ffc4a2d.tar.gz vyos-1x-f2fab1357f599ce29ed2ee0ee91b16046ffc4a2d.zip |
Merge pull request #3113 from c-po/firewall-T6071
firewall: T6071: truncate rule description field to 255 characters
Diffstat (limited to 'smoketest/scripts/cli')
-rw-r--r-- | smoketest/scripts/cli/base_interfaces_test.py | 16 |
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: |