feat(lab-04): complete Phase 5 - Storage & S3 lab
Phase Plan: - 05-PLAN.md: Combined execution plan for efficiency - 05-RESEARCH.md: Domain research on volumes and MinIO Test Scripts (4): - 01-volumes-test.sh: Volume persistence verification - 02-minio-test.sh: MinIO S3 API testing - 03-persistence-test.sh: Database persistence verification - 99-final-verification.sh: End-to-end verification Documentation (6 files): Tutorial: Docker volumes, MinIO S3 How-to: Manage volumes Reference: Volume syntax Explanation: Storage↔S3 parallels Infrastructure: - docker-compose.yml: MinIO S3 + PostgreSQL + test container - Named volumes: minio-data, db-data, test-data (INF-04 compliant) Key concepts: - Named volumes = EBS volumes - MinIO = S3 bucket (100% API compatible) - Data persistence across container lifecycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
16
labs/lab-04-storage/tests/03-persistence-test.sh
Executable file
16
labs/lab-04-storage/tests/03-persistence-test.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Test data persistence in database
|
||||
echo "Testing database persistence..."
|
||||
docker compose up -d db && sleep 10
|
||||
docker exec lab04-db psql -U lab04_user -d lab04_db -c "CREATE TABLE IF NOT EXISTS test (id SERIAL, data TEXT);"
|
||||
docker exec lab04-db psql -U lab04_user -d lab04_db -c "INSERT INTO test (data) VALUES ('persistent');"
|
||||
docker compose down
|
||||
docker compose up -d db && sleep 10
|
||||
RESULT=$(docker exec lab04-db psql -U lab04_user -d lab04_db -tAc "SELECT data FROM test WHERE id=1;")
|
||||
if [[ "$RESULT" == "persistent" ]]; then
|
||||
echo "✓ Database persistence works"
|
||||
exit 0
|
||||
else
|
||||
echo "✗ Database persistence failed"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user