File tree Expand file tree Collapse file tree 2 files changed +74
-0
lines changed Expand file tree Collapse file tree 2 files changed +74
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ CLIENTS=${CLIENTS:- 2}
3
+ COUNT=${COUNT:- 100}
4
+ OCIS_URL=${OCIS_URL:- https:// localhost: 9200}
5
+ ENDPOINT=${ENDPOINT:-/ webdav}
6
+ FOLDER=${FOLDER:- c$CLIENTS x i$COUNT files}
7
+ USER=${USER:- einstein}
8
+ PASSWORD=${PASSWORD:- relativity}
9
+ CURL_OPTS=${CURL_OPTS:- -k}
10
+
11
+ curl -X MKCOL " $OCIS_URL$ENDPOINT /$FOLDER /" -u $USER :$PASSWORD $CURL_OPTS || { echo " could not create collection '$OCIS_URL$ENDPOINT /$FOLDER /'" >&2 ; exit 1; }
12
+ for c in $( seq 1 $CLIENTS ) ;
13
+ do
14
+ {
15
+ for i in $( seq 1 $COUNT ) ;
16
+ do
17
+ curl -X PUT -d " $c ,$i " " $OCIS_URL$ENDPOINT /$FOLDER /file c$c i$i .txt" -u $USER :$PASSWORD $CURL_OPTS
18
+ done
19
+ } &
20
+ done
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ DEPTH=${DEPTH:- 3}
3
+ WIDTH=${WIDTH:- 10}
4
+ OCIS_URL=${OCIS_URL:- https:// localhost: 9200}
5
+ ENDPOINT=${ENDPOINT:-/ webdav}
6
+ FOLDER=${FOLDER:- w$WIDTH x d$DEPTH folders}
7
+ USER=${USER:- einstein}
8
+ PASSWORD=${PASSWORD:- relativity}
9
+ CURL_OPTS=${CURL_OPTS:- -k}
10
+
11
+ COUNT=0
12
+ MAX=0
13
+
14
+ calc_max ()
15
+ {
16
+ for i in $( seq 1 $2 ) ;
17
+ do {
18
+ MAX=$(( MAX + ($1 ** i) ))
19
+ }
20
+ done
21
+ }
22
+
23
+ calc_max $WIDTH $DEPTH
24
+
25
+ create_tree ()
26
+ {
27
+ if (( $2 >= 1 )) ; then
28
+ # first create w dirs
29
+ for w in $( seq 1 $1 ) ;
30
+ do {
31
+ p=" $3 /w${w} d$2 "
32
+ COUNT=$(( COUNT + 1 ))
33
+ echo " creating $COUNT /$MAX $OCIS_URL$ENDPOINT /$FOLDER$p "
34
+ curl -X MKCOL " $OCIS_URL$ENDPOINT /$FOLDER$p " -u $USER :$PASSWORD -w " %{http_code}" $CURL_OPTS || { echo " could not create collection '$OCIS_URL$ENDPOINT /$FOLDER$p '" >&2 ; exit 1; } &
35
+ create_tree $1 $(( $2 - 1 )) $p
36
+ }
37
+ done
38
+ fi
39
+ }
40
+
41
+ # creating 20/20 https://cloud.ocis.test/webdav/w20 x d1 folders/w20d1
42
+ # creating 420/400 https://cloud.ocis.test/webdav/w20 x d2 folders/w20d2/w20d1
43
+ # creating 8420/8000 https://cloud.ocis.test/webdav/w20 x d3 folders/w20d3/w20d2/w20d1
44
+
45
+ # creating 10/10 https://cloud.ocis.test/webdav/w10 x d1 folders/w10d1
46
+ # creating 110/100 https://cloud.ocis.test/webdav/w10 x d2 folders/w10d2/w10d1
47
+ # creating 1110/1000 https://cloud.ocis.test/webdav/w10 x d3 folders/w10d3/w10d2/w10d1
48
+ # creating 11110/10000 https://cloud.ocis.test/webdav/w10 x d4 folders/w10d4/w10d3/w10d2/w10d1
49
+
50
+ # w^d +
51
+
52
+ curl -X MKCOL " $OCIS_URL$ENDPOINT /$FOLDER " -u $USER :$PASSWORD -w " %{http_code}" $CURL_OPTS || { echo " could not create collection '$OCIS_URL$ENDPOINT /$FOLDER /'" >&2 ; exit 1; }
53
+
54
+ create_tree $WIDTH $DEPTH
You can’t perform that action at this time.
0 commit comments