Proof of concept.
Record and replay socket traffic to mock socket connection
- start mysql server on
127.0.0.1:3306 - start
record.pyto record traffic - connect to
record.pyon127.0.0.1:3307by usingtest/test-mysql.py record.pycapture and proxy all traffic from127.0.0.1:3307to127.0.0.1:3306- each time after client socket is closed
record.pydumps traffic todump.bin(override file) - stop
record.py
Traffic is recorded, and we can replay it using same flow but instead of
record.py we use replay.py.
We don't need mysql server this time - replay.py receive traffic
from test/test-mysql.py and replies with traffic from dump.bin
- start
replay.pyto replay traffic replay.pyreadsdump.bin- connect to
replay.pyon127.0.0.1:3307by usingtest/test-mysql.py - traffic is replied - no exception is thrown
- stop
replay.py
- add ability to specify configuration file
- test on different sockets instead of only mysql socket