summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_vrf.py
AgeCommit message (Collapse)Author
2026-06-18Merge pull request #5279 from sarthurdev/T8546Christian Breunig
firewall: T8546: Fix conntrack_required for global state-policy
2026-06-17firewall: T8546: Fix conntrack_required for global state-policysarthurdev
2026-06-16T8923: normalize "can not" to "cannot"Christian Breunig
Replace two-word "can not" / "Can not" with "cannot" across comments, ConfigError messages, CLI help text, and op-mode output. Standard SNMP MIB files under mibs/ are left unchanged.
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
2026-03-27T8410: Fix typos and mistakes for comments and messagesViacheslav Hletenko
Fix typos and mistakes No functional changes
2026-01-21Merge pull request #4921 from hedrok/T7664-update-smoketest-scriptChristian Breunig
T7664: support FRR 10.5
2026-01-12T7664: ip protocol 'kernel' etc removedKyrylo Yatsenko
In FRR 10.5 ip protocols * connected * kernel * local * table * table-direct are removed. First three in fb8e399e4f66d09780f176fbecb99168089e64eb, table* in 7fd030504be060387694e8a2af7f19ddd7dee39d. In `ip protocols`, `ipv6 protocols` and `vrf` VyOS supports * connected * kernel * table Remove these from CLI, add migration scripts, update tests.
2026-01-10vrf: T8169: prevent deletion if instance referenced in policy based routingChristian Breunig
Check if the VRF which is about to be removed is referenced in any PBR rule, where any is one or more of route, route6, local-route or local-route6.
2025-11-12vrf: T7255: Impossible to delete protocols under VRFOleksandr Kuchmystyi
When deleting the 'protocols' node under a VRF, a `KeyError` was raised in `frrender.py` because the 'protocols' dictionary key was missing when attempting to update protocol states. This prevented configuration commits from completing successfully.
2025-11-06smoketest: T7996: replace hardcoded sleep(8) in VRF test with wait_for()Christian Breunig
The original VRF DHCP test case, introduced in commit 186900f7165b2 ("smoketest: T7927: test DHCP route preservation"), used a fixed delay of 8 seconds to wait for the DHCP server and client to initialize. This approach was unreliable and could cause unnecessary test delays. Since commit 354517677f ("wlb: T7977: Updated smoketest to validate nft vmap weight buckets"), the "vyos.utils.misc.wait_for()" helper provides a more efficient busy-wait loop with an early-exit condition. This test case now uses wait_for() to detect when the DHCP-assigned default route becomes available, eliminating the fixed sleep and reducing test runtime.
2025-11-06smoketest: T7996: fix hardcoded "vrf red" search path in FRR configChristian Breunig
Commit 186900f7165b2 ("smoketest: T7927: test DHCP route preservation") which was added to validate a bugfix for DHCP default routes added it's own little regression. Tests defined a VRF named red15, but when reading in the FRR configuration we have had a hardcoded search for "vrf red" instead. This has been fixed to re-use the defined VRF variable name we perform our test on.
2025-11-06smoketest: T7996: vrf CLI path is always deleted in tearDown()Christian Breunig
2025-10-21T7948: always call setUp() and tearDown() base class methodsChristian Breunig
While working on task T7664 (FRR 10.4 upgrade), I identified the need for additional validation and safeguards around the FRR management daemon. The most appropriate place for this logic is in the setUp() and tearDown() methods of the smoketest base class, VyOSUnitTestSHIM. However, during implementation, it became apparent that test cases do not consistently invoke the base class's setup and teardown methods. This inconsistency complicates the process of capturing the FRR mgmtd PID at the start of a test and verifying that it remains unchanged by the end - a key step in detecting crashes or unexpected terminations (e.g., SIGSEGV) of the FRR management daemon during tests.
2025-10-17smoketest: T7927: test DHCP route preservationChristian Breunig
This complements commit cf4666257 ("frrender: T7927: de-nest DHCP and PPPoE interface section for VRFs") by validating the new DHCP behavior. When a VRF bound interface obtains an IP via DHCP, the default route received must be reflected in FRR's routing table (vtysh). Ensure the dynamic DHCP learned route is retained even when unrelated sections of the FRR configuration are modified.
2025-10-16frr: T7664: drop BASH/SED implementation in smoketest getFRRconfig()Christian Breunig
Rathern then re-inventing the wheel by outself we import the frr-reload.py script and their read-in function of the current vtysh configuration.
2025-10-16frr: T7664: remove CSTORE_GUARD_TIME from smoketestsChristian Breunig
2025-09-30smoketest: T7858: make failfast main argument dynamicChristian Breunig
When smoketest debugging is enabled (by creating the file /tmp/vyos.smoketest.debug), all available smoketests will fail fast instead of running to completion. This helps reduce test time when something is broken or undergoing refactoring, as it avoids waiting for the full test suite to finish.
2025-09-23kea: T7821: Update paths for Kea v2.7.9 security changessarthurdev
2025-08-19Merge pull request #4508 from davi2367/vrf-dhcpDaniil Baturin
kea: T6211: add VRF support for KEA dhcp server
2025-08-15kea: T6211: add VRF support for KEA dhcp serverDavid Vølker
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
2025-01-06configd: T6747: use one long-lived instance of FRRender (#4274)Christian Breunig
* smoketest: T6747: call wait after commit() only for FRR related tests Commit 702a60a8de28 ("smoketest: T6746: wait after commit() until frr-reload is no longer running") added a guard timeout for every commit executed via CLI smoketests. This commit changes the bahavior to only add the guard timeout for FRR related testscases. This improves the overall smoketest time. * configd: T6747: use one long-lived instance of FRRender Previously there was one FRRender() instance per config session. This resulted in re-rendering the FRR configuration every time a new config session was created. Example: vyos@vyos:~$ configure vyos@vyos# set interfaces dummy dum0 description foo vyos@vyos# commit vyos@vyos# exit vyos@vyos:~$ configure vyos@vyos# set interfaces dummy dum0 description bar vyos@vyos# commit vyos@vyos# exit In the past this caused a re-render of the FRR configuration as the delta check added in commit ec80c75d6776 ("frrender: T6746: only re-render FRR config if config_dict did change") evaluated to false, as it operated on a new instance of the FRRender class. With this change there is no FRR re-render, as there is nothing to update in FRR.
2024-12-30frr: T6746: additional improvements after 10.2 upgrade (#4259)Christian Breunig
* smoketest: T6746: add substring search in getFRRconfig() Some daemons (e.g. bgpd) have several nested substrings/sections like router bgp 100 address-family ipv4 unicast .. exit-address-family exit We can now use getFRRconfig() with the substring option to extract only address-family ipv4 unicast .. exit-address-family Making config validation more granular * frrender: T6746: only re-render FRR config if config_dict did change * frrender: T6746: fix naming glitch isis/eigrp * frrender: T6746: add --stdout option when running with debug flags * smoketest: T6746: remove unneeded commit_guard time It was an invalid workarround as the underlaying issue seems to be a race condition in CStore. The commit process is not finished until all pending files from VYATTA_CHANGES_ONLY_DIR are copied to VYATTA_ACTIVE_CONFIGURATION_DIR. This is done inside libvyatta-cfg1 and the FUSE UnionFS part. On large non-interactive commits FUSE UnionFS might not replicate the real state in time, leading to errors when querying the working and effective configuration. TO BE DELETED AFTER SWITCH TO IN MEMORY CONFIG
2024-12-16vrf: T6746: bugfix change of VNIChristian Breunig
VNI was always retrieved via effective configuration and not active configuration.
2024-12-16frr: T6747: make daemon definitions re-usable for both conf-mode and smoketestsChristian Breunig
2024-07-26vrf: T6603: conntrack ct_iface_map must only contain one entry for ↵Christian Breunig
iifname/oifname When any of the following features NAT, NAT66 or Firewall is enabled, for every VRF on the CLI we install one rule into nftables for conntrack: chain vrf_zones_ct_in { type filter hook prerouting priority raw; policy accept; counter packets 3113 bytes 32227 ct original zone set iifname map @ct_iface_map counter packets 8550 bytes 80739 ct original zone set iifname map @ct_iface_map counter packets 5644 bytes 67697 ct original zone set iifname map @ct_iface_map } This is superfluous.
2024-07-20utils: migrate to new get_vrf_tableid() helperChristian Breunig
Commit 452068ce7 ("interfaces: T6592: moving an interface between VRF instances failed") introduced a new helper to retrieve the VRF table ID from the Kernel. This commit migrates the old code path where the individual fields got queried to the new helper vyos.utils.network.get_vrf_tableid().
2024-05-01vrf: T6189: render FRR L3VNI configuration when creating VRF instanceChristian Breunig
When adding and removing VRF instances on the fly it was noticed that the vni statement under the VRF instance in FRR vanishes. This was caused by a race condition which was previously designed to fix another bug. The wierd design of a Python helper below the VRF tree to only generate the VNI configuration nodes is now gone and all is rendered in the proper place.
2024-04-03T6199: drop unused Python importsChristian Breunig
found using "git ls-files *.py | xargs pylint | grep W0611"
2024-02-27vrf: conntrack: T6073: Populate VRF zoning chains only while conntrack is ↵sarthurdev
required
2024-02-16T6001: add option to disable next-hop-tracking resolve-via-default in VRF ↵Christian Breunig
context * set vrf name <name> ip nht no-resolve-via-default * set vrf name <name> ipv6 nht no-resolve-via-default
2024-02-07vrf: T5973: module is now statically compiled into the kernelChristian Breunig
Always enable VRF strict_mode
2023-12-20vrf: T591: define sysctl setting for net.vrf.strict_modeChristian Breunig
Enable/Disable VRF strict mode, when net.vrf.strict_mode=0 (default) it is possible to associate multiple VRF devices to the same table. Conversely, when net.vrf.strict_mode=1 a table can be associated to a single VRF device. A VRF table can be used by the VyOS CLI only once (ensured by verify()), this simply adds an additional Kernel safety net, but a requirement for IPv6 segment routing headers.
2023-11-27smoketest: T31: remove VRF failfast unittest aargumentChristian Breunig
2023-08-24system: T5505: fix zebra route-map is not removed from FRRChristian Breunig
Configuring "set system ip protocol ospf|bgp route-map foo" and commit it installs the route-map into FRR. Removing the CLI configuration "delete system ip protocol" does not remove the route-map from FRR - it stays active. This commit adds the fix and appropriate smoketests extenstion.
2023-08-07smoketest: make use of vlan=False API when calling Section.interfacesChristian Breunig
2023-08-06T5195: move helpers from vyos.validate to vyos.utils packageChristian Breunig
2023-07-14T5195: vyos.util -> vyos.utils package refactoring (#2093)Christian Breunig
* T5195: move run, cmd, call, rc_cmd helper to vyos.utils.process * T5195: use read_file and write_file implementation from vyos.utils.file Changed code automatically using: find . -type f -not -path '*/\.*' -exec sed -i 's/^from vyos.util import read_file$/from vyos.utils.file import read_file/g' {} + find . -type f -not -path '*/\.*' -exec sed -i 's/^from vyos.util import write_file$/from vyos.utils.file import write_file/g' {} + * T5195: move chmod* helpers to vyos.utils.permission * T5195: use colon_separated_to_dict from vyos.utils.dict * T5195: move is_systemd_service_* to vyos.utils.process * T5195: fix boot issues with missing imports * T5195: move dict_search_* helpers to vyos.utils.dict * T5195: move network helpers to vyos.utils.network * T5195: move commit_* helpers to vyos.utils.commit * T5195: move user I/O helpers to vyos.utils.io
2023-04-26vrf: T5174: ensure no duplicate VNIs can be definedChristian Breunig
2023-04-13T5150: initial VRF support for Kernel/Zebra route-map filteringChristian Breunig
2022-05-07vrf: T4419: support to disable IP forwarding within a given VRFChristian Poessinger
2022-04-25smoketest: bugfix on proper inheritance levels for classmethodChristian Poessinger
2022-04-08smoketest: vrf: T4346: IPv6 address family can no longer be disabled in the ↵Christian Poessinger
Kernel
2022-04-06smoketest: vrf: T4331: IPv6 link-local addresses not configured for ↵Christian Poessinger
interface in VRF
2022-03-30smoketest: T4319: verify correct assignment of loopback IP addressesChristian Poessinger
2021-11-21smoketest: remove superfluous ConfigSession importChristian Poessinger
2021-11-15smoketest: vrf: T3960: verify co-existence of multiple VNIsChristian Poessinger
2021-06-20smoketest: T3637: add testcase for vrf bind-to-all optionChristian Poessinger
2021-03-17smoketest: add shim for every test to re-use common tastsChristian Poessinger
Currently every smoketest does the setup and destruction of the configsession on its own durin setUp(). This creates a lot of overhead and one configsession should be re-used during execution of every smoketest script. In addiion a test that failed will leaf the system in an unconsistent state. For this reason before the test is executed we will save the running config to /tmp and the will re-load the config after the test has passed, always ensuring a clean environment for the next test.
2021-03-14vrf: T3344: move dynamic routing protocols under "vrf name <name> protocols"Christian Poessinger
Instead of having the dynamic routing protocols OSPF and BGP residing under the "protocols vrf <name> [ospf|bgp]" nodes, rather move them directly under the "vrf name <name> protocols [ospf|bgp]" node. Now all VRF related parts are placed under the same root node. This eases the verify steps tremendously, as we do not need to check wheter a VRF eists or not, it will always exist as we operate under a child node.