Files
mtusi2026lab2/evidence/student_tests.txt

44 lines
1.8 KiB
Plaintext

# date: 2026-10-08T21:04:47Z
$ make test-student
== own_tests.py
ok - malformed JSON -> 400 invalid_request
ok - foreign chat access -> 404 (no leak)
ok - empty/whitespace message text -> 400
ok - duplicate username -> 409, original user intact
ok - multi-page pagination traversal: 4 pages, 7 messages, no dup/loss
ok - cursor from another chat -> 400 (cursor is bound to its resource)
PASS: 6/6 student checks
== concurrency_test.py
PASS: 100 unique messages written and read back from 10 concurrent clients
== auth_test.py
ok - wrong password / unknown user -> identical 401 Basic
ok - missing / malformed / non-Basic login -> 401
ok - UTF-8 password containing ':' -> 201
ok - password shorter than 12 / missing -> 400
ok - Basic / X-User-Id / unknown token on business endpoint -> 401
ok - logout revokes only the current token; repeat logout -> 401
ok - session with TTL=2s is rejected after 3s (cache entry included)
PASS: 7 checks
== db_integrity_test.py
ok - 20 concurrent registrations of one username -> 1x201, 19x409, 1 row
ok - chat with unknown member -> 400 and transaction rolled back (no orphan chat)
ok - password stored as $argon2id$..., sessions keep only sha256(token)
ok - migrations run twice more: schema_migrations and data unchanged (1:113)
PASS: 4 checks
== dependency_test.py
ok - Valkey caches sessions with TTL<=300s and keeps logout tombstones
ok - Valkey stopped: ready=200, reads/writes OK, revoked token 401, 3 ms/request
ok - PostgreSQL stopped: live=200, ready/business=503 in 0.0s total, unverified token not trusted
ok - PostgreSQL started again: API recovers without restart, data intact
PASS: 4 checks
== sigterm_test.sh
api stopped in 1s, exit code 0 (0 = graceful, 137 = SIGKILL)
PASS: graceful SIGTERM shutdown, api restarted
ALL STUDENT TESTS PASSED