docs(loadtest): hold/stress профили и правила безопасности IFT. Refs EventHub/EventHubBack#31 [skip ci]
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
|
||||
<!--
|
||||
IFT smoke: register → admin verification-token → verify → login → calendar/event.
|
||||
Все URL абсолютные: после admin-api относительные пути иначе уезжают на тот же Host.
|
||||
Нужен test/tsung/ift-admin.csv (см. ift-admin.csv.example).
|
||||
Запуск из корня EventHubBack: tsung -f test/tsung/eventhub_ift_smoke.xml start
|
||||
-->
|
||||
@@ -40,52 +41,56 @@
|
||||
|
||||
<!-- admin login (admin-api host) -->
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<dyn_variable name="admin_token" re=""token"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="https://admin-api.ift.eventhub.local/v1/admin/login" method="POST"
|
||||
content_type="application/json"
|
||||
version="1.1" content_type="application/json"
|
||||
contents='{"email":"%%_admin_email%%","password":"%%_admin_password%%"}'/>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<dyn_variable name="user_id" re=""id"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/register" method="POST" content_type="application/json"
|
||||
<http url="https://api.ift.eventhub.local/v1/register" method="POST"
|
||||
version="1.1" content_type="application/json"
|
||||
contents='{"email":"lt_smoke_%%_rand_id%%@loadtest.local","password":"testpassword123"}'/>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<!-- GET /v1/admin/users/:id/verification-token -->
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<dyn_variable name="vtoken" re=""token"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="https://admin-api.ift.eventhub.local/v1/admin/users/%%_user_id%%/verification-token"
|
||||
method="GET">
|
||||
method="GET" version="1.1">
|
||||
<http_header name="Authorization" value="Bearer %%_admin_token%%"/>
|
||||
</http>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/verify" method="POST" content_type="application/json"
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<http url="https://api.ift.eventhub.local/v1/verify" method="POST"
|
||||
version="1.1" content_type="application/json"
|
||||
contents='{"token":"%%_vtoken%%"}'/>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<dyn_variable name="token" re=""token"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/login" method="POST" content_type="application/json"
|
||||
<http url="https://api.ift.eventhub.local/v1/login" method="POST"
|
||||
version="1.1" content_type="application/json"
|
||||
contents='{"email":"lt_smoke_%%_rand_id%%@loadtest.local","password":"testpassword123"}'/>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<dyn_variable name="calendar_id" re=""id"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/calendars" method="POST" content_type="application/json"
|
||||
<http url="https://api.ift.eventhub.local/v1/calendars" method="POST"
|
||||
version="1.1" content_type="application/json"
|
||||
contents='{"title":"Smoke Cal %%_rand_id%%","confirmation":"auto"}'>
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
@@ -93,9 +98,10 @@
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<dyn_variable name="event_id" re=""id"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/calendars/%%_calendar_id%%/events" method="POST" content_type="application/json"
|
||||
<http url="https://api.ift.eventhub.local/v1/calendars/%%_calendar_id%%/events" method="POST"
|
||||
version="1.1" content_type="application/json"
|
||||
contents='{"title":"Smoke Ev %%_rand_id%%","start_time":"2030-06-15T10:00:%%_sec%%Z","duration":60,"capacity":20}'>
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
@@ -103,8 +109,8 @@
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/events/%%_event_id%%" method="GET">
|
||||
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
||||
<http url="https://api.ift.eventhub.local/v1/events/%%_event_id%%" method="GET" version="1.1">
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
</request>
|
||||
|
||||
Reference in New Issue
Block a user