# Fails on missing TLS cert

cert $WORK karma
exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8091
! stdout .
cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Reading configuration file" path=karma.yaml
level=INFO msg="Version: dev"
level=INFO msg="Configured Alertmanager source" name=local cluster=local uri=https://127.0.0.1:9093 proxy=false readonly=false
level=INFO msg="Writing PID file" path=karma.pid
level=INFO msg="Initial Alertmanager collection"
level=INFO msg="Pulling latest alerts and silences from Alertmanager"
level=INFO msg="Collecting alerts and silences" alertmanager=local
level=INFO msg="GET request" uri=https://127.0.0.1:9093/metrics timeout=10s
level=ERROR msg="Request failed" error="Get \"https://127.0.0.1:9093/metrics\": dial tcp 127.0.0.1:9093: connect: connection refused" alertmanager=local uri=https://127.0.0.1:9093
level=ERROR msg="Collection failed" error="Get \"https://127.0.0.1:9093/api/v2/silences\": dial tcp 127.0.0.1:9093: connect: connection refused" alertmanager=local try=1/2
level=INFO msg="GET request" uri=https://127.0.0.1:9093/metrics timeout=10s
level=ERROR msg="Request failed" error="Get \"https://127.0.0.1:9093/metrics\": dial tcp 127.0.0.1:9093: connect: connection refused" alertmanager=local uri=https://127.0.0.1:9093
level=ERROR msg="Collection failed" error="Get \"https://127.0.0.1:9093/api/v2/silences\": dial tcp 127.0.0.1:9093: connect: connection refused" alertmanager=local try=2/2
level=INFO msg="Collection completed"
level=INFO msg="Done, starting HTTP server"
level=INFO msg="Starting HTTPS server" address=127.0.0.1:8091
level=ERROR msg="HTTPS server startup error" error="open server.notfound: no such file or directory"
level=INFO msg="Shutting down HTTP server" signal=terminated
level=INFO msg="HTTP server shut down"
level=INFO msg="Removing PID file" path=karma.pid
-- karma.yaml --
alertmanager:
  servers:
    - name: local
      uri: https://127.0.0.1:9093
      timeout: 10s
listen:
  tls:
    cert: server.notfound
    key: karma.key
