alexei-led / pumba

Chaos testing, network emulation, and stress testing tool for containers
Apache License 2.0
2.76k stars 193 forks source link

Adding port targeting #163

Closed chuckkQ closed 4 years ago

chuckkQ commented 4 years ago

Background: this MR adds the ability to target ports for netem attacks from the CLI. This should resolve https://github.com/alexei-led/pumba/issues/130

Usage: from the CLI, you can specify a comma separated list of ingress/egress ports to target with netem attacks.

Implementation details: added CLI handlers for all the netem attacks, validation, updated tests, and added qdisc filters for the list of ports

Testing: we have run manual tests on this functionality for delay and packet loss attacks. We verified that attacks to containers still work, IP targeting alone works, IP + port targeting works, sport/dport filters behave as expected and do not block other requests