kubernetes/test/cmd
2023-02-21 17:43:03 -06:00
..
apply.sh Ignore api-resources not found error until it's ready 2022-12-21 10:34:53 +03:00
apps.sh Update shellcheck version (0.7.2 -> 0.8.0) and fix findings 2022-11-08 11:53:57 +01:00
authentication.sh
authorization.sh
batch.sh Update shellcheck version (0.7.2 -> 0.8.0) and fix findings 2022-11-08 11:53:57 +01:00
certificate.sh
convert.sh
core.sh kubectl scale: Add dry-run prefix to indicate result is not applied 2022-12-02 16:27:18 +03:00
crd.sh Update shellcheck version (0.7.2 -> 0.8.0) and fix findings 2022-11-08 11:53:57 +01:00
create.sh
debug.sh add integration tests for debug profiles general & baseline 2023-02-21 17:43:03 -06:00
delete.sh
diff.sh Re-enable label selector 2023-02-20 09:10:51 +03:00
discovery.sh minor integration test fixes and more singular resource 2022-11-18 13:11:16 +03:00
events.sh Merge pull request #113541 from oscr/update-shellcheck-0.8.0 2022-11-12 02:23:57 -08:00
exec.sh kubectl exec: return descriptive error message when multi resource passed 2022-12-02 14:05:11 +03:00
generic-resources.sh tests: adding integration test for rollout status 2022-04-21 11:21:13 -04:00
get.sh Ignore api-resources not found error until it's ready 2022-12-21 10:34:53 +03:00
help.sh i18n: Fix bug where package-level variables are not translated. 2022-11-29 23:09:57 -05:00
kubeconfig.sh
legacy-script.sh add integration tests for debug profiles general & baseline 2023-02-21 17:43:03 -06:00
node-management.sh Update shellcheck version (0.7.2 -> 0.8.0) and fix findings 2022-11-08 11:53:57 +01:00
OWNERS
plugins.sh
proxy.sh
rbac.sh
README.md
request-timeout.sh
results.sh
run.sh
save-config.sh
storage.sh
template-output.sh
version.sh
wait.sh flaky test wait.sh: Add deployment assertion before running wait 2023-02-07 14:19:34 +03:00

Kubernetes Command-Line Integration Test Suite

This document describes how you can use the Kubernetes command-line integration test-suite.

Running Tests

All Tests

To run this entire suite, execute make test-cmd from the top level. This will import each file containing tests functions

Specific Tests

To run a subset of tests (e.g. run_deployment_tests and run_impersonation_tests), execute make test-cmd WHAT="deployment impersonation". Running specific tests will not try and validate any required resources are available on the server.

Adding Tests

Test functions need to have the format run_*_tests so they can be executed individually. Once a test has been added, insert a section in legacy-script.sh like

######################
# Replica Sets       #
######################

if kube::test::if_supports_resource "${replicasets}" ; then
    record_command run_rs_tests
fi

Be sure to validate any supported resources required for the test by using the kube::test::if_supports_resource function.

New File

If the test resides in a new file, source the file in the top of the legacy-script.sh file by adding a new line in

source "${KUBE_ROOT}/test/cmd/apply.sh"
source "${KUBE_ROOT}/test/cmd/apps.sh"
source "${KUBE_ROOT}/test/cmd/authorization.sh"
source "${KUBE_ROOT}/test/cmd/batch.sh"
...

Please keep the order of the source list alphabetical.