Przeglądaj źródła

Added a get scenario to CBL

the get scenario produce all the get available for each instances in the site
Yann Weber 8 lat temu
rodzic
commit
e7e393598c
1 zmienionych plików z 34 dodań i 1 usunięć
  1. 34
    1
      scripts/cbl.sh

+ 34
- 1
scripts/cbl.sh Wyświetl plik

13
 #
13
 #
14
 # Scenario description :
14
 # Scenario description :
15
 #
15
 #
16
-# mass_creation instance_name iteration_count :
16
+# mass_creation instance_name iteration_count :
17
 #	Create iteration_count time a random leobject in given instance_name
17
 #	Create iteration_count time a random leobject in given instance_name
18
 #	note : do note create relation between objects, only populate content
18
 #	note : do note create relation between objects, only populate content
19
 #	
19
 #	
21
 # 	step 2 : loop on creation (using bash function curl_opt_create_CLSNAME)
21
 # 	step 2 : loop on creation (using bash function curl_opt_create_CLSNAME)
22
 #		that return the POST fields (populated with random values)
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
 # mass_deletion instance_name iteration_count :
30
 # mass_deletion instance_name iteration_count :
25
 #	Foreach non asbtracty class delete iteration_count time an object of
31
 #	Foreach non asbtracty class delete iteration_count time an object of
26
 #	current class in current instance
32
 #	current class in current instance
140
 	rm -v $cls_list_file >&2
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
 mass_link_edit() {
175
 mass_link_edit() {
144
 	#mass linking & edition scenarion
176
 	#mass linking & edition scenarion
145
 	#$1 is instance name
177
 	#$1 is instance name
376
 	done | shuf
408
 	done | shuf
377
 }
409
 }
378
 
410
 
411
+get_queries_with_params "mass_get" $instance_list
379
 [ "$n_create" -gt 0 ] && get_queries_with_params "mass_creation" $instance_list $n_create
412
 [ "$n_create" -gt 0 ] && get_queries_with_params "mass_creation" $instance_list $n_create
380
 [ "$n_edit" -gt 0 ] && get_queries_with_params "mass_link_edit" $instance_list $n_edit
413
 [ "$n_edit" -gt 0 ] && get_queries_with_params "mass_link_edit" $instance_list $n_edit
381
 [ "$n_delete" -gt 0 ] && get_queries_with_params "mass_deletion" $instance_list $n_delete
414
 [ "$n_delete" -gt 0 ] && get_queries_with_params "mass_deletion" $instance_list $n_delete

Loading…
Anuluj
Zapisz