An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
The pan-os-upgrade project currently lacks a comprehensive suite of unit and integration tests. As the project grows in complexity and usage, the absence of automated tests poses a risk to stability and maintainability. Implementing a structured testing framework will significantly improve the reliability of the tool, catch regressions early, and facilitate future enhancements by ensuring new changes do not inadvertently break existing functionality.
Objectives
Establish Testing Framework: Set up a testing framework compatible with our project stack, considering tools like pytest for unit tests and potentially tox for testing across multiple Python versions.
Unit Tests: Develop unit tests for critical functions, particularly those handling upgrade logic, HA functionality, and response parsing. Focus should initially be placed on areas of the codebase that are most prone to errors or have had issues in the past.
Integration Tests: Create integration tests that simulate real-world upgrade scenarios, including HA and non-HA setups, to ensure the tool behaves as expected in a variety of environments and configurations.
Continuous Integration (CI) Integration: Integrate the tests into a CI pipeline to automatically run tests against pull requests and commits, ensuring that all changes are verified before merging.
Specific Areas for Testing
HA Logic Separation: Given recent enhancements to handle Panorama and PAN-OS HA functionality distinctly, it's crucial to ensure these paths are thoroughly tested.
Upgrade Path Calculations: The logic that determines the upgrade path for devices should be rigorously tested to prevent incorrect upgrade recommendations.
Error Handling: Tests should cover scenarios where the tool encounters unexpected responses or errors from devices to ensure graceful handling and clear, informative logging.
Expected Outcome
The implementation of unit and integration tests will bolster the project's reliability and facilitate a more streamlined development process. It will provide contributors with immediate feedback on their changes, reducing the likelihood of introducing bugs and regressions.
Call for Contributions
Contributions to this testing effort are highly welcome, whether in the form of writing tests, setting up testing infrastructure, or providing guidance and best practices. If you have experience in Python testing frameworks and are interested in improving the robustness of the pan-os-upgrade tool, your input would be invaluable.
Please share any initial thoughts, proposed testing strategies, or areas of the codebase you believe should be prioritized for testing.
Overview
The
pan-os-upgrade
project currently lacks a comprehensive suite of unit and integration tests. As the project grows in complexity and usage, the absence of automated tests poses a risk to stability and maintainability. Implementing a structured testing framework will significantly improve the reliability of the tool, catch regressions early, and facilitate future enhancements by ensuring new changes do not inadvertently break existing functionality.Objectives
pytest
for unit tests and potentiallytox
for testing across multiple Python versions.Specific Areas for Testing
Expected Outcome
The implementation of unit and integration tests will bolster the project's reliability and facilitate a more streamlined development process. It will provide contributors with immediate feedback on their changes, reducing the likelihood of introducing bugs and regressions.
Call for Contributions
Contributions to this testing effort are highly welcome, whether in the form of writing tests, setting up testing infrastructure, or providing guidance and best practices. If you have experience in Python testing frameworks and are interested in improving the robustness of the
pan-os-upgrade
tool, your input would be invaluable.Please share any initial thoughts, proposed testing strategies, or areas of the codebase you believe should be prioritized for testing.