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

Code
Comments
Other
Rev Date Author Line
3486 16 Nov 09 gregory 1 # Modify file name
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 curlit "-s -o $C -d" "$auth&Name=renamed_$name" "$resource/files/$lastid"
3486 16 Nov 09 gregory 9 GET "$D" "$resource/files?$auth&select=Name&whereName==renamed_$name"
3486 16 Nov 09 gregory 10 dos2unix -q $D
3486 16 Nov 09 gregory 11 echo "Name" > $E
3486 16 Nov 09 gregory 12 echo "renamed_$name" >> $E
3486 16 Nov 09 gregory 13 result=`diff $D $E`
3486 16 Nov 09 gregory 14 if [ "$result" != "" ]; then
3486 16 Nov 09 gregory 15         fail "$test" "File $name should have been renamed to renamed_$name"
3486 16 Nov 09 gregory 16 fi
3486 16 Nov 09 gregory 17 # $Id$