summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-08-19 16:00:34 +0100
committerGitHub <noreply@github.com>2025-08-19 16:00:34 +0100
commit4ad89d66634b7aa1464ae3e44bce179be48cc2bf (patch)
treeba18ed6d8f6e17ab2d34c457e8c05638fd23dab3 /smoketest/scripts/cli
parent41c9b0427b123041b0df5a2739468befb2f4e2db (diff)
parent5fa2ba9bae1f3f86ad9aa5c13eefa0aff49fd7f4 (diff)
downloadvyos-1x-4ad89d66634b7aa1464ae3e44bce179be48cc2bf.tar.gz
vyos-1x-4ad89d66634b7aa1464ae3e44bce179be48cc2bf.zip
Merge pull request #4647 from natali-rs1985/T7678
T7678: Move "vpp settings host-resources" to "system option resource-limits"
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_vpp.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py
index 07b4b1b19..b55db9e49 100755
--- a/smoketest/scripts/cli/test_vpp.py
+++ b/smoketest/scripts/cli/test_vpp.py
@@ -31,6 +31,7 @@ from vyos.configsession import ConfigSessionError
from vyos.utils.process import process_named_running
from vyos.utils.file import read_file
from vyos.utils.process import rc_cmd
+from vyos.utils.system import sysctl_read
from vyos.vpp.utils import human_page_memory_to_bytes
sys.path.append(os.getenv('vyos_completion_dir'))
@@ -1417,6 +1418,33 @@ class TestVPP(VyOSUnitTestSHIM.TestCase):
self.cli_delete(base_sflow)
self.cli_commit()
+ def test_19_resource_limits(self):
+ max_map_count = '100000'
+ shmmax = '55555555555555'
+ hr_path = ['system', 'option', 'resource-limits']
+
+ # Check if max-map-count has default auto calculated value
+ # but not less than '65530'
+ self.assertEqual(sysctl_read('vm.max_map_count'), '65530')
+ # The same is with: kernel.shmmax = '8589934592'
+ self.assertEqual(sysctl_read('kernel.shmmax'), '8589934592')
+
+ # Change max-map-count, shmmax and check
+ self.cli_set(hr_path + ['max-map-count', max_map_count])
+ self.cli_set(hr_path + ['shmmax', shmmax])
+ self.cli_commit()
+
+ self.assertEqual(sysctl_read('vm.max_map_count'), max_map_count)
+ self.assertEqual(sysctl_read('kernel.shmmax'), shmmax)
+
+ # We expect max-map-count and shmmax will return auto calculated values
+ self.cli_delete(hr_path + ['max-map-count'])
+ self.cli_delete(hr_path + ['shmmax'])
+ self.cli_commit()
+
+ self.assertEqual(sysctl_read('vm.max_map_count'), '65530')
+ self.assertEqual(sysctl_read('kernel.shmmax'), '8589934592')
+
if __name__ == '__main__':
unittest.main(verbosity=2)