E2E Testing Framework
Relevant source files
The following files were used as context for generating this wiki page:
The End-to-End (E2E) testing framework for Harbor Satellite is designed to validate the complete integration between Harbor, Ground Control, and the Satellite components. It ensures that the lifecycle of artifact distribution—from registration and configuration to actual image replication—works correctly in environments mimicking production setups, including those with zero-trust identity requirements.
Sources: CLAUDE.md:120-123, taskfiles/e2e.yml:18-27
Core Framework Architecture
The framework utilizes a multi-layered approach to orchestrate complex testing scenarios. It relies on Task for high-level orchestration, Docker Compose for infrastructure provisioning, and specialized shell scripts for fine-grained component initialization.
Execution Layers
| Layer | Technology | Responsibility |
|---|---|---|
| Orchestration | Task (Taskfile) | Defines high-level test suites (e2e, e2e-spiffe) and handles setup/cleanup cycles. |
| Infrastructure | Docker Compose | Deploys Harbor, Ground Control (GC), PostgreSQL, and SPIRE services. |
| Automation | Shell Scripts | Handles API interactions, token extraction, and service health verification. |
| Verification | Containerized Tools | Uses crane within containers to verify image presence in local OCI registries. |
Sources: Taskfile.yml:45-56, taskfiles/e2e.yml:29-39, scripts/e2e-test.sh:1-15
Component Interaction Flow
The following diagram illustrates the sequence of operations performed during a standard E2E test run:
Infrastructure and Setup
Tests are executed against a full stack defined in docker/e2e/docker-compose.yml. The framework ensures all components are healthy before proceeding with test logic.
Health Check Mechanisms
The framework implements polling loops to wait for service readiness. For example, Harbor is verified via the /api/v2.0/health endpoint, while Ground Control is checked via its /health or /ping endpoints.
Sources: taskfiles/e2e.yml:157-187, scripts/e2e-test.sh:32-38
Environment Configuration
The E2E tests utilize specific environment variables and default credentials to facilitate automation:
| Variable | Default Value | Source |
|---|---|---|
HARBOR_URL | http://localhost:8080 | scripts/local-test.sh |
GC_ADMIN_USER | admin | taskfiles/e2e.yml |
GC_URL | http://localhost:9080 | taskfiles/e2e.yml |
DB_PORT | 8100 | scripts/e2e-test.sh |
Sources: taskfiles/e2e.yml:4-16, scripts/local-test.sh:20-30, scripts/e2e-test.sh:47-58
SPIFFE/SPIRE Integration Testing
A specialized subset of E2E tests focuses on zero-trust identity using SPIFFE. This framework extension validates that Satellites can attest their identity and receive SVIDs (SPIFFE Verifiable Identity Documents) for secure communication.
SPIFFE Test Workflow
- CA Generation: Generates bootstrap CA certificates for the SPIRE trust domain.
- Server/Agent Setup: Starts a SPIRE server and a Ground Control SPIRE agent.
- Join Token Attestation: Generates a one-time join token via Ground Control's registration API to allow a Satellite agent to join the trust domain.
- Workload Verification: Confirms the Satellite workload is correctly registered and receives its identity.
Test Verification and Validation
The framework considers a test successful only when the desired artifact is physically present in the Satellite's local registry (Zot).
Verification Logic
The verify task in the E2E suite performs the following steps:
- Polling: Executes a loop (up to 12 attempts with 10-second intervals).
- Manifest Check: Uses
crane manifestagainst the Satellite's local registry port (8585). - Pull Verification: If the manifest exists, it performs a
crane pulland inspects the resultingmanifest.jsonto ensure data integrity.
Sources: taskfiles/e2e.yml:272-295, scripts/e2e-test.sh:137-145
Usage and Commands
Testing is primarily driven through Task commands defined in the root Taskfile.yml.
| Command | Description |
|---|---|
task e2e | Runs both standard and SPIFFE-based E2E suites. |
task e2e-test | Runs only the main Harbor-to-Satellite replication test. |
task e2e-spiffe | Runs the SPIFFE join token attestation test. |
task clean | Removes all containers, networks, and temporary config/data files. |
Sources: Taskfile.yml:45-56, Taskfile.yml:95-107
The Harbor Satellite E2E framework provides a robust automated environment for validating artifact distribution. By combining infrastructure orchestration with deep protocol verification (both OCI and SPIFFE), it ensures that edge deployments remain reliable and secure across various connectivity scenarios.