Description
Problem Description
This PR (#1386) adds libxcrypt-compat
to resolve MySQL SASL2 plugin library dependencies requiring libcrypt.so.1
in Python 3.12 images. To ensure this fix works properly and prevent regressions, we need a comprehensive end-to-end test that validates MySQL connectivity with SASL plain authentication.
Currently, there's a partially implemented "vibe-coded" test that attempts MySQL querying with SASL plain using testcontainers, but it needs adjustments and proper integration into the test suite.
Detailed Implementation Approach
Test Structure
- Location: Add to existing test notebooks in affected image directories (e.g.,
jupyter/datascience/ubi9-python-3.12/test/
) - Framework: Use testcontainers-python for MySQL container orchestration
- Authentication: Focus on SASL plain authentication to verify the libcrypt.so.1 dependency fix
Implementation Steps
-
Container Setup
Use testcontainers-python MySqlContainer to orchestrate MySQL instance with SASL configuration -
SASL Configuration
Configure SASL plain authentication with proper connection parameters -
Connection Testing
Test MySQL connectivity using mysql.connector with SASL plain authentication -
Library Dependency Validation
Verify libcrypt.so.1 is available for MySQL SASL2 plugins using ldd command
Integration Points
-
Test Environment Setup
- Add testcontainers-python to requirements.txt
- Configure Docker socket access in test environment
- Set up proper test isolation and cleanup
-
CI/CD Integration
- Ensure Docker daemon is available in test environment
- Add container cleanup in test teardown
- Configure timeout handling for container startup
-
Cross-Platform Testing
- Test on both x86_64 and ARM64 architectures
- Validate container compatibility across different platforms
- Handle architecture-specific MySQL image variations
Acceptance Criteria
Primary Goals
- Test successfully connects to MySQL using SASL plain authentication
- Verify libcrypt.so.1 dependency is resolved (no "not found" errors)
- Execute basic CRUD operations through the authenticated connection
- Test runs reliably in CI/CD environment
Implementation Requirements
- Add testcontainers-python dependency to affected image requirements
- Create comprehensive test covering connection, authentication, and data operations
- Implement proper error handling and meaningful failure messages
- Add container lifecycle management (startup, cleanup)
Coverage Validation
- Test covers all Python 3.12 images affected by this PR:
- jupyter/datascience/ubi9-python-3.12
- jupyter/pytorch/ubi9-python-3.12 (CUDA)
- jupyter/tensorflow/ubi9-python-3.12 (CUDA)
- jupyter/trustyai/ubi9-python-3.12
- jupyter/rocm/pytorch/ubi9-python-3.12
- runtimes/datascience/ubi9-python-3.12
- runtimes/pytorch/ubi9-python-3.12 (CUDA)
- runtimes/tensorflow/ubi9-python-3.12 (CUDA)
- runtimes/rocm-pytorch/ubi9-python-3.12
Testing Approach
- Unit tests for individual components
- Integration tests for full e2e workflow
- Performance validation for container startup times
- Error scenario testing (connection failures, authentication errors)
Implementation Notes
- Container Resource Management: Implement proper resource limits and cleanup to prevent test environment resource exhaustion
- Test Isolation: Ensure tests don't interfere with each other through proper container naming and port management
- Error Debugging: Include detailed logging and error reporting for easier troubleshooting
- Documentation: Add clear documentation for running tests locally and in CI/CD
Context and References
- Related PR: Add libxcrypt-compat to provide libcrypt.so.1 #1386 - Add libxcrypt-compat to provide libcrypt.so.1
- Root Cause: MySQL SASL2 plugin libraries requiring libcrypt.so.1 in Python 3.12 images
- Test Framework: testcontainers-python for container orchestration
- Requester: @jiridanek
This test will provide confidence that the libxcrypt-compat fix properly resolves MySQL SASL authentication issues and prevent future regressions in Python 3.12 images.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status