ADR-013: End-to-End Testing Framework
Date
2025-03-09
Status
Accepted
Decision Makers
- Development Team
- QA Engineers
Stakeholders
- Development Team
- QA Engineers
- System Administrators
- Platform Engineers
Context
The project requires a comprehensive end-to-end testing framework to validate OpenShift installations across different environments and configurations. This includes environment setup, validation, test execution, and cleanup procedures.
Considered Options
- Manual testing procedures
- Pure automated testing frameworks (like Robot Framework)
- Custom shell-based testing framework
- Container-based testing environment
- Hybrid approach with shell scripts and automation tools
Decision
We have implemented a modular end-to-end testing framework with the following components:
- Core Test Scripts
bootstrap_env.sh
: Environment setup and dependency installationvalidate_env.sh
: Environment validation and prerequisite checksrun_e2e.sh
: Main test orchestration and executiondelete_e2e.sh
: Environment cleanup and resource removal
- Test Flow Components
- Environment validation
- Test ISO creation
- VM deployment
- Installation monitoring
- Test execution
- Environment cleanup
- Infrastructure Management
- System package installation
- OpenShift CLI tools setup
- Container runtime configuration
- Network and DNS setup
- FreeIPA integration
- KVM/libvirt management
- Testing Functions
- ISO creation and validation
- VM deployment and monitoring
- DNS configuration
- Cluster deployment validation
- Resource cleanup
Implementation Details
Test Flow
1. Environment Setup (bootstrap_env.sh)
- System package installation
- Ansible collection setup
- OpenShift CLI installation
- Container tools configuration
- SELinux setup
- Infrastructure configuration
- Registry authentication
2. Environment Validation (validate_env.sh)
- System requirements check
- Network configuration validation
- Required tools verification
- Infrastructure service status
3. Test Execution (run_e2e.sh)
- Site configuration validation
- ISO creation
- VM deployment
- Installation monitoring
- Test case execution
- Results collection
4. Cleanup (delete_e2e.sh)
- VM cleanup
- Network configuration cleanup
- Resource removal
- Environment restoration
Key Features
- Modular Design
- Separate scripts for different phases
- Reusable functions
- Clear separation of concerns
- Infrastructure Management
- Automated VM provisioning
- Network configuration
- DNS management
- Storage setup
- Validation Framework
- Comprehensive environment checks
- Clear status reporting
- Detailed error logging
- Progress monitoring
- Configuration Management
- Site configuration handling
- Cluster configuration
- Network settings
- DNS configuration
Consequences
Positive
- Automated end-to-end testing
- Consistent test environments
- Comprehensive validation
- Clear error reporting
- Modular and maintainable
- Support for different deployment scenarios
Negative
- Shell script complexity
- Environment setup overhead
- Dependency on external tools
- Platform-specific requirements
Test Cases
The framework supports testing:
- Different cluster configurations
- Various network setups
- Multiple deployment scenarios
- Infrastructure components
- Installation processes
Related ADRs
- ADR-006: Testing and Execution Environment
- ADR-007: Virtual Infrastructure Testing
- ADR-009: Testing Infrastructure and ISO Management