summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2026-05-19docs: cross-reference packer-vyos as related projectdocs/related-projectsRoberto Bertó
Add a "Related projects" section in the main README pointing to vyos-contrib/packer-vyos, the Packer-based image builder that produces ready-to-deploy VyOS images. The two projects are complementary: packer-vyos builds the appliance, pyvyos drives it. Also mention packer-vyos in tests/pve/README.md as an alternative to the interactive install in phase 1 of the e2e harness — without making the harness depend on it. This commit is documentation only. It does not change pyvyos behaviour, payloads, or public API.
2026-05-19tests: add live VyOS e2e harness on ProxmoxRoberto Bertó
Adds an opt-in end-to-end harness that runs pyvyos against a real VyOS HTTPS API on a Proxmox VE host. tests/pve/ shell-based VM lifecycle on a remote PVE host: preflight, ensure-template (state-machine over the VMID with manual-install phase 1 and cloud-init phase 2), create/start/stop/destroy, run-e2e. Cloud-init seed ISO is generated on the PVE host itself; nothing local-side beyond ssh is required. .env is gitignored; .env.example documents the full set of variables. tests/e2e/ pytest suite that exercises the public methods most likely to regress on a payload change: show, retrieve_show_config, configure_set / retrieve_return_values / configure_delete round trip, and configure_multiple_op batch. Auto-skipped unless PYVYOS_E2E=1. The cloud-init template now sets 'service https api rest' before the API key. Without that flag VyOS only exposes /info; the other HTTPS routes return 404. README and tests/pve/README document the requirement, both for cloud-init and for the manual-fallback path. Also fixes a pre-existing footgun in pyproject.toml: the pytest-env defaults overwrote VYDEVICE_HOSTNAME from the shell, which made the e2e tests silently aim at the stale 192.168.56.100 fixture host. The entries now use the 'D:' (default) prefix so live runs can override from the environment as expected. Validated against VyOS rolling 2026.05.18-0045: 4 e2e + 57 unit tests pass. This commit does not change pyvyos HTTP payloads, request handling, or response parsing.
2026-05-19refactor: remove unused specs, exceptions, and request_idRoberto Bertó
The pyvyos.specs Pydantic models were never imported by the runtime and had 0% test coverage. The pyvyos.exceptions hierarchy was defined but never raised anywhere. The request_id helper generated UUIDs that were attached to log records but never propagated to callers — half-implemented tracing is worse than none. This commit does not alter request/response logic or HTTP payloads. It only removes code that was never executed and tests for that code. Removed: - pyvyos/specs/ (Pydantic models package) - pyvyos/exceptions.py (SDKError, HttpError, ApiError, ValidationError) - pyvyos/utils/ids.py (request_id helper) - tests/test_exceptions.py - tests/utils/test_ids.py Edited: - pyvyos/core/rest_client.py: drop request_id import and log extras - pyvyos/utils/__init__.py: drop request_id export Tests: 66 -> 57 passing. Coverage: 54% -> 87%. Public API unchanged.
2025-11-02feat: v0.4.0 - Architecture refactor, bug fixes, and quality improvementsfeat/architecture-and-quality-improvementsroberto berto
- Fixed #25: config_file_save/load now include path: [] in payload - Added exception hierarchy (SDKError, HttpError, ApiError, ValidationError) - Added utility functions (json, ids, paths) - Added structured logging with request ID tracking - Added optional Pydantic validation models - Refactored to pyvyos.core.* structure with backward compatibility shims - Moved JSON specs to docs/development/vyos_api/ - Added comprehensive test suite (19 shim tests, 16 utils tests, 6 exception tests) - Updated pyproject.toml for uv sync editable installation - Added development documentation (architecture, roadmap, quality guidelines) Maintains 100% backward compatibility with 0.3.0
2025-09-16Fix/979201165- Including default valu for environment variables in unit testseduardormorais
2025-09-02Feature - Increased test coverage in case of error in responseseduardormorais
2025-09-01Feature/9930599848 - Configuration and implementation of unit tests for the ↵eduardormorais
device
2025-08-28Feature - Separation of API communication logic into a separate class. Code ↵eduardormorais
adjustments and improvements.
2023-12-13version 0.2.0 with all api and testsRoberto Berto
2023-12-13feature:Roberto Berto
- configure_set - configure_delete - config_file_save - config_file_load
2023-11-21Initial commit for retrieve_config featureRoberto Berto