forked from mtusi2026/mtusi2026lab2
10 lines
616 B
Bash
Executable File
10 lines
616 B
Bash
Executable File
#!/bin/sh
|
||
# Проверка expiry: пересоздаёт api с SESSION_TTL_SECONDS=2, гоняет tests_student/test_expiry.py, возвращает штатный TTL.
|
||
set -eu
|
||
cd "$(dirname "$0")/.."
|
||
DC="docker compose --env-file .env"
|
||
wait_healthy() { i=0; until [ "$(docker inspect -f '{{.State.Health.Status}}' "$($DC ps -q api)")" = "healthy" ]; do i=$((i+1)); [ $i -le 60 ] || exit 1; sleep 1; done; }
|
||
trap 'SESSION_TTL_SECONDS= $DC up -d --force-recreate api >/dev/null; wait_healthy' EXIT
|
||
SESSION_TTL_SECONDS=2 $DC up -d --force-recreate api; wait_healthy
|
||
(cd tests_student && python3 test_expiry.py 2)
|