* fix(cerberus): fix config key typo and shadowed global in get_status
Fixes#1302
- Fix typo in set_url(): read 'check_application_routes' instead of
'check_applicaton_routes' so the correct config key is used
- Remove local 'check_application_routes = False' in get_status() and
declare global instead, so the value set by set_url() is actually read
- Update test config key and remove the workaround comment that
acknowledged the shadowed global
Signed-off-by: netram75 <netram.24bcs10329@sst.scaler.com>
* fix(cerberus): remove extra cerberus_url arg from application_status call
application_status(start_time, end_time) takes two parameters but was
being called with three (cerberus_url, start_time, end_time), which
would raise a TypeError whenever check_application_routes is enabled.
Remove the stale argument since the function already reads cerberus_url
from the module global.
Signed-off-by: netram75 <netram.24bcs10329@sst.scaler.com>
---------
Signed-off-by: netram75 <netram.24bcs10329@sst.scaler.com>
Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
Add rollback functionality for GCP zone outage scenarios following the
established rollback pattern (Service Hijacking, PVC, Syn Flood).
- Add @set_rollback_context_decorator to run()
- Set rollback callable before stopping nodes with base64/JSON encoded data
- Add rollback_gcp_zone_outage() static method with per-node error handling
- Fix missing poll_interval argument in starmap calls
- Add unit tests for rollback and run methods
Closes#915
Signed-off-by: YASHASVIYADAV30 <yashasviydv30@gmail.com>
Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
- Fix typo 'wating' -> 'waiting' in scenario wait log message
- Replace print() with logging.debug() for pod metrics in prometheus client
- Replace star import with explicit imports in utils/__init__.py
- Remove unnecessary global declaration in main()
- Log VM status exceptions at ERROR level with exception details
Include unit tests in tests/test_logging_and_code_quality.py covering all fixes.
Signed-off-by: 1PoPTRoN <vrxn.arp1traj@gmail.com>
Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
* Add PVC outage scenario plugin to manage PVC annotations during outages
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Remove PvcOutageScenarioPlugin as it is no longer needed; refactor PvcScenarioPlugin to include rollback functionality for temporary file cleanup during PVC scenarios.
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Refactor rollback_data handling in PvcScenarioPlugin to use str() instead of json.dumps() for resource_identifier.
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Import json module in PvcScenarioPlugin for decoding rollback data from resource_identifier.
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* feat: Encode rollback data in base64 format for resource_identifier in PvcScenarioPlugin to enhance data handling and security.
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* feat: refactor: Update logging level from debug to info for temp file operations in PvcScenarioPlugin to improve visibility of command execution.
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Add unit tests for PvcScenarioPlugin methods and enhance test coverage
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Add missed lines test cov
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor tests in test_pvc_scenario_plugin.py to use unittest framework and enhance test coverage for to_kbytes method
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Enhance rollback_temp_file test to verify logging of errors for invalid data
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor tests in TestPvcScenarioPluginRun to clarify pod_name behavior and enhance logging verification in rollback_temp_file tests
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactored imports
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor assertions in test cases to use assertEqual for consistency
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
---------
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
* Add rollback functionality to ServiceHijackingScenarioPlugin
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Refactor rollback data handling in ServiceHijackingScenarioPlugin as json string
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Update rollback data handling in ServiceHijackingScenarioPlugin to decode directly from resource_identifier
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Add import statement for JSON handling in ServiceHijackingScenarioPlugin
This change introduces an import statement for the JSON module to facilitate the decoding of rollback data from the resource identifier.
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* feat: Enhance rollback data handling in ServiceHijackingScenarioPlugin by encoding and decoding as base64 strings.
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Add rollback tests for ServiceHijackingScenarioPlugin
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor rollback tests for ServiceHijackingScenarioPlugin to improve error logging and remove temporary path dependency
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Remove redundant import of yaml in test_service_hijacking_scenario_plugin.py
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor rollback tests for ServiceHijackingScenarioPlugin to enhance readability and consistency
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
---------
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
* Kubevirt VM outage tests with improved mocking and validation scenarios at test_kubevirt_vm_outage.py
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor Kubevirt VM outage tests to improve time mocking and response handling
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Remove unused subproject reference for pvc_outage
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor Kubevirt VM outage tests to enhance time mocking and improve response handling
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Enhance VMI deletion test by mocking unchanged creationTimestamp to exercise timeout path
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor Kubevirt VM outage tests to use dynamic timestamps and improve mock handling
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
---------
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
Co-authored-by: Tullio Sebastiani <tsebastiani@users.noreply.github.com>
Functional & Unit Tests / Functional & Unit Tests (push) Failing after 10m3s
Functional & Unit Tests / Generate Coverage Badge (push) Has been skipped
* Add rollback functionality to SynFloodScenarioPlugin
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Refactor rollback pod handling in SynFloodScenarioPlugin to handle podnames as string
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Update resource identifier handling in SynFloodScenarioPlugin to use list format for rollback functionality
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Refactor chaos scenario configurations in config.yaml to comment out existing scenarios for clarity. Update rollback method in SynFloodScenarioPlugin to improve pod cleanup handling. Modify pvc_scenario.yaml with specific test values for better usability.
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
* Enhance rollback functionality in SynFloodScenarioPlugin by encoding pod names in base64 format for improved data handling.
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Add unit tests for SynFloodScenarioPlugin methods and rollback functionality
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor TestSynFloodRun and TestRollbackSynFloodPods to inherit from unittest.TestCase
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
* Refactor SynFloodRun tests to use tempfile for scenario file creation and improve error logging in rollback functionality
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>
---------
Signed-off-by: sanjay7178 <saisanjay7660@gmail.com>
Signed-off-by: Sai Sanjay <saisanjay7660@gmail.com>