Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 0810db8

Browse files
committed
T7658: Fix default max-map-count and add smoketest this parameter
1 parent d37cca0 commit 0810db8

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

interface-definitions/include/vpp_host_resources.xml.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
<properties>
99
<help>Maximum number of memory map areas a process may have</help>
1010
<valueHelp>
11-
<format>u32:65535-2147483647</format>
11+
<format>u32:65530-2147483647</format>
1212
<description>Areas count</description>
1313
</valueHelp>
1414
<constraint>
15-
<validator name="numeric" argument="--range 65535-2147483647"/>
15+
<validator name="numeric" argument="--range 65530-2147483647"/>
1616
</constraint>
1717
</properties>
18-
<defaultValue>65535</defaultValue>
18+
<defaultValue>65530</defaultValue>
1919
</leafNode>
2020
<leafNode name="shmmax">
2121
<properties>

smoketest/scripts/cli/test_vpp.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from vyos.utils.process import process_named_running
3232
from vyos.utils.file import read_file
3333
from vyos.utils.process import rc_cmd
34+
from vyos.utils.system import sysctl_read
3435
from vyos.vpp.utils import human_page_memory_to_bytes
3536

3637
sys.path.append(os.getenv('vyos_completion_dir'))
@@ -1393,6 +1394,25 @@ def test_17_vpp_nat(self):
13931394
_, out = rc_cmd('sudo vppctl show nat44 summary')
13941395
self.assertIn(f'max translations per thread: {sess_limit} fib 0', out)
13951396

1397+
def test_18_vpp_host_resources(self):
1398+
max_map_count = '100000'
1399+
hr_path = base_path + ['settings', 'host-resources']
1400+
1401+
# Check if max-map-count has default value
1402+
self.assertEqual(sysctl_read('vm.max_map_count'), '65530')
1403+
1404+
# Change max-map-count and check
1405+
self.cli_set(hr_path + ['max-map-count', max_map_count])
1406+
self.cli_commit()
1407+
1408+
self.assertEqual(sysctl_read('vm.max_map_count'), max_map_count)
1409+
1410+
# We cannot decrease max-map-count value so expect '100000' not '65530'
1411+
self.cli_delete(hr_path + ['max-map-count'])
1412+
self.cli_commit()
1413+
1414+
self.assertEqual(sysctl_read('vm.max_map_count'), max_map_count)
1415+
13961416

13971417
if __name__ == '__main__':
13981418
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)