Skip to content

Commit 82bb56c

Browse files
committed
Ability to delay response based on x-set-response-delay-ms header
Issue mendhak#24
1 parent 5613125 commit 82bb56c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ else
7373
exit 1
7474
fi
7575

76+
REQUEST_WITH_INVALID_SLEEP_MS=$(curl -o /dev/null -Ss -H "x-set-response-delay-ms: XXXX" -k https://localhost:8443/ -w '%{time_total}')
77+
if [[ $(echo "$REQUEST_WITH_INVALID_SLEEP_MS<2" | bc -l) == 1 ]]; then
78+
passed "Request with invalid response delay passed"
79+
else
80+
failed "Request with invalid response delay failed"
81+
echo $REQUEST_WITH_INVALID_SLEEP_MS
82+
exit 1
83+
fi
84+
7685
REQUEST=$(curl -s -X PUT -H "Arbitrary:Header" -d aaa=bbb http://localhost:8080/hello-world)
7786
if [ $(echo $REQUEST | jq -r '.path') == '/hello-world' ] && \
7887
[ $(echo $REQUEST | jq -r '.method') == 'PUT' ] && \

0 commit comments

Comments
 (0)