db-backup-s3/tests/README.md
Shakar Bakr 845507c728
Refactor test scripts and README for MSSQL backup functionality
- Updated README.md to reflect new script paths for MSSQL tests.
- Added new test scripts for Kubernetes and Docker Compose environments, including setup for MinIO.
- Introduced k8s-statefulset-test.yaml for deploying MSSQL with a backup sidecar.
- Created setup-minio-k8s.sh for automated MinIO deployment in Kubernetes.
- Enhanced test-mssql-k8s-with-minio.sh to streamline the testing process with MinIO.
- Added comprehensive test-mssql-k8s.sh for validating MSSQL backup and restore operations.
- Included test-mssql.sh for Docker Compose testing of MSSQL backup functionality.

Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com>
2025-10-23 15:11:27 +03:00

52 lines
1.3 KiB
Markdown

# Test Scripts
This directory contains automated test scripts for validating the backup and restore functionality across different environments.
## Files
### Docker Compose Tests
- **`test-mssql.sh`**: Tests MSSQL backup/restore using Docker Compose with local MinIO
### Kubernetes Tests
- **`test-mssql-k8s.sh`**: Tests MSSQL StatefulSet with backup sidecar (requires existing S3/MinIO)
- **`test-mssql-k8s-with-minio.sh`**: Complete automated test that deploys MinIO alongside MSSQL
- **`setup-minio-k8s.sh`**: Helper script to deploy MinIO in Kubernetes
- **`k8s-statefulset-test.yaml`**: Test StatefulSet configuration used by the test scripts
## Usage
### Quick Start (Recommended)
Run the complete automated test with MinIO:
```bash
./tests/test-mssql-k8s-with-minio.sh
```
This will:
- Create a test namespace (`mssql-backup-test`)
- Deploy MinIO
- Deploy MSSQL StatefulSet with backup sidecar
- Run backup and restore tests
- Verify encryption is working
### Manual Kubernetes Test
If you have an existing S3 endpoint:
```bash
NAMESPACE=mssql-backup-test \
S3_ENDPOINT=http://your-s3:9000 \
S3_ACCESS_KEY_ID=your-key \
S3_SECRET_ACCESS_KEY=your-secret \
./tests/test-mssql-k8s.sh
```
### Docker Compose Test
```bash
./tests/test-mssql.sh
```
## Cleanup
Delete the test namespace to remove all resources:
```bash
kubectl delete namespace mssql-backup-test
```