diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-04-19 22:45:50 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-04-21 06:13:21 +0200 |
| commit | 754635c257b1860ce393cdc342c1b7ca7e65da1f (patch) | |
| tree | 0fbb50cbf62c7ceb09a1a5f4568318ff0314f5c4 /smoketest/scripts/cli/test_vpp.py | |
| parent | 1d81dd0c6190d9fd36d01014f3b0a2d4bb91a919 (diff) | |
| download | vyos-1x-754635c257b1860ce393cdc342c1b7ca7e65da1f.tar.gz vyos-1x-754635c257b1860ce393cdc342c1b7ca7e65da1f.zip | |
T8534: refactor sysctl_(read|write) to accept key parts
Interface names can contain dots (e.g. VLAN subinterfaces like eth0.10), which
conflicts with sysctl's dot-separated key syntax.
Change sysctl_read() and sysctl_write() to take key components as a list and
normalize each component by replacing . with / before invoking sysctl. This
fixes sysctl lookups/updates for VLAN subinterfaces.
Extend the SR-TE smoketest to cover a VLAN subinterface.
Previous error raising this issue:
vyos-configd: sysctl: cannot stat /proc/sys/net/ipv6/conf/eth0/10/seg6_enabled: No such file or directory
vyos-configd: sysctl: cannot stat /proc/sys/net/ipv6/conf/eth0/201/seg6_enabled: No such file or directory
Diffstat (limited to 'smoketest/scripts/cli/test_vpp.py')
| -rwxr-xr-x | smoketest/scripts/cli/test_vpp.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index 8fcd541f0..e987da8df 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -1052,25 +1052,25 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): # Check if max-map-count has default auto calculated value # but not less than '65530' - self.assertEqual(sysctl_read('vm.max_map_count'), '65530') + self.assertEqual(sysctl_read(['vm', 'max_map_count']), '65530') # The same is with: kernel.shmmax = '8589934592' - self.assertEqual(sysctl_read('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) + 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') + self.assertEqual(sysctl_read(['vm', 'max_map_count']), '65530') + self.assertEqual(sysctl_read(['kernel', 'shmmax']), '8589934592') def test_17_1_vpp_pppoe_mapping(self): config_file = '/run/accel-pppd/pppoe.conf' |
