Files
mgmt/test/shell/prometheus-2.sh
Sean Jones 610202097a test: Enable macOS shell testing
* Check and install libvirt with Homebrew

  macOS does not have apt, dnf or yum. Add checking for homebrew for
  installing libvirt.

* Use platform timeout for tests
    * Add timeout detection to test/util.sh
    * Use $timeout for shell test requiring timeout
2017-02-14 11:59:44 -05:00

17 lines
469 B
Bash
Executable File

#!/bin/bash -e
# run empty graph, with prometheus support
$timeout --kill-after=20s 15s ./mgmt run --tmp-prefix --prometheus --prometheus-listen :52637 &
pid=$!
sleep 5s # let it converge
# Check that etcd metrics are loaded
curl 127.0.0.1:52637/metrics | grep "^etcd_server_has_leader 1"
# Check that go metrics are loaded
curl 127.0.0.1:52637/metrics | grep "^go_goroutines [0-9]\+"
killall -SIGINT mgmt # send ^C to exit mgmt
wait $pid # get exit status
exit $?