3486 |
16 Nov 09 |
gregory |
# Creating 10 files as quickly as possible |
3486 |
16 Nov 09 |
gregory |
2 |
for i in {1..10} |
3486 |
16 Nov 09 |
gregory |
3 |
do |
3486 |
16 Nov 09 |
gregory |
4 |
generate_name |
3486 |
16 Nov 09 |
gregory |
5 |
echo -e "Name\tDescription" > $A |
3486 |
16 Nov 09 |
gregory |
6 |
echo -e "${i}_$name\tThis is the ${i}:th file" >> $A |
3486 |
16 Nov 09 |
gregory |
7 |
PUT "$A" "$resource/files?$auth" |
3486 |
16 Nov 09 |
gregory |
8 |
GET "$B" "$resource/files?$auth&select=Id&whereName==${i}_$name" |
3486 |
16 Nov 09 |
gregory |
9 |
lastid=`tail -n 1 $B | perl -ane '/(\d+)/; print \$1;'` |
3486 |
16 Nov 09 |
gregory |
10 |
text="Hello" |
3486 |
16 Nov 09 |
gregory |
11 |
echo $text > $C |
3486 |
16 Nov 09 |
gregory |
12 |
PUT "$C" "$resource/files/$lastid?$auth" |
3486 |
16 Nov 09 |
gregory |
13 |
GET "$D" "$resource/files/$lastid?$auth" |
3486 |
16 Nov 09 |
gregory |
14 |
diff=`diff $C $D` |
3486 |
16 Nov 09 |
gregory |
15 |
if [ "$diff" != "" ]; then |
3486 |
16 Nov 09 |
gregory |
16 |
fail "$test" "Content of files is not the same after download. Compare $C and $D" |
3486 |
16 Nov 09 |
gregory |
17 |
fi |
3486 |
16 Nov 09 |
gregory |
18 |
done |
3486 |
16 Nov 09 |
gregory |
# $Id$ |