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

Commit bf0f29e

Browse files
committed
T7678: Add smoketest for host-resources
1 parent 03a0285 commit bf0f29e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

smoketest/scripts/cli/test_vpp.py

Lines changed: 28 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'))
@@ -1417,6 +1418,33 @@ def test_18_vpp_sflow(self):
14171418
self.cli_delete(base_sflow)
14181419
self.cli_commit()
14191420

1421+
def test_18_host_resources(self):
1422+
max_map_count = '100000'
1423+
shmmax = '55555555555555'
1424+
hr_path = ['system', 'option', 'host-resources']
1425+
1426+
# Check if max-map-count has default auto calculated value
1427+
# but not less than '65530'
1428+
self.assertEqual(sysctl_read('vm.max_map_count'), '65530')
1429+
# The same is with: kernel.shmmax = '4294967296'
1430+
self.assertEqual(sysctl_read('kernel.shmmax'), '4294967296')
1431+
1432+
# Change max-map-count, shmmax and check
1433+
self.cli_set(hr_path + ['max-map-count', max_map_count])
1434+
self.cli_set(hr_path + ['shmmax', shmmax])
1435+
self.cli_commit()
1436+
1437+
self.assertEqual(sysctl_read('vm.max_map_count'), max_map_count)
1438+
self.assertEqual(sysctl_read('kernel.shmmax'), shmmax)
1439+
1440+
# We expect max-map-count and shmmax will return auto calculated values
1441+
self.cli_delete(hr_path + ['max-map-count'])
1442+
self.cli_delete(hr_path + ['shmmax'])
1443+
self.cli_commit()
1444+
1445+
self.assertEqual(sysctl_read('vm.max_map_count'), '65530')
1446+
self.assertEqual(sysctl_read('kernel.shmmax'), '4294967296')
1447+
14201448

14211449
if __name__ == '__main__':
14221450
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)