deploy: extend login healthcheck to entergame

This commit is contained in:
server
2026-04-14 10:33:04 +02:00
parent d81b6fda8e
commit 2353e0fc8d
3 changed files with 48 additions and 5 deletions

View File

@@ -3,8 +3,10 @@
What it does:
- creates a temporary account in MariaDB
- runs `metin_login_smoke` against auth and channel ports
- verifies `AUTH_SUCCESS`, `EMPIRE`, and `LOGIN_SUCCESS4`
- deletes the temporary account on exit
- verifies `AUTH_SUCCESS`, `EMPIRE`, `LOGIN_SUCCESS4`, character select, and `ENTERGAME`
- creates a temporary character when the temporary account is empty
- deletes the temporary account and temporary character rows on exit
- passes the expected client version string to the smoke client
Default paths and ports are tuned for the current VPS layout. Override with env vars if needed:
- `RUN_AS_USER`

View File

@@ -13,6 +13,7 @@ fi
: "${AUTH_PORT:=11000}"
: "${CHANNEL_PORT:=11011}"
: "${SMOKE_BIN:=/home/${RUN_AS_USER}/metin/build/server-src/bin/metin_login_smoke}"
: "${CLIENT_VERSION:=1215955205}"
if [[ ! -x "${SMOKE_BIN}" ]]; then
echo "Smoke binary not found: ${SMOKE_BIN}" >&2
@@ -28,8 +29,31 @@ LOGIN="smkhc$(date +%s)"
PASSWORD="$(openssl rand -hex 6)"
SOCIAL_ID="$(date +%s%N | tail -c 14)"
EMAIL="${LOGIN}@example.invalid"
CHARACTER_NAME="c${LOGIN}"
ACCOUNT_ID=""
cleanup() {
if [[ -n "${ACCOUNT_ID}" ]]; then
mysql player >/dev/null 2>&1 <<SQL || true
CREATE TEMPORARY TABLE smoke_pids AS
SELECT id FROM player WHERE account_id = ${ACCOUNT_ID};
DELETE FROM item
WHERE owner_id IN (SELECT id FROM smoke_pids);
DELETE FROM affect
WHERE dwPID IN (SELECT id FROM smoke_pids);
DELETE FROM quest
WHERE dwPID IN (SELECT id FROM smoke_pids);
DELETE FROM player
WHERE id IN (SELECT id FROM smoke_pids);
DROP TEMPORARY TABLE smoke_pids;
SQL
fi
mysql player >/dev/null 2>&1 <<SQL || true
DELETE FROM player_index
WHERE id IN (
@@ -109,6 +133,8 @@ SQL
echo "Running login healthcheck for temporary account ${LOGIN}"
sudo -iu "${RUN_AS_USER}" env METIN_LOGIN_SMOKE_PASSWORD="${PASSWORD}" \
"${SMOKE_BIN}" "${SERVER_HOST}" "${AUTH_PORT}" "${CHANNEL_PORT}" "${LOGIN}" \
--password-env=METIN_LOGIN_SMOKE_PASSWORD
--password-env=METIN_LOGIN_SMOKE_PASSWORD \
--create-character-name="${CHARACTER_NAME}" \
--client-version="${CLIENT_VERSION}"
echo "Login healthcheck passed"