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

Code
Comments
Other
Rev Date Author Line
3486 16 Nov 09 gregory 1 # External file URI http://...
3486 16 Nov 09 gregory 2 generate_name
3486 16 Nov 09 gregory 3 echo -e "Name\tUniformResourceIdentifier\tDescription" > $A 
3486 16 Nov 09 gregory 4 echo -e "web_$name\thttp://home.thep.lu.se/~gregory/hello.txt\tTest 6" >> $A
3486 16 Nov 09 gregory 5 if [ -e $B ]; then rm $B; fi 
3486 16 Nov 09 gregory 6 curlit "-s -o $B -T $A" "$resource/files?$auth"
3486 16 Nov 09 gregory 7 GET "$C" "$resource/files?$auth&select=Id&whereName==web_$name"    
3486 16 Nov 09 gregory 8 lastid=`tail -n 1 $C | perl -ane '/(\d+)/; print \$1;'`
3486 16 Nov 09 gregory 9 GET "$D" "$resource/files/$lastid?$auth"
3486 16 Nov 09 gregory 10 result=`grep hello $D`
3486 16 Nov 09 gregory 11 if [ "$result" == "" ]; then
3486 16 Nov 09 gregory 12   fail "$test" "Downloaded file does not contain the magic word 'hello'"
3486 16 Nov 09 gregory 13 fi
3486 16 Nov 09 gregory 14 # $Id$