blob: f1e0b6541e6086aee50451e554ab8094a886cf80 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/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'
}
for index in $(seq $COUNT); do
curl_command $index &
PIDS="$PIDS $!"
sleep 1
done
wait $PIDS
|