This guide provides the steps to run performance tests using Docker and OpenVPN.
- Docker installed on your machine.
- OpenVPN configuration files available.
Run the following command to execute a basic test:
docker run -e APP=Google -e FILE=googlebrowse -e STAGE_1_DUR=1m -e STAGE_1_VUS=3 ae1986694f40
Use this command to run an extended test with VPN:
docker run -e APP=Google -e FILE=googlebrowse -e STAGE_1_DUR=20m -e STAGE_1_VUS=1 -e VPN_USERNAME=freeopenvpn -e VPN_PASSWORD=180846206 --cap-add=NET_ADMIN -v /dev/net:/dev/net --network k6_bridge 08b45d28b828
To start an OpenVPN client container, execute:
docker run -it --rm --cap-add=NET_ADMIN -v /dev/net:/dev/net -v /Users/prem/Desktop/premsvmm/PerformanceTestingK6/vpnbook-openvpn-fr200:/etc/openvpn openvpn-client
If you need to run k6 with a custom network configuration, use:
docker run --rm -it --network my_network your-k6-image [K6_OPTIONS]
-
Update the package index:
apk update
-
Install OpenVPN:
apk add openvpn
-
Copy the OpenVPN configuration file into the container:
docker cp /Users/prem/Desktop/premsvmm/PerformanceTestingK6/vpnbook-openvpn-fr200/vpnbook-fr200-tcp80.ovpn d789d7ecd050:/app/
-
Start OpenVPN with the configuration file:
sudo openvpn --config vpnbook-fr200-tcp80.ovpn