Browse Source

Added a get scenario to CBL

the get scenario produce all the get available for each instances in the site
Yann Weber 8 years ago
parent
commit
e7e393598c
1 changed files with 34 additions and 1 deletions
  1. 34
    1
      scripts/cbl.sh

+ 34
- 1
scripts/cbl.sh View File

@@ -13,7 +13,7 @@
13 13
 #
14 14
 # Scenario description :
15 15
 #
16
-# mass_creation instance_name iteration_count :
16
+# mass_creation instance_name iteration_count :
17 17
 #	Create iteration_count time a random leobject in given instance_name
18 18
 #	note : do note create relation between objects, only populate content
19 19
 #	
@@ -21,6 +21,12 @@
21 21
 # 	step 2 : loop on creation (using bash function curl_opt_create_CLSNAME)
22 22
 #		that return the POST fields (populated with random values)
23 23
 #
24
+# mass_get instance_name :
25
+#	Create all possible get for an instance
26
+#	step 1 : fetch all classes
27
+#	step 2 : for each class fetch all id
28
+#	step 3 : for all ids generate the gets
29
+#
24 30
 # mass_deletion instance_name iteration_count :
25 31
 #	Foreach non asbtracty class delete iteration_count time an object of
26 32
 #	current class in current instance
@@ -140,6 +146,32 @@ mass_creation() {
140 146
 	rm -v $cls_list_file >&2
141 147
 }
142 148
 
149
+mass_get() {
150
+	#mass get scenario
151
+	#$1 is instance name
152
+	cls_list_file=$(fetch_all_classes $1)
153
+	base_uri=$(_base_uri $1)
154
+
155
+	#Get the site root
156
+	echo "$base_uri/"
157
+	#Get the site class list
158
+	echo "$base_uri/list_classes"
159
+
160
+	for clsname in $(cat $cls_list_file)
161
+	do
162
+		#Get instances list for a class
163
+		echo "$base_uri/show_class?classname=$clsname"
164
+		ids_file=$(fetch_all_ids $1 $clsname)
165
+		for id in $(cat $ids_file)
166
+		do
167
+			#Get details on an instance
168
+			echo "$base_uri/show_object_detailled?classname=${clsname}&lodel_id=$id"
169
+			#Get base informations on an instance
170
+			echo "$base_uri/show_object?classname=${clsname}&lodel_id=$id"
171
+		done
172
+	done
173
+}
174
+
143 175
 mass_link_edit() {
144 176
 	#mass linking & edition scenarion
145 177
 	#$1 is instance name
@@ -376,6 +408,7 @@ get_queries_with_params() {
376 408
 	done | shuf
377 409
 }
378 410
 
411
+get_queries_with_params "mass_get" $instance_list
379 412
 [ "$n_create" -gt 0 ] && get_queries_with_params "mass_creation" $instance_list $n_create
380 413
 [ "$n_edit" -gt 0 ] && get_queries_with_params "mass_link_edit" $instance_list $n_edit
381 414
 [ "$n_delete" -gt 0 ] && get_queries_with_params "mass_deletion" $instance_list $n_delete

Loading…
Cancel
Save