summaryrefslogtreecommitdiff
path: root/service/test/reactor/concurrent_logins.sh
diff options
context:
space:
mode:
authorThais Siqueira <thais.siqueira@gmail.com>2016-08-29 17:39:54 -0300
committerThais Siqueira <thais.siqueira@gmail.com>2016-08-29 17:39:54 -0300
commit840ade44e23add85fbe97b79ee249fc7c1e6adf2 (patch)
tree855825eabe9d9befd7434363389bc38323b63aa4 /service/test/reactor/concurrent_logins.sh
parent6fe3b52af612062927b5d14a69f8f66d2e33635e (diff)
Adds script to automate load test.
Diffstat (limited to 'service/test/reactor/concurrent_logins.sh')
-rwxr-xr-xservice/test/reactor/concurrent_logins.sh25
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