3 TRACE="--trace-ascii curl_log.txt"
4 SERVER=`cat .httpServer`
8 echo "Use: $0 <test file> [time between operations: 0 second by default]"
10 echo " Batch launcher script"
11 echo " ---------------------"
13 echo " Test file must contain a operations with this syntax: <description>|<operation>|<arg1>|..."
14 echo " Three operations: code, decode and sendxml:"
16 echo " code|<source>|<target> i.e.: code|1.xml|2.hex"
17 echo " decode|<source>|<target> i.e.: decode|2.hex|1.xml-bis"
18 echo " sendxml|<source> i.e.: sendxml|1.xml"
20 echo " Test file example:"
22 echo " $0 1xml-23.txt"
24 echo " where 1xml-23.txt contains:"
25 echo " Encode 1.xml to 2.hex|code|1.xml|2.hex"
26 echo " Decode 2.hex to 3.xml (we will diff 1.xml and 3.xml)|decode|2.hex|3.xml"
29 echo " Test file could contain any number of operations and could include comments (will be ignored)."
36 [[ "$1" = "" ]] && use
39 echo "Test '$1' is going to be launched:"
43 echo "Pulse ENTER para lanzar, CTRL+C para abortar..."
48 comment=$(echo $line | grep "^#")
50 [[ "$comment" = "" ]] && { [[ "$line" != "" ]] && ok=s ; }
53 echo "Launching $(echo $line | cut -d'|' -f1) ..."
55 operation=$(echo $line | cut -d'|' -f2-)
56 curl -m 1 --data "$operation" $TRACE ${SERVER}