15 _exit "Script interrupted. Cleanup & exit ..."
18 # $1: hex formatted file to send to the server
20 ../../operation.sh "sendxml|$1"
25 ../../operation.sh "sendhex|$1"
28 # $1: pattern; $2: file
30 echo "Matching pattern '$1' ..."
31 cat $2 | tr '\n' ' ' | egrep "$1" >/dev/null
33 [ $? -ne 0 ] && _exit "Test failed: miss pattern !!"
53 # $1: traffic log to monitor
54 # $2: timeout (request expiration) in seconds
55 # Result: cats the message when completed
56 monitor_4_message () {
60 [ -z "$2" ] && _exit "ERROR: must provide '$FUNCNAME' timeout (second argument)"
64 # Monitor for incoming message:
65 tail -n0 -F --pid=$timerPid $1 | while read line
67 if echo $line | grep "^</message>" >/dev/null; then
68 echo "Message received"
75 if [ ! -f .msg_received ]; then
76 echo "Timeout expired"
88 trap sigint_handler SIGINT