feat(loadtest): IFT Tsung smoke/mix + verification_token на стендах. Refs EventHub/EventHubBack#30
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
|
||||
<!--
|
||||
IFT smoke: register → verify → login → calendar/event.
|
||||
Требует EVENTHUB_ENV≠prod (в ответе register есть verification_token).
|
||||
Запуск: tsung -f test/tsung/eventhub_ift_smoke.xml start
|
||||
-->
|
||||
<tsung loglevel="notice" version="1.0">
|
||||
<clients>
|
||||
<client host="localhost" use_controller_vm="true" maxusers="50"/>
|
||||
</clients>
|
||||
|
||||
<servers>
|
||||
<server host="api.ift.eventhub.local" port="443" type="ssl"/>
|
||||
</servers>
|
||||
|
||||
<load>
|
||||
<arrivalphase phase="1" duration="1" unit="minute">
|
||||
<users interarrival="2" unit="second"/>
|
||||
</arrivalphase>
|
||||
</load>
|
||||
|
||||
<options>
|
||||
<option name="ssl_reuse" value="true"/>
|
||||
</options>
|
||||
|
||||
<sessions>
|
||||
<session name="ift_smoke" probability="100" type="ts_http">
|
||||
<setdynvars sourcetype="random_number" start="100000" end="9999999">
|
||||
<var name="rand_id"/>
|
||||
</setdynvars>
|
||||
<setdynvars sourcetype="random_number" start="10" end="59">
|
||||
<var name="sec"/>
|
||||
</setdynvars>
|
||||
|
||||
<request subst="true">
|
||||
<dyn_variable name="vtoken" re=""verification_token"\s*:\s*"([^"]+)"/>
|
||||
<match do="abort" when="nomatch">HTTP/1.[0-1] 20</match>
|
||||
<http url="/v1/register" method="POST" 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/1.[0-1] 20</match>
|
||||
<http url="/v1/verify" method="POST" content_type="application/json"
|
||||
contents='{"token":"%%_vtoken%%"}'/>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<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"
|
||||
contents='{"email":"lt_smoke_%%_rand_id%%@loadtest.local","password":"testpassword123"}'/>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<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"
|
||||
contents='{"title":"Smoke Cal %%_rand_id%%","confirmation":"auto"}'>
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
</request>
|
||||
<thinktime value="1"/>
|
||||
|
||||
<request subst="true">
|
||||
<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"
|
||||
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>
|
||||
</request>
|
||||
<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">
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
</request>
|
||||
</session>
|
||||
</sessions>
|
||||
</tsung>
|
||||
Reference in New Issue
Block a user