Просмотр исходного кода

Added arguments to test scripts

tags/v0.6
Brice Figureau 17 лет назад
Родитель
Сommit
3f17deb45e
2 измененных файлов: 17 добавлений и 14 удалений
  1. 2
    2
      test/client.sh
  2. 15
    12
      test/stress.sh

+ 2
- 2
test/client.sh Просмотреть файл

1
 #!/bin/sh
1
 #!/bin/sh
2
-
2
+# usqge: client.sh UPLOAD_ID PROGRESS_URL
3
 cont=""
3
 cont=""
4
 while [ "$cont" != "new Object({ 'state' : 'done' })" ]
4
 while [ "$cont" != "new Object({ 'state' : 'done' })" ]
5
 do
5
 do
6
-	cont=`curl -s -H "x-progress-id: $1" http://172.16.10.67/progress | sed -e 's/[\n\r]//'`
6
+	cont=`curl -s -H "x-progress-id: $1" $2 | sed -e 's/[\n\r]//'`
7
 	echo "[$1] '$cont'"
7
 	echo "[$1] '$cont'"
8
 done
8
 done

+ 15
- 12
test/stress.sh Просмотреть файл

1
 #!/bin/sh
1
 #!/bin/sh
2
+# Usage: stress.sh UPLOAD_URL PROGRESS_URL
3
+#
4
+
2
 i=0
5
 i=0
3
 LIMIT="10k"
6
 LIMIT="10k"
4
 FILE="100"
7
 FILE="100"
10
 do
13
 do
11
 i=`expr $i + 1`
14
 i=`expr $i + 1`
12
 echo "Upload $i"
15
 echo "Upload $i"
13
-curl --limit-rate $LIMIT -F pouet=@$FILE http://172.16.10.67/upload.html?X-Progress-ID=$i &
14
-sh client.sh $i &
16
+curl --limit-rate $LIMIT -F pouet=@$FILE $1?X-Progress-ID=$i &
17
+sh client.sh $i $2 &
15
 i=`expr $i + 1`
18
 i=`expr $i + 1`
16
 echo "Upload $i"
19
 echo "Upload $i"
17
-curl --limit-rate $LIMIT -F pouet=@$FILE http://172.16.10.67/upload.html?X-Progress-ID=$i &
18
-sh client.sh $i &
20
+curl --limit-rate $LIMIT -F pouet=@$FILE $1?X-Progress-ID=$i &
21
+sh client.sh $i $2 &
19
 i=`expr $i + 1`
22
 i=`expr $i + 1`
20
 echo "Upload $i"
23
 echo "Upload $i"
21
-curl --limit-rate $LIMIT -F pouet=@$FILE http://172.16.10.67/upload.html?X-Progress-ID=$i &
22
-sh client.sh $i &
24
+curl --limit-rate $LIMIT -F pouet=@$FILE $1?X-Progress-ID=$i &
25
+sh client.sh $i $2 &
23
 i=`expr $i + 1`
26
 i=`expr $i + 1`
24
 echo "Upload $i"
27
 echo "Upload $i"
25
-curl --limit-rate $LIMIT -F pouet=@$FILE http://172.16.10.67/upload.html?X-Progress-ID=$i &
26
-sh client.sh $i &
28
+curl --limit-rate $LIMIT -F pouet=@$FILE $1?X-Progress-ID=$i &
29
+sh client.sh $i $2 &
27
 i=`expr $i + 1`
30
 i=`expr $i + 1`
28
 echo "Upload $i"
31
 echo "Upload $i"
29
-curl --limit-rate $LIMIT -F pouet=@$FILE http://172.16.10.67/upload.html?X-Progress-ID=$i &
30
-sh client.sh $i &
32
+curl --limit-rate $LIMIT -F pouet=@$FILE $1?X-Progress-ID=$i &
33
+sh client.sh $i $2 &
31
 i=`expr $i + 1`
34
 i=`expr $i + 1`
32
 echo "Upload $i"
35
 echo "Upload $i"
33
-curl --limit-rate $LIMIT -F pouet=@$FILE http://172.16.10.67/upload.html?X-Progress-ID=$i &
34
-sh client.sh $i &
36
+curl --limit-rate $LIMIT -F pouet=@$FILE $1?X-Progress-ID=$i &
37
+sh client.sh $i $2 &
35
 done
38
 done
36
 
39
 
37
 wait
40
 wait

Загрузка…
Отмена
Сохранить