Browse Source

Added arguments to test scripts

tags/v0.6
Brice Figureau 17 years ago
parent
commit
3f17deb45e
2 changed files with 17 additions and 14 deletions
  1. 2
    2
      test/client.sh
  2. 15
    12
      test/stress.sh

+ 2
- 2
test/client.sh View File

@@ -1,8 +1,8 @@
1 1
 #!/bin/sh
2
-
2
+# usqge: client.sh UPLOAD_ID PROGRESS_URL
3 3
 cont=""
4 4
 while [ "$cont" != "new Object({ 'state' : 'done' })" ]
5 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 7
 	echo "[$1] '$cont'"
8 8
 done

+ 15
- 12
test/stress.sh View File

@@ -1,4 +1,7 @@
1 1
 #!/bin/sh
2
+# Usage: stress.sh UPLOAD_URL PROGRESS_URL
3
+#
4
+
2 5
 i=0
3 6
 LIMIT="10k"
4 7
 FILE="100"
@@ -10,28 +13,28 @@ for j in $(seq 5)
10 13
 do
11 14
 i=`expr $i + 1`
12 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 18
 i=`expr $i + 1`
16 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 22
 i=`expr $i + 1`
20 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 26
 i=`expr $i + 1`
24 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 30
 i=`expr $i + 1`
28 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 34
 i=`expr $i + 1`
32 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 38
 done
36 39
 
37 40
 wait

Loading…
Cancel
Save