Created
June 13, 2015 03:22
-
-
Save TylerOderkirk/154ca1e762549be39f81 to your computer and use it in GitHub Desktop.
[dirt simple comms] test for https://gist.github.com/TylerOderkirk/c8510292cc86648074b5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a pty and attach it to python app's stdin/out | |
socat -ddd -ddd PTY,raw,echo=0 "EXEC:'python /home/tz/proj/dsc/stdinout_tofrom_named_pipe.py that',pty,raw,echo=0" | |
# create a second pty and attach it to python app's stdin/out | |
socat -ddd -ddd PTY,raw,echo=0 "EXEC:'python /home/tz/proj/dsc/stdinout_tofrom_named_pipe.py other',pty,raw,echo=0" | |
# write some binary data into the first pty (where '7' is what's printed by socat) | |
cat /bin/true > /dev/pts/7 | |
# read some binary data from the second pty (where '11' is what's printed by socat) | |
cat /dev/pts/11 > /tmp/out | |
# kill above cat(1) process (simply use ctrl-c for SIGINT) | |
# ensure binary data was transmitted without error | |
md5sum /bin/true /tmp/out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment