diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-10-29 08:46:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-29 08:46:37 +0100 |
| commit | 0046b24ad9def8b0672606795e70b7927ea79dc4 (patch) | |
| tree | b59595d3f8111f97f85e5ecb125c2aa2281305de /smoketest/scripts/cli | |
| parent | 7e4715447564ec3a8c522ae3e4647a3474b182ed (diff) | |
| parent | c23c277d0fe3e08d1fece3e938b32406b7b976d7 (diff) | |
| download | vyos-1x-0046b24ad9def8b0672606795e70b7927ea79dc4.tar.gz vyos-1x-0046b24ad9def8b0672606795e70b7927ea79dc4.zip | |
Merge pull request #4810 from bl0way/T7896-frr-profile
T7896: Add frr profile selection
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_system_frr.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_system_frr.py b/smoketest/scripts/cli/test_system_frr.py index 588f52bf5..9217f2b27 100755 --- a/smoketest/scripts/cli/test_system_frr.py +++ b/smoketest/scripts/cli/test_system_frr.py @@ -19,6 +19,7 @@ import unittest from base_vyostest_shim import VyOSUnitTestSHIM from vyos.utils.file import read_file +from vyos.xml_ref import default_value config_file = '/etc/frr/daemons' base_path = ['system', 'frr'] @@ -150,7 +151,34 @@ class TestSystemFRR(VyOSUnitTestSHIM.TestCase): self.assertTrue(bmp_enabled) self.assertTrue(snmp_enabled) + def test_frr_profile_add_remove(self): + default_profile = default_value(base_path + ['profile']) + + # test add profile + frr_profiles = ['traditional', 'datacenter'] + for profile in frr_profiles: + # set the profile + self.cli_set(base_path + ['profile', profile]) + self.cli_commit() + # read the config file and check content + self.assertIn(f'frr_profile="{profile}"', read_file(config_file)) + # read the frr.conf file and check content + frrconfig = self.getFRRconfig() + self.assertIn(f'frr defaults {profile}', frrconfig) + + # test remove profile + self.cli_delete(base_path) + self.cli_commit() + + # read the config file and check content + self.assertIn(f'frr_profile="{default_profile}"', read_file(config_file)) + + # read the frr.conf file and check content + frrconfig = self.getFRRconfig() + self.assertIn(f'frr defaults {default_profile}', frrconfig) + def test_frr_file_descriptors(self): + default_descriptors = default_value(base_path + ['descriptors']) file_descriptors = '4096' self.cli_set(base_path + ['descriptors', file_descriptors]) @@ -160,5 +188,13 @@ class TestSystemFRR(VyOSUnitTestSHIM.TestCase): daemons_config = read_file(config_file) self.assertIn(f'MAX_FDS={file_descriptors}', daemons_config) + # test remove of descriptors + self.cli_delete(base_path) + self.cli_commit() + + # read the config file and check content + daemons_config = read_file(config_file) + self.assertIn(f'MAX_FDS={default_descriptors}', daemons_config) + if __name__ == '__main__': unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on()) |
