|
@@ -3,10 +3,12 @@
|
3
|
3
|
host=$1
|
4
|
4
|
instance=$2
|
5
|
5
|
N=$3
|
6
|
|
-HOSTDB=localhost:27017
|
|
6
|
+HOSTDB=localhost
|
7
|
7
|
|
8
|
|
-for i in ${1..$N..10)
|
|
8
|
+M=$(expr $N / 10)
|
|
9
|
+for i in `eval echo {1..$M}`;
|
9
|
10
|
do
|
|
11
|
+ COLPUBLI=""
|
10
|
12
|
COLT=$(lenmax=100;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
11
|
13
|
curl -A "Mozilla/5.0" -L -s -d "field_input_title=$COLT&field_input_publications=$COLPUBLI&classname=Collection" http://$host/$instance/admin/create?classname=Collection
|
12
|
14
|
ITTHM="themetest"
|
|
@@ -21,65 +23,67 @@ do
|
21
|
23
|
curl -A "Mozilla/5.0" -L -s -d "field_input_lastname=$LN&field_input_firstname=$FN&field_input_password=$PWD&field_input_login=$LOGIN&classname=User" http://$host/$instance/admin/create?classname=User
|
22
|
24
|
done
|
23
|
25
|
|
24
|
|
-for i in ${1..$N..4)
|
|
26
|
+M=$(expr $N / 4)
|
|
27
|
+for i in `eval echo {1..$M}`;
|
25
|
28
|
do
|
26
|
|
- persons=$(printf "use lodel2\ndb.Person.find\({}, {lodel_id:1, _id:0}\).limit\(3\)" | mongo HOSTDB/admin -u lodel_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed '\$d')
|
|
29
|
+ persons=$(printf "use lodel2_$instance\n db.Person.find({}, {lodel_id:1, _id:0}).limit(3)" | mongo $HOSTDB/admin -u lodel2_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
|
27
|
30
|
tmp=""
|
28
|
31
|
for i in $persons
|
29
|
32
|
do
|
30
|
|
- if [ $tmp = "" ]
|
|
33
|
+ if [[ ! -z $tmp ]]
|
31
|
34
|
then
|
32
|
|
- tmp=$(printf("$tmp, $i"))
|
|
35
|
+ tmp=$(printf "$tmp, $i")
|
33
|
36
|
else
|
34
|
37
|
tmp=$i
|
35
|
38
|
fi
|
36
|
39
|
done
|
37
|
40
|
SECLP=$tmp
|
38
|
|
- SECST=$(lenmax=120;wcount=10; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
39
|
|
- res=$(printf "use lodel2\ndb.Indextheme.find\({}, {lodel_id:1, _id:0}\).limit\(5\)" | mongo HOSTDB/admin -u lodel_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed '\$d')
|
|
41
|
+ SECST=$(lenmax=60;wcount=10; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
|
42
|
+ res=$(printf "use lodel2_$instance\n db.Indextheme.find({}, {lodel_id:1, _id:0}).limit(5)" | mongo $HOSTDB/admin -u lodel2_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
|
40
|
43
|
tmp=""
|
41
|
44
|
for i in $res
|
42
|
45
|
do
|
43
|
|
- if [ $tmp = "" ]
|
|
46
|
+ if [[ ! -z $tmp ]]
|
44
|
47
|
then
|
45
|
|
- tmp=$(printf("$tmp, $i"))
|
|
48
|
+ tmp=$(printf "$tmp, $i")
|
46
|
49
|
else
|
47
|
50
|
tmp=$i
|
48
|
51
|
fi
|
|
52
|
+ done
|
49
|
53
|
SECIND=$tmp
|
50
|
|
- SECTTL=$(lenmax=100;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
|
54
|
+ SECTTL=$(lenmax=60;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
51
|
55
|
curl -A "Mozilla/5.0" -L -s -d "field_input_linked_persons=$SECLP&field_input_subtitle=$SECST&field_input_indexes=$SECIND&field_input_title=$SECTTL&classname=Section" http://$host/$instance/admin/create?classname=Section
|
52
|
56
|
done
|
53
|
57
|
|
54
|
|
-for i in ${seq $N}
|
|
58
|
+for i in `eval echo {1..$N}`;
|
55
|
59
|
do
|
56
|
|
- persons=$(printf "use lodel2\ndb.Person.find\({}, {lodel_id:1, _id:0}\).limit\(3\)" | mongo HOSTDB/admin -u lodel_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed '\$d')
|
|
60
|
+ persons=$(printf "use lodel2_$instance\n db.Person.find({}, {lodel_id:1, _id:0}).limit(3)" | mongo $HOSTDB/admin -u lodel2_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
|
57
|
61
|
for i in $persons
|
58
|
62
|
do
|
59
|
|
- if [ $tmp = "" ]
|
|
63
|
+ if [[ ! -z $tmp ]]
|
60
|
64
|
then
|
61
|
|
- tmp=$(printf("$tmp, $i"))
|
|
65
|
+ tmp=$(printf "$tmp, $i")
|
62
|
66
|
else
|
63
|
67
|
tmp=$i
|
64
|
68
|
fi
|
65
|
69
|
done
|
66
|
70
|
SSSECLP=$tmp
|
67
|
|
- SSSECST=$(lenmax=120;wcount=10; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
68
|
|
- res=$(printf "use lodel2\ndb.Section.find\({}, {lodel_id:1, _id:0}\).limit\(1\)" | mongo HOSTDB/admin -u lodel_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed '\$d')
|
|
71
|
+ SSSECST=$(lenmax=60;wcount=10; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
|
72
|
+ res=$(printf "use lodel2_$instance\n db.Section.find({}, {lodel_id:1, _id:0}).limit(1)" | mongo $HOSTDB/admin -u lodel2_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
|
69
|
73
|
SSSECPAR=$res
|
70
|
|
- res=$(printf "use lodel2\ndb.Indextheme.find\({}, {lodel_id:1, _id:0}\).limit\(3\)" | mongo HOSTDB/admin -u lodel_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed '\$d')
|
|
74
|
+ res=$(printf "use lodel2_$instance\n db.Indextheme.find({}, {lodel_id:1, _id:0}).limit(3)" | mongo $HOSTDB/admin -u lodel2_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
|
71
|
75
|
tmp=""
|
72
|
76
|
for i in $res
|
73
|
77
|
do
|
74
|
|
- if [ $tmp = "" ]
|
|
78
|
+ if [[ ! -z $tmp ]]
|
75
|
79
|
then
|
76
|
|
- tmp=$(printf("$tmp, $i"))
|
|
80
|
+ tmp=$(printf "$tmp, $i")
|
77
|
81
|
else
|
78
|
82
|
tmp=$i
|
79
|
83
|
fi
|
80
|
84
|
SSSECIND=$tmp
|
81
|
|
- SSSECTTL=$(lenmax=100;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
82
|
|
- res=$(printf "use lodel2\ndb.Collection.find\({}, {lodel_id:1, _id:0}\).limit\(1\)" | mongo HOSTDB/admin -u lodel_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed '\$d')
|
|
85
|
+ SSSECTTL=$(lenmax=60;wcount=5; rlenmax=$(expr $lenmax - 1); echo $(shuf /usr/share/dict/words | head -n $wcount | tr -s "\n" " ") | sed -E "s/^(.{$rlenmax}).*$/\1/")
|
|
86
|
+ res=$(printf "use lodel2_$instance\n db.Collection.find({}, {lodel_id:1, _id:0}).limit\(1\)" | mongo $HOSTDB/admin -u lodel2_admin -p lapwd | sed "1,3d" | sed -e "s/{ \"lodel_id\" : //g" | sed -e "s/ }//g" | sed "\$d")
|
83
|
87
|
PUBCOLLS=$res
|
84
|
88
|
curl -A "Mozilla/5.0" -L -s -d "field_input_linked_persons=$SSSECLP&field_input_subtitle=$SSSECST&field_input_parent=$SSSECPAR&field_input_indexes=$SSSECIND&field_input_title=$SSSECTTL&classname=Subsection" http://$host/$instance/admin/create?classname=Subsection
|
85
|
89
|
curl -A "Mozilla/5.0" -L -s -d "field_input_collection=$PUBCOLLS&classname=Publication" http://$host/$instance/admin/create?classname=Publication
|