cURL
Testkube is able to run cURL commands as tests.
Default command for this executor: curl
Default arguments for this executor command: -is
See more at "Redefining the Prebuilt Executor Command and Arguments" on the Creating Test page.
Abstraction over cURL
Testkube executor provides an abstraction over cURL that allow you to create JSON-based cURL test files. They allow you to combine a cURL command with expected results:
expected_statusallows you to assert that a specific status code is returned.expected_bodyallows you to validate the body of the response.
Below is an example of how to format the test:
{
"command": [
"curl",
"https://jsonplaceholder.typicode.com/todos/1",
"-H",
"'Accept: application/json'"
],
"expected_status": "200"
}
You can also find this test in the Testkube repository: https://github.com/kubeshop/testkube/blob/main/test/curl/curl.json.
Example Test
In this example we will use the following cURL test: https://github.com/kubeshop/testkube/blob/main/test/curl/curl-smoke-test.json.
{
"command": ["curl", "https://jsonplaceholder.typicode.com/todos/1"],
"expected_status": "200"
}
Creating and Running a Test
- Dashboard
- CLI
- Custom Resource
If you prefer to use the Dashboard, just go to Tests, and click the Add a new test button. Fill in the Test Name, choose the Test Type (curl/test), and then choose Test Source.
File
For a File source, the test file is uploaded directly.

Git File
For a Git file, you need to fill in the repository details - Git repository URI (in this case https://github.com/kubeshop/testkube.git), branch (main), and the path to the cURL test in your repository (test/curl/curl-smoke-test.json). In this example, the repository is public, but in the case of private ones, you would need to additionally fill in the Git credentials.
