some scripts for testing tcpd application
This commit is contained in:
parent
b8bf2d1b44
commit
4f0f97abce
9
remote/script/testClient.sh
Executable file
9
remote/script/testClient.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/dash
|
||||
|
||||
REP=/tmp/ipc/
|
||||
SERVICE="tcpd"
|
||||
|
||||
# pid index version
|
||||
echo "connect 127.0.0.1 6000 111111 1 1" > ${REP}${SERVICE}
|
||||
|
||||
|
8
remote/script/testExit.sh
Executable file
8
remote/script/testExit.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/dash
|
||||
|
||||
REP=/tmp/ipc/
|
||||
SERVICE="tcpd"
|
||||
|
||||
# pid index version
|
||||
echo "exit" > ${REP}${SERVICE}
|
||||
|
9
remote/script/testServer.sh
Executable file
9
remote/script/testServer.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/dash
|
||||
|
||||
REP=/tmp/ipc/
|
||||
SERVICE="tcpd"
|
||||
|
||||
# pid index version
|
||||
echo "listen 127.0.0.1 6000" > ${REP}${SERVICE}
|
||||
|
||||
|
31
remote/script/testTcpd.sh
Executable file
31
remote/script/testTcpd.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/dash
|
||||
|
||||
REP=/tmp/ipc/
|
||||
SERVICE="tcpd"
|
||||
NB=5
|
||||
|
||||
if [ $# -ne 0 ]
|
||||
then
|
||||
NB=$1
|
||||
fi
|
||||
|
||||
for pid in `seq 1 ${NB}`
|
||||
do
|
||||
|
||||
# we make the application pipes
|
||||
mkfifo ${REP}${pid}-1-1-in 2>/dev/null
|
||||
mkfifo ${REP}${pid}-1-1-out 2>/dev/null
|
||||
|
||||
# pid index version
|
||||
echo "connect 127.0.0.1 6000 ${pid} 1 1" > ${REP}${SERVICE}
|
||||
|
||||
# the purpose is to send something in the pipe
|
||||
cat /dev/urandom | base64 | head -n 1 > ${REP}${pid}-1-1-out
|
||||
# echo "hello world" > ${REP}${pid}-1-out
|
||||
|
||||
sleep 2
|
||||
# the the service will answer with our message
|
||||
echo "pid : ${pid}"
|
||||
cat ${REP}/${pid}-1-1-in
|
||||
|
||||
done
|
Reference in New Issue
Block a user