4 ms·
This is something I've been working on in my spare time for a bit in preparation for a project I'm about to start at work. While there are libraries out there
by lostcolony 12y ago
This is something I've been working on in my spare time for a bit in preparation for a project I'm about to start at work.
While there are libraries out there for testing certain distribution behaviors across multiple nodes (such as Aphyr's Jepsen), and utilities/libraries that will monkey with traffic headed outwards (Crapify, Comcast, etc), I didn't see anything that gave me the control I wanted to be able to programatically drive multiple adapters, that I might make easy use of in automated testing.
I always like being able to run my tests locally, without having to rely on shared network resources. To that end, this basically lets you spin up a bunch of local adapters, and start dropping/delaying packets between them, without affecting eth0, and without affecting 127.0.0.1/localhost (so running tests shouldn't interfere with anything else, network-wise). You'll need to get some IPs not in use on the network, but everyone running the tests should be able to use those concurrently since they're not being exposed.
This lets youeasily test simple stuff (one node disappeared, and we try a write to a node, what happens?), to completely insane stuff (nodes 1 and 2 can't talk to 4 and 5, nor the reverse, everyone can talk to node 3, but 3 can't respond, and there's a 200ms delay between 4 and 5. And we try a write to a node. Or whatever), all on one box, in a repeatable, automated way.
I eventually want to expand it to work across remote interfaces, so that it can be used at load, but this is a start.
A command line hook is included; all functionality is callable from the command line through it.
- deleted 12y ago[deleted]
- felixgallo 12y agolooks really interesting, thank you!
- rdtsc 12y agoGreat work, thanks for sharing. Nice Dialyzer specs too! I see you used the tc command. It is an often forgotten gem but really useful in testing failure scenarios in networked (distributed systems). For everyone else: http://linux.die.net/man/8/tc http://linux.die.net/man/8/tc