Skip to content

Files

This branch is 1267 commits behind kubernetes/kubernetes:master.

cmd

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 14, 2022
Feb 3, 2022
Oct 2, 2024
Nov 8, 2022
May 2, 2023
Mar 7, 2022
Nov 5, 2021
Nov 8, 2022
Apr 21, 2021
Feb 22, 2021
May 24, 2024
Dec 15, 2023
Jun 13, 2022
Jun 5, 2024
Sep 5, 2023
May 24, 2024
May 21, 2024
Sep 1, 2023
Jun 21, 2024
Apr 21, 2022
Jan 27, 2025
May 26, 2023
Mar 1, 2024
Feb 11, 2025
Feb 11, 2025
Jan 27, 2025
Oct 23, 2023
Mar 25, 2021
May 23, 2022
Oct 16, 2024
Jan 11, 2022
Feb 13, 2020
Nov 9, 2021
May 23, 2022
Sep 20, 2022
Nov 4, 2023
Dec 12, 2024

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.