client/servlet/test/src/webservice/tests/t3.sh

Code
Comments
Other
Rev Date Author Line
3486 16 Nov 09 gregory 1 # Create and upload file content
3486 16 Nov 09 gregory 2 generate_name
3486 16 Nov 09 gregory 3 echo "Name" > $A
3486 16 Nov 09 gregory 4 echo "$name" >> $A
3486 16 Nov 09 gregory 5 PUT "$A" "$resource/files?$auth" 
3486 16 Nov 09 gregory 6 GET "$B" "$resource/files?$auth&select=Id&whereName==$name"
3486 16 Nov 09 gregory 7 lastid=`tail -n 1 $B | perl -ane '/(\d+)/; print \$1;'`
3486 16 Nov 09 gregory 8 text="Hello"
3486 16 Nov 09 gregory 9 echo $text > $C
3486 16 Nov 09 gregory 10 PUT "$C" "$resource/files/$lastid?$auth"
3486 16 Nov 09 gregory 11 GET "$D" "$resource/files/$lastid?$auth"
3486 16 Nov 09 gregory 12 diff=`diff $C $D`
3486 16 Nov 09 gregory 13 if [ "$diff" != "" ]; then
3486 16 Nov 09 gregory 14   fail "$test" "Content of files is not the same after download. Compare $C and $D"
3486 16 Nov 09 gregory 15 fi
3486 16 Nov 09 gregory 16 # $Id$