Skip to content

test: add AAP hook integration test (MTV-6031) - #594

Merged
krcmarik merged 3 commits into
RedHatQE:mainfrom
AmenB:feat/aap-hook-integration
Aug 7, 2026
Merged

test: add AAP hook integration test (MTV-6031)#594
krcmarik merged 3 commits into
RedHatQE:mainfrom
AmenB:feat/aap-hook-integration

Conversation

@AmenB

@AmenB AmenB commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add AAP (Ansible Automation Platform) hook integration test for MTV
  • Deploys AWX within the test suite, creates job templates from mtv-aap-test-playbooks, configures ForkliftController with AAP settings, and runs a cold migration with both PreHook and PostHook using spec.aap.jobTemplateId
  • Tier 1, vSphere only, @pytest.mark.aap

Changes

  • New: utilities/aap.py — AWX deployment (Helm) and REST API utilities
  • New: tests/hooks/conftest.py — AWX session fixtures + aap_hook_refs class fixture
  • New: tests/hooks/test_aap_hook_migration.py — 5-step migration test class
  • Modified: utilities/hooks.py — added aap_job_template_id as third mutually exclusive hook mode
  • Modified: conftest.py — added "aap" to vSphere-only skip list in pytest_collection_modifyitems
  • Modified: pytest.ini — added aap marker
  • Modified: tests/tests_config/config.py — added test config entry

Dependencies

Blocked on: openshift-python-wrapper PR #2759

The Hook class in openshift-python-wrapper needs the aap_job_template_id parameter to produce spec.aap.jobTemplateId. After PR #2759 merges and releases on PyPI, update the version pin in pyproject.toml before merging this PR.

Test results

  • AAP hook test: 5/5 passed (storagemap, networkmap, plan, migrate, check_vms)
  • Regression test: test_post_hook_retain_failed_vm — 5/5 passed (existing playbook hooks unaffected)
  • No impact on other test suites (new marker @pytest.mark.aap, vSphere-only skip)

Bug found during testing

  • MTV-6063: AAP hook migration hangs indefinitely on TLS error — no timeout, no backoff in forklift-controller

Related

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added AWX-backed Ansible Automation Platform (AAP) hooks for vSphere migrations, including pre- and post-migration actions.
    • Added an AAP migration scenario and vSphere-specific test coverage.
  • Bug Fixes
    • Improved test selection so AAP-related scenarios run only in supported vSphere environments.
    • Enforced mutually exclusive hook configuration modes with clearer validation.
  • Tests
    • Added coverage for cold migrations using AAP hooks, including migration planning and virtual machine validation.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants