diff options
| author | Thais Siqueira <thais.siqueira@gmail.com> | 2016-08-29 17:39:54 -0300 | 
|---|---|---|
| committer | Thais Siqueira <thais.siqueira@gmail.com> | 2016-08-29 17:39:54 -0300 | 
| commit | 840ade44e23add85fbe97b79ee249fc7c1e6adf2 (patch) | |
| tree | 855825eabe9d9befd7434363389bc38323b63aa4 | |
| parent | 6fe3b52af612062927b5d14a69f8f66d2e33635e (diff) | |
Adds script to automate load test.
| -rwxr-xr-x | service/test/reactor/concurrent_logins.sh | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/service/test/reactor/concurrent_logins.sh b/service/test/reactor/concurrent_logins.sh new file mode 100755 index 00000000..40e37d6a --- /dev/null +++ b/service/test/reactor/concurrent_logins.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +USER_PATTERN="loadtest" +PASSWORD_PATTERN="password_" +COUNT=$1 + +function curl_command { +  index=$1 +  username=$USER_PATTERN$index +  password=$PASSWORD_PATTERN$index +  curl -sIL -X POST \ +    --data "username=$username&password=$password" \ +    --cookie 'XSRF-TOKEN: blablabla' \ +    --header 'X-Requested-With: XMLHttpRequest' \ +    --header 'X-XSRF-TOKEN: blablabla' \ +    http://localhost:3333/login |\ +    grep 'HTTP' |\ +    tail -1 +} + +for index in $(seq $COUNT); do +  curl_command $index & +  sleep 1 +done +wait | 
