Skip to content

Commit

Permalink
tests: add tests for diagnostics namespaced
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-elastisys committed Dec 18, 2024
1 parent 8199eb1 commit fd4cc3c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/end-to-end/general/bin-diagnostics.bats
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,23 @@ setup() {
assert_file_contains <(sops -d "${file}") "<challenge>"
assert_file_contains <(sops -d "${file}") "<event>"
}

@test "ck8s diagnostics namespaced creates diagnostics file" {
echo "If this test gets stuck here for too long, visit \"http://localhost:8000\" in your browser in case you need to authenticate" >&3
run ck8s diagnostics sc namespace ingress-nginx
assert_success

file=$(find "${CK8S_CONFIG_PATH}"/diagnostics-*.log | sort -r | head -n 1)

assert_file_exists "${file}"
assert_file_contains "${file}" '"sops":'

assert_file_contains <(sops -d "${file}") "<pods>"
assert_file_contains <(sops -d "${file}") "<top>"
assert_file_contains <(sops -d "${file}") "<deployments>"
assert_file_contains <(sops -d "${file}") "<daemonsets>"
assert_file_contains <(sops -d "${file}") "<statefulsets>"
assert_file_contains <(sops -d "${file}") "<events>"
assert_file_contains <(sops -d "${file}") "<configmaps>"
assert_file_contains <(sops -d "${file}") "<logs>"
}

0 comments on commit fd4cc3c

Please sign in to comment.