Last active
February 17, 2017 20:20
-
-
Save pporada-gl/6675a003e14238df8a5f4033d26369e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bats | |
@test "Ensure uchiwa is running" { | |
run systemctl is-active uchiwa | |
[ "$status" -eq 0 ] | |
} | |
@test "Ensure uchiwa is enabled" { | |
run systemctl is-enabled uchiwa | |
[ "$status" -eq 0 ] | |
} | |
@test "Uchiwa health is ok" { | |
# There is only 1 vhost listening on port 80, so this will default to that vhost | |
set pipefail -o pipefail | |
run bash -c "curl -sLk http://dan:[email protected]/health | jq -r '.uchiwa'" | |
echo "$output" | |
set pipefail +o pipefail | |
[ "$status" -eq 0 ] | |
[[ "$output" =~ "ok" ]] | |
} | |
@test "Uchiwa can connect to sensu-api" { | |
# There is only 1 vhost listening on port 80, so this will default to that vhost | |
set pipefail -o pipefail | |
run bash -c "curl -sLk http://phil:[email protected]/health | jq -r '.sensu.GLVagrant.output'" | |
set pipefail +o pipefail | |
echo "$output" | |
[ "$status" -eq 0 ] | |
[[ "$output" =~ "ok" ]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment