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

Code
Comments
Other
Rev Date Author Line
3486 16 Nov 09 gregory 1 # External file URI http://... with basic authentication
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 "auth_$name\thttp://demo:demo@home.thep.lu.se/~gregory/locked/hello.txt\tTest 7" >> $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==auth_$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 content=`cat $D`
3486 16 Nov 09 gregory 11 # This is wrong here, the test is incorrect
3486 16 Nov 09 gregory 12 if [ "$content" != "hello" ]; then
3486 16 Nov 09 gregory 13   fail "$test" "Downloaded file does not contain the magic word 'hello', see $D"
3486 16 Nov 09 gregory 14 fi
3486 16 Nov 09 gregory 15 # $Id$