Integration tests with API key

This commit is contained in:
Jakob Borg
2014-06-05 11:48:22 +02:00
parent e5d16ed08a
commit f0612e57c2
5 changed files with 95 additions and 86 deletions

View File

@@ -20,7 +20,7 @@ start() {
stop() {
echo "Stopping..."
for i in 1 2 ; do
curl -X POST "http://localhost:808$i/rest/shutdown"
curl -HX-API-Key:abc123 -X POST "http://localhost:808$i/rest/shutdown"
done
}
@@ -39,8 +39,8 @@ setup() {
testConvergence() {
while true ; do
sleep 5
s1comp=$(curl -s "http://localhost:8082/rest/connections" | ./json "$id1/Completion")
s2comp=$(curl -s "http://localhost:8081/rest/connections" | ./json "$id2/Completion")
s1comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8082/rest/connections" | ./json "$id1/Completion")
s2comp=$(curl -HX-API-Key:abc123 -s "http://localhost:8081/rest/connections" | ./json "$id2/Completion")
s1comp=${s1comp:-0}
s2comp=${s2comp:-0}
tot=$(($s1comp + $s2comp))