лаба на 4
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
Waiting for API readiness before testing...
|
||||
Creating a test user and session...
|
||||
Test session created.
|
||||
|
||||
Checking baseline...
|
||||
PASS: /health/live returned 200 in 0.001683s
|
||||
PASS: /health/ready returned 200 in 0.003160s
|
||||
PASS: /api/v1/users/me returned 200 in 0.002653s
|
||||
|
||||
=== Redis failure ===
|
||||
Container mtusi2026lab2-redis-1 Stopping
|
||||
Container mtusi2026lab2-redis-1 Stopped
|
||||
PASS: /health/live returned 200 in 0.001606s
|
||||
PASS: /health/ready returned 503 in 4.006407s
|
||||
PASS: /api/v1/users/me returned 503 in 4.006094s
|
||||
Restarting Redis...
|
||||
Container mtusi2026lab2-redis-1 Starting
|
||||
Container mtusi2026lab2-redis-1 Started
|
||||
PASS: /health/ready returned 200 in 0.002260s
|
||||
PASS: /api/v1/users/me returned 200 in 0.002382s
|
||||
|
||||
=== PostgreSQL failure ===
|
||||
Container mtusi2026lab2-postgres-1 Stopping
|
||||
Container mtusi2026lab2-postgres-1 Stopped
|
||||
PASS: /health/live returned 200 in 0.001882s
|
||||
PASS: /health/ready returned 503 in 4.007958s
|
||||
PASS: /api/v1/users/me returned 503 in 4.006373s
|
||||
Restarting PostgreSQL...
|
||||
Container mtusi2026lab2-postgres-1 Starting
|
||||
Container mtusi2026lab2-postgres-1 Started
|
||||
PASS: /health/ready returned 200 in 0.002324s
|
||||
PASS: /api/v1/users/me returned 200 in 0.012524s
|
||||
|
||||
PASS: dependency failure and recovery tests completed.
|
||||
Restoring PostgreSQL and Redis...
|
||||
Container mtusi2026lab2-postgres-1 Running
|
||||
Container mtusi2026lab2-redis-1 Running
|
||||
Waiting for API readiness...
|
||||
Services restored.
|
||||
@@ -0,0 +1,22 @@
|
||||
=== make check ===
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
|
||||
=== make validate ===
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
|
||||
=== make test ===
|
||||
python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
|
||||
=== test_auth ===
|
||||
PASS: wrong password returned 401; valid session worked; logout revoked the token.
|
||||
|
||||
=== test_race ===
|
||||
PASS: concurrent registration produced exactly one 201 and one 409.
|
||||
|
||||
=== test_rollback ===
|
||||
Container mtusi2026lab2-api-run-8eb3c54add45 Creating
|
||||
Container mtusi2026lab2-api-run-8eb3c54add45 Created
|
||||
PASS: failed compound transaction rolled back chat and membership inserts.
|
||||
@@ -0,0 +1,66 @@
|
||||
=== persistence ===
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
|
||||
=== short TTL ===
|
||||
Starting API with SESSION_TTL_SECONDS=2...
|
||||
Container mtusi2026lab2-api-1 Recreate
|
||||
Container mtusi2026lab2-api-1 Recreated
|
||||
Container mtusi2026lab2-api-1 Starting
|
||||
Container mtusi2026lab2-api-1 Started
|
||||
Checking API configuration...
|
||||
Waiting for API readiness...
|
||||
Running short TTL test...
|
||||
PASS: token works immediately after login.
|
||||
PASS: expired token returned 401.
|
||||
PASS: short session TTL test completed.
|
||||
Restoring API with SESSION_TTL_SECONDS=3600...
|
||||
Container mtusi2026lab2-api-1 Recreate
|
||||
Container mtusi2026lab2-api-1 Recreated
|
||||
Container mtusi2026lab2-api-1 Starting
|
||||
Container mtusi2026lab2-api-1 Started
|
||||
|
||||
=== dependency failures ===
|
||||
Waiting for API readiness before testing...
|
||||
Creating a test user and session...
|
||||
Test session created.
|
||||
|
||||
Checking baseline...
|
||||
PASS: /health/live returned 200 in 0.002339s
|
||||
PASS: /health/ready returned 200 in 0.003825s
|
||||
PASS: /api/v1/users/me returned 200 in 0.004731s
|
||||
|
||||
=== Redis failure ===
|
||||
Container mtusi2026lab2-redis-1 Stopping
|
||||
Container mtusi2026lab2-redis-1 Stopped
|
||||
PASS: /health/live returned 200 in 0.002183s
|
||||
PASS: /health/ready returned 503 in 4.007097s
|
||||
PASS: /api/v1/users/me returned 503 in 8.000377s
|
||||
Restarting Redis...
|
||||
Container mtusi2026lab2-redis-1 Starting
|
||||
Container mtusi2026lab2-redis-1 Started
|
||||
PASS: /health/ready returned 200 in 0.002200s
|
||||
PASS: /api/v1/users/me returned 200 in 0.003519s
|
||||
|
||||
=== PostgreSQL failure ===
|
||||
Container mtusi2026lab2-postgres-1 Stopping
|
||||
Container mtusi2026lab2-postgres-1 Stopped
|
||||
PASS: /health/live returned 200 in 0.002847s
|
||||
PASS: /health/ready returned 503 in 4.006891s
|
||||
PASS: /api/v1/users/me returned 503 in 4.008468s
|
||||
Restarting PostgreSQL...
|
||||
Container mtusi2026lab2-postgres-1 Starting
|
||||
Container mtusi2026lab2-postgres-1 Started
|
||||
PASS: /health/ready returned 200 in 0.003164s
|
||||
PASS: /api/v1/users/me returned 200 in 0.006318s
|
||||
|
||||
PASS: dependency failure and recovery tests completed.
|
||||
Restoring PostgreSQL and Redis...
|
||||
Container mtusi2026lab2-postgres-1 Running
|
||||
Container mtusi2026lab2-redis-1 Running
|
||||
Waiting for API readiness...
|
||||
Services restored.
|
||||
|
||||
=== final readiness ===
|
||||
{"status":"ok"}
|
||||
Reference in New Issue
Block a user