ADR-006: Testing and Execution Environment
Date
2025-03-09
Status
Accepted
Decision Makers
- OpenShift Platform Team
- Quality Engineering Team
Context
The OpenShift Agent-Based Installer Helper requires a consistent and reliable environment for:
- End-to-end testing of OpenShift installations
- System dependency management
- Infrastructure validation
- Execution consistency across different platforms
Considered Options
1. Basic Script Testing
- Pros:
- Simple implementation
- Minimal overhead
- Cons:
- Inconsistent environments
- Manual dependency management
- Limited test coverage
2. Comprehensive Testing Framework (Selected)
- Pros:
- Consistent execution environment
- Automated dependency resolution
- Comprehensive test coverage
- Infrastructure validation
- Cons:
- Additional setup complexity
- More maintenance required
- Learning curve for contributors
Decision
Implement a comprehensive testing framework with:
- Core Testing Components
e2e-tests/ ├── bootstrap_env.sh # Environment setup and dependencies ├── validate_env.sh # Environment validation ├── run_e2e.sh # Test orchestration └── delete_e2e.sh # Environment cleanup
- Infrastructure Management
hack/ ├── create-iso.sh # ISO generation ├── deploy-on-kvm.sh # VM deployment ├── watch-and-reboot-kvm-vms.sh # VM monitoring ├── configure_dns_entries.sh # DNS configuration └── deploy-freeipa.sh # Identity management
Implementation
System Dependencies
Required packages and tools:
- nmstate
- ansible-core
- bind-utils
- libguestfs
- cloud-init
- virt-install
- qemu-img
- virt-manager
- podman
- OpenShift CLI tools
Test Framework Components
- Environment Setup (bootstrap_env.sh)
- System package installation
- Ansible collection setup
- OpenShift CLI tools installation
- Container runtime configuration
- SELinux configuration
- Infrastructure setup
- Registry authentication
- Environment Validation (validate_env.sh)
- System requirements verification
- Network configuration validation
- Required tools availability
- Infrastructure service status
- Test Execution (run_e2e.sh)
- Site configuration validation
- ISO creation and validation
- VM deployment and monitoring
- Installation progress tracking
- Test case execution
- Results collection
- Environment Cleanup (delete_e2e.sh)
- VM cleanup
- Network configuration cleanup
- Resource removal
- Environment restoration
Test Flow
- Pre-execution Setup
# Bootstrap environment ./e2e-tests/bootstrap_env.sh # Validate environment ./e2e-tests/validate_env.sh
- Test Execution
# Run end-to-end tests with site config ./e2e-tests/run_e2e.sh <site_config_dir>
- Cleanup
# Clean up test environment ./e2e-tests/delete_e2e.sh
Consequences
Positive
- Automated end-to-end testing
- Consistent test environments
- Comprehensive validation
- Infrastructure management
- Clear error reporting
- Support for different deployment scenarios
Negative
- Complex setup requirements
- Resource-intensive testing
- External dependencies
- Platform-specific considerations
Test Coverage
Installation Scenarios
- Connected installations
- Disconnected installations
- Single-node deployments
- Multi-node clusters
Infrastructure Testing
- Network configuration
- Storage setup
- DNS management
- Identity integration
Validation Testing
- Environment prerequisites
- Tool availability
- Resource requirements
- Configuration validation
Related ADRs
- ADR-013: End-to-End Testing Framework
- ADR-007: Virtual Infrastructure Testing
- ADR-009: Testing Infrastructure and ISO Management