1 |
afaq |
1.1 |
#!/bin/sh
|
2 |
|
|
#JAVA_HOME=/usr/java/jdk1.5.0_06/
|
3 |
|
|
BASE=$PWD/..
|
4 |
|
|
if [ "${JAVA_HOME}" = "" ]; then
|
5 |
|
|
echo "Error! Please set your JAVA_HOME variable"
|
6 |
|
|
exit 1
|
7 |
|
|
fi
|
8 |
|
|
savePWD=$PWD
|
9 |
|
|
outFile=$savePWD/result.txt
|
10 |
|
|
rm -f $outFile
|
11 |
|
|
cd $BASE/lib
|
12 |
|
|
CLASSPATH=.:$PWD/ojdbc14_g.jar:$PWD/mysql-connector-java-5.0.3-bin.jar
|
13 |
|
|
cd $BASE/bin
|
14 |
|
|
CLASSPATH=$CLASSPATH:$PWD/WEB-INF/classes/
|
15 |
afaq |
1.3 |
CMD="$JAVA_HOME/bin/java -classpath $CLASSPATH dbs.test.DBSCLI apiversion=v00_00_03"
|
16 |
afaq |
1.1 |
rand=`uuidgen`
|
17 |
|
|
#$JAVA_HOME/bin/java -classpath $CLASSPATH dbs.test.DBSTest
|
18 |
|
|
block='/TestPrimary1164144491.29/TestProcessed1164144491.29#42665801-a716-487e-9220-057e955f3a39'
|
19 |
|
|
primary_name="This_is_a_test_primary_$rand"
|
20 |
|
|
tier_name1="This_is_a_test_tier_HIT_$rand"
|
21 |
|
|
tier_name2="This_is_a_test_tier_SIM_$rand"
|
22 |
|
|
processed_name="This_is_a_test_processed_$rand"
|
23 |
|
|
path="/$primary_name/$tier_name1/$processed_name"
|
24 |
|
|
run_number1="9999"
|
25 |
|
|
run_number2="9998"
|
26 |
|
|
block_name="/test/test#$rand"
|
27 |
|
|
algo1="<algorithm app_version='MyVersion1_$rand' app_family_name='MyFamily1_$rand' app_executable_name='MyExe1_$rand' ps_name='DUMMY_ps_name2_$rand' ps_hash='DUMMY_HASH_$rand' ps_version='DUMMY1_$rand' ps_type='DUMMYTYPE1_$rand' ps_annotation='ANN1_$rand' ps_content='DUMMYCON_$rand'/>"
|
28 |
|
|
algo2="<algorithm app_version='MyVersion2_$rand' app_family_name='MyFamily2_$rand' app_executable_name='MyExe2_$rand' ps_name='DUMMY_ps_name2_$rand' ps_hash='DUMMY_HASH_$rand' ps_version='DUMMY2_$rand' ps_type='DUMMYTYPE2_$rand' ps_annotation='ANN2_$rand' ps_content='DUMMYCON_$rand'/>"
|
29 |
|
|
algo3="<algorithm app_version='MyVersion12_$rand' app_family_name='MyFamily12_$rand' app_executable_name='MyExe12_$rand' ps_name='DUMMY_ps_name2_$rand' ps_hash='DUMMY_HASH_$rand' ps_version='DUMMY3_$rand' ps_type='DUMMYTYPE3_$rand' ps_annotation='ANN3_$rand' ps_content='DUMMYCON_$rand'/>"
|
30 |
|
|
algo4="<algorithm app_version='MyVersion22_$rand' app_family_name='MyFamily22_$rand' app_executable_name='MyExe22_$rand' ps_name='DUMMY_ps_name2_$rand' ps_hash='DUMMY_HASH_$rand' ps_version='DUMMY4_$rand' ps_type='DUMMYTYPE4_$rand' ps_annotation='ANN4_$rand' ps_content='DUMMYCON_$rand'/>"
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
display () {
|
34 |
|
|
echo "$1" >> $outFile
|
35 |
|
|
tmp=`echo "$1" | grep "exception"`
|
36 |
|
|
len=${#tmp}
|
37 |
|
|
if [ "$len" -lt "1" ] ; then
|
38 |
|
|
echo "PASSED"
|
39 |
|
|
echo "*****************************************************************"
|
40 |
|
|
echo
|
41 |
|
|
else
|
42 |
|
|
echo "FAILED $tmp"
|
43 |
|
|
echo "*****************************************************************"
|
44 |
|
|
echo
|
45 |
|
|
fi
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
listPrimaryDatasets () {
|
49 |
|
|
message="Executing listPrimaryDatasets API..."
|
50 |
|
|
echo $message >> $outFile ; echo $message
|
51 |
|
|
out=`$CMD api=listPrimaryDatasets`
|
52 |
|
|
display "$out"
|
53 |
|
|
#$CMD api=listPrimaryDatasets pattern=*
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
listProcessedDatasets () {
|
57 |
|
|
message="Executing listProcessedDatasets API..."
|
58 |
|
|
echo $message >> $outFile ; echo $message
|
59 |
|
|
out=`$CMD api=listProcessedDatasets`
|
60 |
|
|
display "$out"
|
61 |
|
|
#$CMD api=listProcessedDatasets primary_datatset_name_pattern=* data_tier_name_pattern=* processed_datatset_name_pattern=* app_version=* app_family_name=* app_executable_name=* parameterset_name=*
|
62 |
|
|
}
|
63 |
|
|
|
64 |
|
|
listAlgorithms () {
|
65 |
|
|
message="Executing listAlgorithms API..."
|
66 |
|
|
echo $message >> $outFile ; echo $message
|
67 |
|
|
out=`$CMD api=listAlgorithms`
|
68 |
|
|
display "$out"
|
69 |
|
|
#$CMD api=listAlgorithms app_version=* app_family_name=* app_executable_name=* parameterset_name=*
|
70 |
|
|
}
|
71 |
|
|
|
72 |
|
|
listRuns() {
|
73 |
|
|
message="Executing listRuns API..."
|
74 |
|
|
echo $message >> $outFile ; echo $message
|
75 |
|
|
out=`$CMD api=listRuns path=$path`
|
76 |
|
|
display "$out"
|
77 |
|
|
}
|
78 |
|
|
|
79 |
|
|
listTiers () {
|
80 |
|
|
message="Executing listTiers API..."
|
81 |
|
|
echo $message >> $outFile ; echo $message
|
82 |
|
|
out=`$CMD api=listTiers path=$path`
|
83 |
|
|
display "$out"
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
listBlocks() {
|
87 |
|
|
message="Executing listBlocks API..."
|
88 |
|
|
echo $message >> $outFile ; echo $message
|
89 |
|
|
out=`$CMD api=listBlocks path=$path`
|
90 |
|
|
display "$out"
|
91 |
|
|
}
|
92 |
|
|
|
93 |
|
|
listFiles () {
|
94 |
|
|
message="Executing listFiles API..."
|
95 |
|
|
echo $message >> $outFile ; echo $message
|
96 |
|
|
out=`$CMD api=listFiles path=$path`
|
97 |
|
|
display "$out"
|
98 |
|
|
#$CMD api=listFiles block_name=$block
|
99 |
|
|
#$CMD api=listFiles path=$path pattern_lfn=*
|
100 |
|
|
}
|
101 |
|
|
|
102 |
|
|
#insert primary dataset
|
103 |
|
|
insertPrimaryDataset () {
|
104 |
|
|
xmlString="<?xml version='1.0' standalone='yes'?>
|
105 |
|
|
<dbs>
|
106 |
|
|
<primary-dataset annotation='aaaa$rand' primary_name='$primary_name' start_date='NOV_$rand' end_date='DEC_$rand' trigger_path_description='anyTD_$rand' mc_channel_description='MCDesc_$rand' mc_production='MCProd_$rand' mc_decay_chain='DC_$rand' other_description='OD_$rand' type='VALID'>
|
107 |
|
|
</primary-dataset>
|
108 |
|
|
</dbs>"
|
109 |
|
|
message="Executing insertPrimaryDataset API..."
|
110 |
|
|
echo $message >> $outFile ; echo $message
|
111 |
|
|
out=`$CMD api=insertPrimaryDataset "xmlinput=$xmlString"`
|
112 |
|
|
display "$out"
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
#insert Algorithm
|
117 |
|
|
insertAlgorithm () {
|
118 |
|
|
xmlString1="<?xml version='1.0' standalone='yes'?>
|
119 |
|
|
<dbs>
|
120 |
|
|
$algo1
|
121 |
|
|
</dbs>"
|
122 |
|
|
|
123 |
|
|
xmlString2="<?xml version='1.0' standalone='yes'?>
|
124 |
|
|
<dbs>
|
125 |
|
|
$algo2
|
126 |
|
|
</dbs>"
|
127 |
|
|
|
128 |
|
|
xmlString3="<?xml version='1.0' standalone='yes'?>
|
129 |
|
|
<dbs>
|
130 |
|
|
$algo3
|
131 |
|
|
</dbs>"
|
132 |
|
|
|
133 |
|
|
xmlString4="<?xml version='1.0' standalone='yes'?>
|
134 |
|
|
<dbs>
|
135 |
|
|
$algo4
|
136 |
|
|
</dbs>"
|
137 |
|
|
|
138 |
|
|
message="Executing insertAlgorithm API 4 times with different inputs..."
|
139 |
|
|
echo $message >> $outFile ; echo $message
|
140 |
|
|
|
141 |
|
|
out=`$CMD api=insertAlgorithm "xmlinput=$xmlString1"`
|
142 |
|
|
display "$out"
|
143 |
|
|
out=`$CMD api=insertAlgorithm "xmlinput=$xmlString2"`
|
144 |
|
|
display "$out"
|
145 |
|
|
out=`$CMD api=insertAlgorithm "xmlinput=$xmlString3"`
|
146 |
|
|
display "$out"
|
147 |
|
|
out=`$CMD api=insertAlgorithm "xmlinput=$xmlString4"`
|
148 |
|
|
display "$out"
|
149 |
|
|
}
|
150 |
|
|
|
151 |
|
|
# insert tier
|
152 |
|
|
insertTier () {
|
153 |
|
|
message="Executing insertTier API..."
|
154 |
|
|
echo $message >> $outFile ; echo $message
|
155 |
|
|
out=`$CMD api=insertTier tier_name="This_is_a_test_TIER_$rand"`
|
156 |
|
|
display "$out"
|
157 |
|
|
}
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
# insert run
|
161 |
|
|
insertRun () {
|
162 |
|
|
xmlString1="<?xml version='1.0' standalone='yes'?>
|
163 |
|
|
<dbs>
|
164 |
|
|
<run run_number='$run_number1' number_of_events='54' number_of_lumi_sections='12' total_luminosity='2' store_number='32' start_of_run='nov' end_of_run='dec'/>
|
165 |
|
|
</dbs>"
|
166 |
|
|
|
167 |
|
|
xmlString2="<?xml version='1.0' standalone='yes'?>
|
168 |
|
|
<dbs>
|
169 |
|
|
<run run_number='$run_number2' number_of_events='54' number_of_lumi_sections='12' total_luminosity='2' store_number='32' start_of_run='nov_$rand' end_of_run='dec_$rand'/>
|
170 |
|
|
</dbs>"
|
171 |
|
|
|
172 |
|
|
message="Executing insertRun API 2 times with different inputs..."
|
173 |
|
|
echo $message >> $outFile ; echo $message
|
174 |
|
|
out=`$CMD api=insertRun "xmlinput=$xmlString1"`
|
175 |
|
|
display "$out"
|
176 |
|
|
out=`$CMD api=insertRun "xmlinput=$xmlString2"`
|
177 |
|
|
display "$out"
|
178 |
|
|
}
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
# insert lumi section
|
183 |
|
|
insertLumiSection () {
|
184 |
|
|
xmlString="<?xml version='1.0' standalone='yes'?>
|
185 |
|
|
<dbs>
|
186 |
|
|
<lumi lumi_section_number='1111' run_number='$run_number1' start_event_number='20' end_event_number='200' lumi_start_time='nov_$rand' lumi_end_time='dec_$rand'/>
|
187 |
|
|
</dbs>"
|
188 |
|
|
message="Executing insertLumiSection API..."
|
189 |
|
|
echo $message >> $outFile ; echo $message
|
190 |
|
|
out=`$CMD api=insertLumiSection "xmlinput=$xmlString"`
|
191 |
|
|
display "$out"
|
192 |
|
|
}
|
193 |
|
|
|
194 |
|
|
# insert processed dataset
|
195 |
|
|
insertProcessedDataset () {
|
196 |
|
|
xmlString1="<?xml version='1.0' standalone='yes'?>
|
197 |
|
|
<dbs>
|
198 |
|
|
<processed-dataset primary_datatset_name='$primary_name' processed_datatset_name='$processed_name' open_for_writing='y' physics_group_name='AnyName_$rand' physics_group_convener='ANZARDN' status='VALID'>
|
199 |
|
|
<data_tier name='$tier_name1'/>
|
200 |
|
|
$algo1
|
201 |
|
|
$algo2
|
202 |
|
|
<run run_number='$run_number1'/>
|
203 |
|
|
<run run_number='$run_number2'/>
|
204 |
|
|
</processed-dataset>
|
205 |
|
|
</dbs>"
|
206 |
|
|
|
207 |
|
|
xmlString2="<?xml version='1.0' standalone='yes'?>
|
208 |
|
|
<dbs>
|
209 |
|
|
<processed-dataset primary_datatset_name='$primary_name' processed_datatset_name='CHILD_$processed_name' open_for_writing='y' physics_group_name='AnyName_$rand' physics_group_convener='ANZARDN' status='VALID'>
|
210 |
|
|
<data_tier name='$tier_name2'/>
|
211 |
|
|
<data_tier name='TEST_DIGI_$rand'/>
|
212 |
|
|
<data_tier name='TEST_GEN_$rand'/>
|
213 |
|
|
<parent path='$path'/>
|
214 |
|
|
$algo3
|
215 |
|
|
<run run_number='$run_number1'/>
|
216 |
|
|
</processed-dataset>
|
217 |
|
|
</dbs>"
|
218 |
|
|
|
219 |
|
|
message="Executing insertProcessedDataset API 2 times with different inputs..."
|
220 |
|
|
echo $message >> $outFile ; echo $message
|
221 |
|
|
out=`$CMD api=insertProcessedDataset "xmlinput=$xmlString1"`
|
222 |
|
|
display "$out"
|
223 |
|
|
out=`$CMD api=insertProcessedDataset "xmlinput=$xmlString2"`
|
224 |
|
|
display "$out"
|
225 |
|
|
}
|
226 |
|
|
|
227 |
|
|
insertBlock () {
|
228 |
|
|
xmlString="<?xml version='1.0' standalone='yes'?>
|
229 |
|
|
<dbs>
|
230 |
|
|
<block path='$path' name='$block_name' open_for_writing='1'/>
|
231 |
|
|
</dbs>"
|
232 |
|
|
message="Executing insertBlock API ..."
|
233 |
|
|
echo $message >> $outFile ; echo $message
|
234 |
|
|
out=`$CMD api=insertBlock "xmlinput=$xmlString"`
|
235 |
|
|
display "$out"
|
236 |
|
|
}
|
237 |
|
|
|
238 |
|
|
insertFiles () {
|
239 |
|
|
xmlString="<?xml version='1.0' standalone='yes'?>
|
240 |
|
|
<dbs>
|
241 |
|
|
<processed_datatset path='$path' block_name='$block_name'>
|
242 |
|
|
<file lfn='TEST_LFN_1_$rand' checksum='CHKSUM' number_of_events='200' size='200' file_status='VALID' type= 'EVD' validation_status='VALID' queryable_meta_data='any'>
|
243 |
|
|
<lumi_section lumi_section_number='9997' run_number='$run_number1' start_event_number='4' end_event_number='7' lumi_start_time='nov' lumi_end_time='dec'/>
|
244 |
|
|
<lumi_section lumi_section_number='9996' run_number='$run_number1' start_event_number='4' end_event_number='7' lumi_start_time='nov' lumi_end_time='dec'/>
|
245 |
|
|
<lumi_section lumi_section_number='9995' run_number='$run_number2' start_event_number='4' end_event_number='7' lumi_start_time='nov' lumi_end_time='dec'/>
|
246 |
|
|
<data_tier name='$tier_name1'/>
|
247 |
|
|
<data_tier name='$tier_name2'/>
|
248 |
|
|
$algo1
|
249 |
|
|
$algo1
|
250 |
|
|
</file>
|
251 |
|
|
<file lfn='TEST_LFN_2_$rand' checksum='CHKSUM2' number_of_events='300' size='2002' file_status='MERGED' type= 'EVD' validation_status='VALID' queryable_meta_data='any'>
|
252 |
|
|
<lumi_section lumi_section_number='1006' run_number='$run_number1' start_event_number='4' end_event_number='7' lumi_start_time='nov' lumi_end_time='dec'/>
|
253 |
|
|
<lumi_section lumi_section_number='1017' run_number='$run_number2' start_event_number='4' end_event_number='7' lumi_start_time='nov' lumi_end_time='dec'/>
|
254 |
|
|
<lumi_section lumi_section_number='1028' run_number='$run_number1' start_event_number='4' end_event_number='7' lumi_start_time='nov' lumi_end_time='dec'/>
|
255 |
|
|
<data_tier name='$tier_name1'/>
|
256 |
|
|
<data_tier name='$tier_name2'/>
|
257 |
|
|
<parent lfn='TEST_LFN_1_$rand'/>
|
258 |
|
|
$algo3
|
259 |
|
|
$algo4
|
260 |
|
|
</file>
|
261 |
|
|
</processed_datatset>
|
262 |
|
|
</dbs>"
|
263 |
|
|
message="Executing insertFiles API ..."
|
264 |
|
|
echo $message >> $outFile ; echo $message
|
265 |
|
|
out=`$CMD api=insertFiles "xmlinput=$xmlString"`
|
266 |
|
|
display "$out"
|
267 |
|
|
|
268 |
|
|
}
|
269 |
|
|
|
270 |
afaq |
1.2 |
#insert primary dataset
|
271 |
|
|
createAnalysisDatasetFromPD () {
|
272 |
|
|
xmlString="<?xml version='1.0' standalone='yes'?>
|
273 |
|
|
<dbs>
|
274 |
|
|
<analysis-dataset annotation='aaaa$rand' name='AnalysisDS_$rand' type='VALID' status='TEST' path='$path' physics_group_name='AnyName_$rand' />
|
275 |
|
|
</dbs>"
|
276 |
|
|
message="Executing createAnalysisDatasetFromPD API..."
|
277 |
|
|
echo $message >> $outFile ; echo $message
|
278 |
|
|
out=`$CMD api=createAnalysisDatasetFromPD "xmlinput=$xmlString"`
|
279 |
|
|
display "$out"
|
280 |
|
|
}
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
|
284 |
afaq |
1.1 |
|
285 |
afaq |
1.2 |
insertPrimaryDataset
|
286 |
|
|
insertAlgorithm
|
287 |
afaq |
1.1 |
#insertTier
|
288 |
|
|
#insertRun
|
289 |
|
|
#insertLumiSection
|
290 |
afaq |
1.2 |
insertProcessedDataset
|
291 |
|
|
insertBlock
|
292 |
|
|
insertFiles
|
293 |
|
|
createAnalysisDatasetFromPD
|
294 |
|
|
#listPrimaryDatasets
|
295 |
afaq |
1.1 |
#listProcessedDatasets
|
296 |
|
|
#listAlgorithms
|
297 |
|
|
#listRuns
|
298 |
|
|
#listTiers
|
299 |
|
|
#listBlocks
|
300 |
|
|
#listFiles
|
301 |
|
|
|
302 |
|
|
echo
|
303 |
|
|
echo "*************************************************************"
|
304 |
|
|
echo "For more detail and the output of the APIs look in $outFile"
|
305 |
|
|
cd $savePWD
|