Skip to content

Instantly share code, notes, and snippets.

@pporada-gl
Last active February 17, 2017 20:20
Show Gist options
  • Save pporada-gl/6675a003e14238df8a5f4033d26369e9 to your computer and use it in GitHub Desktop.
Save pporada-gl/6675a003e14238df8a5f4033d26369e9 to your computer and use it in GitHub Desktop.
#!/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:dan@192.168.33.246/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:phil@192.168.33.246/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