21 _exit "Script interrupted. Cleanup & exit ..."
24 # $1: hex formatted file to send to the server
26 ../operation.sh "sendxml|$1"
31 ../operation.sh "sendxml|$1"
34 # $1: pattern; $2: file
36 echo "Matching pattern '$1' ..."
37 cat $2 | tr '\n' ' ' | egrep "$1" >/dev/null
39 [ $? -ne 0 ] && _exit "Test failed: miss pattern !!"
59 # $1: traffic log to monitor
60 # $2: timeout (request expiration) in seconds
61 # Result: cats the message when completed
62 monitor_4_message () {
66 [ -z "$2" ] && _exit "ERROR: must provide '$FUNCNAME' timeout (second argument)"
70 # Monitor for incoming message:
71 tail -n0 -F --pid=$timerPid $1 | while read line
73 if echo $line | grep "^</message>" >/dev/null; then
74 echo "Message received"
81 if [ ! -f .msg_received ]; then
82 echo "Timeout expired"
94 trap sigint_handler SIGINT