summaryrefslogtreecommitdiff
path: root/src/tests/test_utils.py
AgeCommit message (Collapse)Author
2026-06-20utils: T9003: add list-argument variant of cmd() for safer subprocess executionChristian Breunig
A list-argument variant of cmd() for safer subprocess execution named cmdl(). Command must be a list of strings; no shell interpolation is performed, which eliminates a class of command-injection risks present when building commands with f-strings or other string formatting.
2026-04-24Merge pull request #5130 from natali-rs1985/T8460Viacheslav Hletenko
vpp: T8460: Use isolated cpus for VPP cpu-cores
2026-04-21vpp: T8460: Use isolated cpus for VPP cpu-coresNataliia Solomko
VPP CPU core assignment now uses kernel-isolated CPUs (from /sys/devices/system/cpu/isolated) with explicit corelist-workers instead of computing offsets from available cores with skip-cores/workers. Added validation that enough CPUs are actually isolated before VPP starts, and that isolate-cpus config only references existing CPU IDs. Moved smoketest for kernel option 'isolate-cpus' to test_vpp.py
2026-04-21T8534: refactor sysctl_(read|write) to accept key partsChristian Breunig
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
2025-12-17login: T8086: replace getpwall() user enumeration to avoid NSS/TACACS timeoutsChristian Breunig
The previous implementation of "system login" relied on Python's pwd.getpwall() to enumerate user accounts. This forces a full walk through the NSS stack, which is acceptable in general but problematic for our use-case. VyOS only needs information about locally created accounts and not remote accounts provided via AAA backends such as TACACS or RADIUS. When TACACS servers are unreachable, NSS lookups become extremely slow due to repeated timeouts. As a result, any operation triggering pwd.getpwall() (including configuration commits) can stall for several minutes. This change introduces a dedicated helper, get_local_passwd_entries(), which reads /etc/passwd directly and avoids NSS entirely. Since only local UIDs are relevant, this provides all required data with no external dependencies. Performance improvement on VyOS 1.4.3 with two unreachable TACACS servers: # set system login tacacs server 192.168.1.50 key test123 # set system login tacacs server 192.168.1.51 key test123 # time commit Before: real 3m29.825s user 0m0.329s sys 0m0.246s After: real 0m1.464s user 0m0.337s sys 0m0.195s This significantly improves commit performance and removes sensitivity to AAA server outages.
2025-09-26image: T5455: Add migration of SSH `known_hosts` files during image upgradeOleksandr Kuchmystyi
During upgrade, the script now checks if any `known_hosts` files exist. If so, it prompts the user to save these SSH fingerprints, and upon confirmation, copies the files to the new image persistence directory.
2025-09-23T7850: add nosetest for util list_stripJohn Estabrook
2025-06-28T7591: remove copyright years from source filesChristian Breunig
The legal team says years are not necessary so we can go ahead with it, since it will simplify backporting. Automatically removed using: git ls-files | grep -v libvyosconfig | xargs sed -i -E \ 's/^# Copyright (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers.*/# Copyright VyOS maintainers and contributors <maintainers@vyos.io>/g' In addition we will error-out during "make" if someone re-adds a legacy copyright notice
2024-06-26T6510: remove shebang for "make test" testcasesChristian Breunig
Tests must run supervisioned by unittest framework and should not be executed manually
2023-08-06smoketest: T5428: check for process running in designated VRFChristian Breunig
Start IPv4/IPv6 DHCP clients on an interface bound to a given VRF. Verify that the client process runs in the VRF context.