| id | linux-installation | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Linux Installation | ||||||||||
| sidebar_label | Linux | ||||||||||
| tags |
|
||||||||||
| keywords |
|
Keploy can be installed in two ways:
curl --silent -O -L https://keploy.io/install.sh && source install.shThere are two ways to use Keploy eBPF in linux, you can use either use:
- Natively in Linux.
- Through Using Docker.
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_amd64.tar.gz" | tar xz -C /tmp
sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin && keployARM Architecture
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz" | tar xz -C /tmp
sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin && keployRun this command on your terminal to start the recording of API calls:-
sudo -E keploy record -c "CMD_TO_RUN_APP"Make API Calls using Postman or cURL command.
Keploy with capture the API calls you have made to generate the test-suites which will contain the testcases and data
mocks into YAML format.
Run this command on your terminal to run the testcases and generate the test coverage report:-
sudo -E keploy test -c "CMD_TO_RUN_APP" --delay 10Voilà! 🧑🏻💻 We have the server running!
We need to create a custom network for Keploy since we are using the Docker, therefore application container would
require docker network to act as the bridge between them.
If you're using a docker-compose network, replace keploy-network with your app's docker_compose_network_name
below.
docker network create keploy-networkNow, we will record the testcases.
keploy record -c "docker run -p <appPort>:<hostPort> --name <containerName> --network keploy-network --rm <applicationImage>" --containerName "<containerName>" --delay 10Now, we will test the testcases.
keploy test -c "docker run -p <appPort>:<hostPort> --name <containerName> --network keploy-network --rm <applicationImage>" --containerName "<containerName>" --delay 20CMD_to_run_user_container is the docker command to run the application. If you are using
docker composecommand to start the application,--containerNameis required.
Voilà! 🧑🏻💻 We have the server running!
You'll be able to see the test-cases that ran with the results report on the console as well locally in the testReport
directory.
Footnote
delayis required while using Test Mode.- containerName is optional if you are using
Docker runcommand, as the Container name must be present within the command itself.