summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
11 daysT8516: restore _state_deleted docstring, align test docstring and fixtureYuriy Andamasov
- restore the _state_deleted docstring lost in the L2-safeguard change, now documenting the address-only delete semantics - overridden test docstring said "delete interface stanzas" but the module now emits address-only deletes; align wording - quote loopback interface name in fixture for consistency with vyos_interfaces_config.cfg
13 daysT8516: docstring fixomnom62
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
13 daysT8516: Docstring fixomnom62
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
13 daysT8516: bugfixesomnom62
14 daysMisc changesomnom62
2026-06-30Merge branch 'main' into test/l3-interfaces-unit-testsomnom62
2026-06-30T8522: fix parse_icmp_attr() split delimiter and UnboundLocalError (#464)Yuriy Andamasov
* Add easy-wins improvement spec for vyos.vyos collection Covers five phases: formatting compliance, runtime.yml redirect fix, deprecated feature cleanup, missing unit tests, and template deduplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add implementation plan for easy-wins improvements 15 tasks across 5 phases: formatting compliance, runtime.yml bugfix, deprecated code cleanup, missing unit tests, template deduplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update spec and plan with architect review corrections Key changes: - Defer Phase 5 (template deduplication) to v7.0.0: route_maps are not identical, BGP dedup blocked by Python module-level scoping, OSPF has fundamentally different command paradigms - Add .git-blame-ignore-revs step to Phase 1 - Add missing test cases: overridden/rendered for resource modules, aggregate/purge/with_address for vyos_vlan - Fix incorrect claim that version.py LooseVersion is unused - Add sequential merge requirement to preamble Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: add .worktrees/ and .claude/ to .gitignore * T8522: fix parse_icmp_attr() split delimiter and UnboundLocalError - Use val.split("/") instead of val.split(".") when parsing type/code pairs - In the numeric-only branch, use int(val) instead of the undefined type_no variable - Cast both type and code to int for consistent typing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * T8522: remove unrelated planning docs and gitignore changes These files were included from local main branch commits unrelated to this bugfix. This commit removes them to keep the PR scoped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * T8522: add parsed test for legacy type/code ICMP format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
2026-06-26T2295: vyos_user: quote plaintext-password in generated set commands (#480)Stavros Kroustouris
* vyos_user: quote plaintext-password in generated set commands VyOS requires quoted values for passwords with special characters. Align with encrypted-password and integration test conventions. Co-authored-by: Cursor <cursoragent@cursor.com> * T2295: escape plaintext-password values in vyos_user set commands Quote passwords for VyOS special-character handling and escape embedded single quotes. Update RETURN sample, add unit tests, refresh changelog. Co-authored-by: Cursor <cursoragent@cursor.com> * T2295: shorten changelog fragment for ansible-lint line-length Co-authored-by: Cursor <cursoragent@cursor.com> * T2295: use shlex.quote() for plaintext-password values Replace custom _quote_config_value() with stdlib shlex.quote() per review feedback; update unit tests and RETURN sample accordingly. Co-authored-by: Cursor <cursoragent@cursor.com> * T2295: add complex plaintext-password quoting unit test Cover spaces, shell metacharacters, embedded quotes, and backslashes in one password; assert command output matches shlex.quote(). Co-authored-by: Cursor <cursoragent@cursor.com> * T2295: assert explicit quoting in complex password unit test Replace shlex.quote()-derived expectation with a fixed command string, matching the other password quoting tests. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix RETURN doc sample, add docstrings and workflow permissions - RETURN sample was missing the username token in the example command - Add docstrings to all undocumented module-level functions to bring docstring coverage above the 80% threshold - Add explicit permissions: contents: read to codecoverage.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Revert "Fix RETURN doc sample, add docstrings and workflow permissions" This reverts commit 827809ee49cf472a8bf30ec0b24d347a75fcb083. --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20Merge branch 'main' into test/l3-interfaces-unit-testsomnom62
2026-06-19rm_templates: T8609: fix slow parse() from group-quantifier patterns (#470)Robert Navarro
* rm_templates: T8609: fix slow parse() from group-quantifier patterns Running an Ansible playbook that manages BGP route-maps on my VyOS 1.4 edge routers, the vyos.vyos.vyos_route_maps task (state=gathered or state=merged) takes ~50 seconds per host, sometimes 100s+, against devices with only a handful of route-maps configured. The persistent connection times out before the module finishes and the failure surfaces as a misleading "socket path does not exist". Three related quantifier shapes in nine rm_templates files cause O(2^n) regex backtracking on inputs that share a parser's prefix but don't match overall. parse() time on a representative 12-line route-map config drops from ~50s to <1ms post-fix. * Trailing form (188 sites): `(?P<X>\S+)\n *$"""` -> `(?P<X>\S+)\s*$"""`. Under re.VERBOSE the literal newline+indent between `\S+` and `*$` is stripped at compile time, so the source compiled to `(\S+)*$` with the `*` quantifying the named group. * Mid-pattern `(group containing \S+)*` (22 sites in snmp_server.py with a couple in bgp_global*.py): e.g. `(?P<protocol>protocol\s\S+)*` -> `(?P<protocol>protocol\s\S+)?`. Different position from the trailing form, but the same shape underneath (a group whose content includes \S+, quantified with `*`), so the same O(2^n) backtracking on prefix-sharing inputs. * Mid-pattern `(literal-only group)*` (14 sites in snmp_server.py, bgp_address_family*.py, bgp_global*.py): e.g. `(?P<as_set>as-set)*` -> `(?P<as_set>as-set)?`. No \S+ inside the quantified group, so the backtracking exposure is much smaller. On the inputs these patterns actually receive (no device line carries duplicate flags) `*` and `?` accept identical input sets, so changing to `?` is behavior-preserving. The first draft of this fix made set_comm_list_delete's `(?P<delete>\S+)` group required. The parser's setval emits `set comm-list delete` with no token after `delete`, so the parser stopped matching its own output (no existing fixture covered this case, which is why the regression initially shipped). CodeRabbit caught it during review. Replaced `delete(?P<delete>\S+)\s*$` with `\s(?P<delete>delete)\s*$` so the named group captures the literal word `delete`; the result template `{{True if delete is defined}}` continues to evaluate True. Affects: route_maps[/_14], bgp_global[/_14], bgp_address_family[/_14], snmp_server, ospf_interfaces[/_14]. Adds tests/unit/modules/network/vyos/test_rm_templates_perf.py with a 1-second budget against fixture inputs that have realistic-length identifiers, plus a round-trip test asserting set_comm_list_delete matches its own setval-generated line, plus a Bgp_address_familyTemplate14 budget test for symmetry with the other "hot" template families. * Fix regex backtracking issues in parse() method Fix slow parse() to prevent regex backtracking on prefix-sharing inputs across multiple files. Add unit test for the bugfixes. * Refactor bug fixes for regex backtracking improvements Updated bug fixes to include details on regex backtracking issues in multiple files. * Fix typo in bugfixes section of changelog * Update bugfixes for regex backtracking issues * rm_templates: T8609: route_maps.py: fix remaining trailing `*$` patterns Five sites in route_maps.py still had the `(?P<name>...)\n *$` shape that collapses to `(?P<name>...)*$` under `re.VERBOSE`, parsers `sequence`, `on_match_next`, `set_atomic_aggregate`, `set_extcommunity_bandwidth_non_transitive`, and `match_community_exact_match`. Collapsed each to `\s*$` on the same line as the named group, matching the rest of the PR. * rm_templates: T8609: route_maps.py: split overlong getval to satisfy E501 Line 517 was 161 chars (`set_extcommunity_bandwidth_non_transitive` parser) and tripped pycodestyle's E501 sanity test in CI. Split the regex source across two lines at the `\d+)` boundary; under `re.VERBOSE` the literal newline and indent between regex tokens are stripped at compile time, so the engine sees the same pattern. `\s*$` stays on the same line as the closing capture group, so the group-quantifier shape this PR fixes elsewhere isn't reintroduced. --------- Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
2026-05-25Merge branch 'main' into test/l3-interfaces-unit-testsomnom62
2026-05-25T6818: Add argument to vyos_config for controlling password filtering (#466)stronkbyte
This commit adds the argument `allow_password_change` in order to control whether any configuration lines which would make changes to user passwords should be filtered out or not. Co-authored-by: Daniil Baturin <daniil@baturin.org> Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
2026-05-23Merge branch 'main' into test/l3-interfaces-unit-testsomnom62
2026-05-16T8518: add unit tests for vyos_vlan module (#471)Yuriy Andamasov
Adds 7 unit tests for vyos_vlan covering present, present_no_change, absent, absent_no_change, aggregate, purge, and address scenarios. Fixture data moved to dedicated .cfg files under fixtures/. 🤖 Generated by [robots](https://vyos.io) Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com> Co-authored-by: Daniil Baturin <daniil@baturin.org>
2026-05-01T8520: fix vlan purge generating invalid commands for bare interfaces (#463)Yuriy Andamasov
Co-authored-by: Daniil Baturin <daniil@baturin.org>
2026-04-16T8516: fix copyright header to use VyOS Networks attributionYuriy Andamasov
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16T8516: add unit tests for vyos_l3_interfaces moduleYuriy Andamasov
2026-04-14Ignore file 2.22 sanity fixes (#453)omnom62
* sanity tests 2.22 ignore * Ignore 2.22 for sanity
2026-04-07 T8205 Ensure the vyos_user module works when user properties are defined ↵gideon-kuijt-northwave
in… (#445) * Ensure the vyos_user module works when user properties are defined in aggregate Ensure the vyos_user module works when user properties are defined in aggregate. Previously the value variable is not filled when a property is configured as a property of a user. This gives a python error when the value variable is called. * Add unit test for aggregate vyos_user module * Create vyos_user_aggregate_fix.yml Create changelog for vyos_user aggregate bugfix * Rename vyos_user_aggregate_fix.yml to T8205_vyos_user_aggregate_fix.yml * Rename T8205_vyos_user_aggregate_fix.yml to T8205_vyos_user_aggregate_fix.yml Remove unintended whitespace in changelog fragment: T8205_vyos_user_aggregate_fix.yml --------- Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com> Co-authored-by: Daniil Baturin <daniil@baturin.org>
2026-04-03CI tests fixes (ADE related) (#450)omnom62
* Init for the fixes related to ADE * testing new tox.ini * tox ade fixes * test tox * test tox * testing tox * test tox * test tox * testing tox * testing fix * testing a fix * testing tox * testing fix * bindep.txt test * test with tox
2026-03-08T8104: Add static routes multiple next-hop targets (#444)omnom62
* Mid fixes * Ready for testing * Fixing SR interface * Fix is ready * changelog * Integration tests for static_routes interface next-hop v.1.4+ WIP * branching 1.3- and 1.4+ * Integration tests for T8104 complete * Comments are resolved * Comments are resolved
2026-03-04T6836 VRF module (#408)omnom62
* t6836 vfr module init * argspec facts module for VRF * T6834 static_route module to support interface_route (#398) * t6834 init * facts fixes, WIP * T6834 - facts updates * static_routes 1.3- config, facts, args and sanit and unit tests * changelog * changelog updates * static_routes 1.4+ * static_routes v1.4 unit tests * comment removed * T6829 (area interfaces in OSPFv3 1.3-1.5) re-init (#399) * T6829 re-init * re-init T6829 ospfv3 area interface for 1.3- * changelog * changelog fix * Doc is updated * adding 1.4+ support * ospfv3 area interfaces for 1.4+ * fixed ospfv3 facts and added area interface unit test for 1.4 * ospfv3 clean-up * doc updates * Resolve merge conflicts * vrf parsers set_table * more vrf paresers added * vrf facts main code * vrf data structures * simple vrf config push * simple vrf config push * some work on vrf * basic facts done * vrf instance parsers wif * ongoing parser testing * vrf dev work * testing with paresers * all basic settings * merged for vrf * more states for VRF * vrf deleted, overriden * overriden * sanity * rst for vrf * changelog * fix changelog * doc fix * vrf delete idempotent * deleted and overridden for VFR * overriden * overriden vrf idempotency * asdvanced vrf settings * afi for VRF facts * VRF AFI config * VRF AFI tests * vrf dev work * afi dev work * afi and deep_merge fixes for VRF * afi basic provisioning * changelog * vrf sanity fixes * VRF AFI protocols and route-maps * vrf parsed, gathered, rendered fixes * docstrings VRF * docstrings VRF * docstring VRF * module doc update * vrf module examples * VRF doc examples * linter * VRF unit tests init * VRF unit tests init * VRF unit tests updates * fixed VRF overridden and deleted unit test cases * VRF integration tests init * VRF int tests rtt, merged, replaced * VRF int testt gathered, rendered * VRF int tests deleted, rendered, overridden and empty_config * linter * VRF int test misc fixes * VRF global idepmotency * fixing py3.13 runner deps * fixing lint * fixing sanity * reverting previous fixes * VRF protocols load_module and provisioning flow * fixes to bgp VRF protocol methods * VRF protocol facts init * VRF protocol load_module works * reworked VRF load_module routine * vrf protocl static fixed * Fixed static and ospf VRF protocol provisioning * Fixed static and ospf VRF protocol provisioning * VRF doc update * VRF docs update * VRF doc updates * unit tests for VRF protocols * VRF BGP protcol sanity check * VRF protocol fixed sanity checks (DOCUMENTATION) * sanity and doc for VRF fixed * VRF unit tests mock * VRF protocol integration parsed, rtt and merged init * VRF protocols - rendered, overridden * VRF protocols replaced * fix accidental changes to test_vyos_config.py * PR description * fix image * README fix * Fixing linter * Mid-result UAT overriden VRF * Mid-result for VRF UAT * VRF uat * VRF obsolete features removed
2026-02-23add commit-confirm options to vyos_config (#229)lucaelin
* added vyos_config confirm options * fix: update commit comment to match main * fix: documentation example for automatic confirm * fix: add tests for commit confirm and confirm_timeout options * fix: add config_confirm changelog fragment * fix: lint missing diff parameter for edit_config * fix: add commit confirm integration test --------- Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
2025-11-28T7933 bugfix - 'offload' action (#440)omnom62
* Init T7933 bugfix * offload-target * Argspsec fixed * Documentation fixes * fw_rules config fpor offload_target * fact fixes * offload unit test merge * offload unit tests for v1.3- overriden, replaced * Offload unit test v13 complete * v14+ offload unit tests * v1.4.+ unit tests for offload
2025-11-27T7621 vyos_firewall_global features (#432)omnom62
* t7621 vyos_firewall_global diff mode * vyos_firewall_global integration test for diff * enhanced integration tests with diff * diff integration tests * merged diff test * 1.3- specific changes to integration tests * data/config separated --------- Co-authored-by: Gaige B Paulsen <gaige@cluetrust.com>
2025-11-26T6823: correctly set the IPv6 autoconf option (#433)omnom62
* T6823 init fix * slaac and integration tests * reaplced integration test * WIP integration tests * changelog and tweaks * rendered, gathered, parsed, integration tests for SLAAC * l3_interfaces gathered, emty, deleted * deleted integration test * vif processing * vif tests * vir related integration test cases * ignore ansible-bad-import-from * ansible-bad-import-from ingore * ignore ansible-bad-import-from for all * test ansible-bad-import-from skip * ingore file * Fix bugs with configuration remove * Delete testcase fixed * SLAAC integration tests * Sanity check fixes * remove_config formatted * l3 slaac eth0 removed from SIT * Remove ignore 2.20 * ignore2.20 recovered * Remove residue
2025-11-03T7964 - Fix edgecase with empty `commands` array. (#439)Ruben van Dijk
* T7964 - Add failing test. * T7964 - Fix "IndexError: list index out of range".
2025-10-26T7496 Fix disabling src route (#420)Ruben van Dijk
* T7496 Fix disabling src route (failing tests) * T7496 Fix disabling src route (bugfix) * T7496 Fix disabling src route (Changelog) --------- Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com> Co-authored-by: Gaige B Paulsen <gaige@cluetrust.com>
2025-10-26[T7856] Fix confusion between firewall zone name and group name. (#436)Ruben van Dijk
Co-authored-by: Gaige B Paulsen <gaige@cluetrust.com>
2025-10-20fix: T7943 fix sanity checks (#437)Gaige B Paulsen
* fix: T7943 fix sanity checks * ci: update changelog
2025-10-19Fixes for sanity checks broken by upstream (#435)omnom62
* init for upstream sanity checks * PY3 removed * procenv.py PY3 fix * changelog * Bulk commit of linter changes * Clean-up
2025-08-04Sanity devel and milestone doc fix (#428)omnom62
* sanity doc fix * changelog * testing fix --------- Co-authored-by: evgmol-wbio <evgeny.molotkov@whalebone.io>
2025-06-24Pre release 6 doc updates (#421)omnom62
* pre release doc updates * changelog * module doc updates
2025-05-23T7391 domain search fix for 1.4+ (#418)omnom62
* t7391 init * sanity * vyos_system unit test * added vyos_system v14 test cases * vyos_system integration tests fix * changelog * domain search integration test * Update plugins/modules/vyos_system.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-23Integration tests FDR (#416)omnom62
* clean-up for strreamlines e2e integration tests * 1.4+ fix for snmp_server * changes to integratio tests * changelog fix * fix ampty json on vyos.py get_config * fix vyos get_config * quick fix for teardwon in vyos_system test * Update plugins/module_utils/network/vyos/vyos.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * copilot recommendations incorporated * remove copilot mess --------- Co-authored-by: John Doe <johndoe@email.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-16T6883 route-map extras support (#402)omnom62
* t6883 as_prepend_path fix * chaneglog * draft for rm community handling * rm updates * unit and integration tests for route maps * rm unit tests fixed * 1.4+ rm integration tests draft * rm set_community parser * large-community 1.4+ * unit tests fix for rm * extcommunity config * pre-commit * cleanup * RM bandwidth clauses * fixing parsers index for 1.3 RM * updated dic * fix unit tests * unit tests for RM * RM unit tests * dict literal for reserved keywords in unit tests * set_src ipv6 replaced unit test * unit test case for RM call * RM action type unit tests * rm match protocol code and unit test * doc update * set_table RM * set_table RM unit test * unit tests refactor * copilot recommendations
2025-05-08T7259 get_config() fix (#404)omnom62
* T7259 get_config() fix * fix get_config calls * vyos_config match=none integration test case * get_config() update
2025-05-08T7162: interface preflight (#397)Gaige B Paulsen
* T7162: interface preflight * fix: update with changes from PR 396 * fix: re-run pre-commit for missed updates * fix: typo
2025-04-24T7260 Remove last firewall group member. (#403)Ruben van Dijk
Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
2025-04-24T7236 firewall_rules Fix compare amount of firewall rulesets. (#401)Ruben van Dijk
Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
2025-04-17TestModule profile patch (#414)omnom62
* TestModule profile patch * changelog * linter fix
2025-04-14fix logging_global integration tests (#413)omnom62
2025-04-14snmp_server 1.4+ support in integration tests (#412)omnom62
2025-04-03Firewall_rules diff mode support (#407)omnom62
* fw_rules diff init * comment support * sanity fix * remove redundant * integration tests for fw_rules diff mode * 1.3- integration tests for firewall_rule diff * 1.4+ long string linter fix * 1.3- long string linter fix * long str rework * typo * Remove commented-out diff block in YAML file removed comments --------- Co-authored-by: Daniil Baturin <daniil@baturin.org>
2025-04-02T7284: Allow deletion of firewall description (#406)Ruben van Dijk
* T7284 (Delete firewall description not possible) Added failing tests. * T7284 (Delete firewall description not possible) Functional code. * T7284 (Delete firewall description not possible) Fixed pep8. * T7284 (Delete firewall description not possible) Added changelog. * T7284 (Delete firewall description not possible) Fixed changelog.
2025-04-02T7012 OSPFv2 integration tests fixes (#395)omnom62
* init for ospfv2 * ospfv2 rtt and merge and merge_update tests fixed * ospfv2 integration test partial fix * ospfv2 integration tests new structure and 1.4+ fixes * ospfv2 1.3- unit tests * ospfv2 changelog * Added unit tests suite for 1.4+ and vyos_ospfv2 * fixed some netsted dict, added pasive-interface default, added passive-interface exclude for 1.4+ * passive-interface-exclude support for 1.4+ * fix remove func for passive-interface-exclude in 1.4+ ospfv2 * parsed.yaml update * leftovers removed * prepare_vyous_tests.yaml to use network_cli and fail fast * ospfv2 integration tests pre-requisite scripts * reverted prepare_vyos_tests script * facts regex corrected * reworked facts regex --------- Co-authored-by: Daniil Baturin <daniil@baturin.org>
2025-04-02T6831 OSPF VIF (#400)omnom62
* t6831_ospf_vif init * ospf_vif 1.3 provisioning workflow * changelog * ospf-interface unit tests fix * parser tests * ospf vif parsers updated * added vif unt test cases for ospf_interfaces * ospf vif integration tests * fixing eth names and utils func * ospf vif prep/demolih updates * added new vif test cases
2025-03-03T6829 (area interfaces in OSPFv3 1.3-1.5) re-init (#399)omnom62
* T6829 re-init * re-init T6829 ospfv3 area interface for 1.3- * changelog * changelog fix * Doc is updated * adding 1.4+ support * ospfv3 area interfaces for 1.4+ * fixed ospfv3 facts and added area interface unit test for 1.4 * ospfv3 clean-up * doc updates
2025-03-03T6834 static_route module to support interface_route (#398)omnom62
* t6834 init * facts fixes, WIP * T6834 - facts updates * static_routes 1.3- config, facts, args and sanit and unit tests * changelog * changelog updates * static_routes 1.4+ * static_routes v1.4 unit tests * comment removed
2025-03-02T7012 ospf_interfaces integration tests (#387)omnom62
* T7012 init strucuture for ospf_interfaces integration tests * ospf_interfaces unit and integration tests fixes for 1.3- * fixes to v1.4 ospf_interfaces parsers * T7012 integration tests and 1.4+ support for ospf_interfaces