# Works in simple mode when single --alertmanager.uri flag is passed

exec sh -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1 --listen.address=127.0.0.1 --listen.port=8035 --log.requests
! stdout .
stderr 'msg="Request completed" address=127.0.0.1:[0-9]+ bytes=[0-9]+ code=200 duration=".+" method=GET path=/alerts.json'
stderr 'msg="Request completed" address=127.0.0.1:[0-9]+ bytes=[0-9]+ code=200 duration=".+" method=GET path=/alerts.json'

-- test.sh --
#!/bin/sh

while [ ! -f karma.pid ]; do sleep 1 ; done
sleep 1
curl -so /dev/null http://127.0.0.1:8035/alerts.json
curl -so /dev/null http://127.0.0.1:8035/alerts.json
cat karma.pid | xargs kill
