Skip to content

feat: Add OCP-to-OCP ClusterRole migration tests #304

Description

@AmenB

Summary

Add migration tests that validate OCP-to-OCP (same cluster, namespace-to-namespace) migration using the forklift-migrator-role ClusterRole without SCC binding.

Problem / Motivation

Unlike vSphere/RHV→OCP migrations which fail without the forklift-controller-scc binding, OCP-to-OCP migrations should succeed without SCC because they don't use virt-v2v pods that require elevated privileges. We currently lack test coverage for this scenario.

Requirements

  • Tests must coexist with existing ClusterRole tests in regression runs (vSphere source + OCP source)
  • Must NOT modify existing fixtures (source_provider, prepared_plan, etc.)
  • Source provider: alias of destination_ocp_provider (admin OCP, same cluster)
  • Destination provider: clusterrole_destination_ocp_provider (token-based, limited permissions)
  • Source VMs: created via create_source_cnv_vms() in a dedicated source namespace

Behavioral Validation

Source Destination SCC? Expected
vSphere ClusterRole OCP No FAIL (existing test)
vSphere ClusterRole OCP Yes PASS (existing test)
OCP ClusterRole OCP No PASS (new test)

Deliverables

  • ocp_source_provider session fixture (alias of destination_ocp_provider)
  • ocp_source_provider_inventory session fixture (ForkliftInventory for OCP source)
  • ocp_prepared_plan class fixture (creates CNV VMs in source namespace, enriches plan)
  • Config entries in tests/tests_config/config.py for cold and warm
  • TestClusterroleOcpToOcpColdMigration test class (5-step, expects success)
  • TestClusterroleOcpToOcpWarmMigration test class (5-step, expects success)
  • Code review passed
  • Pre-commit passed

Notes

  • The OCP source provider reuses the existing destination_ocp_provider since migrations are same-cluster (namespace-to-namespace).
  • Source CNV VMs should be created in a dedicated namespace to avoid conflicts with other tests.
  • Both cold and warm migration paths need coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions