Public | Automated Build

Last pushed: a month ago
Short Description
Simple chaos monkey tests with http api.
Full Description

Simple chaos monkey tests with http api .

Basic useful feature list:

  • Command Line interface
  • HTTP API Interface to launch monkeys remote inside container.
  • Use supervisord to control monkey execution.
  • Send Logs to remote logstash server.

Monkeys avaliable:

  • Loss - Generate packet loss
  • Latency - Generate network delay.
  • Corrupt - Corrupt network packets.
  • Kill - kill process by name.

RUN Container:

docker run  -i -d --cap-add=NET_ADMIN \
--name ape-cage-v2 \
-p 6666:8081 \
-p 8080:8080 \
-e LOGSTASH_SERVER='<LOGSTASH-IP-ADDR>' \
-e LOGSTASH_PORT='6666' \
-e LOGSTASH_PROTO='tcp' \
-e APE_AUTH=<BASE64 user:pass> \
carlozleite/ape-cage

DEMO

https://vimeo.com/222723708

Spring Boot Sample Application (For test purposes)

http://127.0.0.1:8080/

TEST:

Generate packet loss:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/loss

Parameters:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/loss?ape_config=JOB_ID:TEST_19282752,TMOUT:20,LMIN:30,LMAX:50
JOB_ID: <String>

Monkey test ID.

TMOUT: <Integer>

Timeout in seconds

IFACE: <String>

Network Interface name - Default eth0

LMIN: <Integer>

Minimum percentage of packet loss

LMAX: <Integer>

Maximum percentage of packet loss

Generate Network Latency:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/latency

Parameters:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/latency?ape_config=JOB_ID:TEST_19282752,TMOUT:20,DMIN:30,DMAX:50,IFACE:eth0
JOB_ID: <String>

Monkey test ID.

TMOUT: <Integer>

Timeout in seconds

IFACE: <String>

Network Interface name - Default eth0

DMIN: <Integer>

Minimum delay in milliseconds

DMAX: <Integer>

Maximum delay in milliseconds

Generate Network Corruption:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/corrupt

Parameters:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/corrupt?ape_config=JOB_ID:TEST_19282752,TMOUT:20,CPERC:50,IFACE:eth0
JOB_ID: <String>

Monkey test ID.

TMOUT: <Integer>

Timeout in seconds

IFACE: <String>

Network Interface name - Default eth0

CPERC: <integer>

Percentage of network corruption.

Kill process by Name:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/kill

Parameters:

curl -H "Authorization: Basic <Base64-Basic-Auth>" http://127.0.0.1:6666/chaos/kill?ape_config=JOB_ID:TEST_19282752,PROC:java
JOB_ID: <String>

Monkey test ID.

PROC: <string>

Process name to kill.

COMMAND-LINE

docker exec -it <container> /ape-cage/apectl

TODO:

  • Set HTTP authentication. - OK
  • Improve background process control - OK
  • Add mora monkeys
Docker Pull Command
Owner
carlozleite
Source Repository

Comments (0)