Proof of concept.
Record and replay socket traffic to mock socket connection
- start mysql server on
127.0.0.1:3306
- start
record.py
to record traffic - connect to
record.py
on127.0.0.1:3307
by usingtest/test-mysql.py
record.py
capture and proxy all traffic from127.0.0.1:3307
to127.0.0.1:3306
- each time after client socket is closed
record.py
dumps 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.py
to replay traffic replay.py
readsdump.bin
- connect to
replay.py
on127.0.0.1:3307
by 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