kubectl: add integration test for result reporting

This currently covers two cases:
- "kubectl list" (the regression from https://github.com/kubernetes/kubernetes/issues/107012)
- "kubectl get pods/no-such-pod" (no particular reason except that the output
should be deterministic)

In contrast to some other tests that check for strings inside the
output (run_deprecated_api_tests) or compare after
sorting (run_kubectl_version_tests), stdout, stderr and the return code must
match exactly.

This ensures that there is no extra, unexpected output and that the right
output stream is used.
This commit is contained in:
Patrick Ohly
2022-01-11 09:03:19 +01:00
parent a5d2d6fec3
commit 798bdab3d0
3 changed files with 118 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ source "${KUBE_ROOT}/test/cmd/plugins.sh"
source "${KUBE_ROOT}/test/cmd/proxy.sh"
source "${KUBE_ROOT}/test/cmd/rbac.sh"
source "${KUBE_ROOT}/test/cmd/request-timeout.sh"
source "${KUBE_ROOT}/test/cmd/results.sh"
source "${KUBE_ROOT}/test/cmd/run.sh"
source "${KUBE_ROOT}/test/cmd/save-config.sh"
source "${KUBE_ROOT}/test/cmd/storage.sh"
@@ -436,6 +437,12 @@ runTests() {
record_command run_kubectl_version_tests
############################
# Kubectl result reporting #
############################
record_command run_kubectl_results_tests
#######################
# kubectl config set #
#######################