ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/DBS/Servers/JavaServer/test/runFewTests.sh
Revision: 1.4
Committed: Mon Feb 26 20:41:56 2007 UTC (18 years, 2 months ago) by sekhri
Content type: application/x-sh
Branch: MAIN
CVS Tags: DBS_2_1_6, DBS_2_1_5, DBS_2_1_4, DBS_2_1_3, DBS_2_1_2, DBS_2_1_1_patch2, DBS_2_1_1_patch1, DBS_2_1_1, DBS_2_1_1_pre3, DBS_2_1_1_pre2, DBS_2_1_1_pre1, DBS_2_1_0_patch_2, DBS_2_1_0_patch_1, DBS_2_1_0, DBS_2_1_0_pre2, DBS_2_1_0_pre1, DBS_2_0_9_patch_6, DBS_2_0_9_patch_5, DBS_2_0_9, DBS_2_0_9_pre11, DBS_2_0_9_pre10, DBS_2_0_9_pre9, DBS_2_0_9_pre8, DBS_2_0_9_patch_4, DBS_2_0_9_pre7, DBS_2_0_9_patch_3, DBS_2_0_9_pre6, DBS_2_0_9_patch_2, DBS_2_0_9_pre5, DBS_2_0_9_patch_1, DBS_2_0_9_pre4, DBS_2_0_9_pre3, DBS_2_0_9_pre2, DBS_2_0_9_pre1, DBS_2_0_8_patch_2, DBS_2_0_8_patch_1, DBS_2_0_8, DBS_2_0_8_pre7, DBS_2_0_8_pre6, DBS_2_0_8_pre5, DBS_2_0_8_pre4, DBS_2_0_8_pre3, DBS_2_0_8_pre2, DBS_2_0_8_pre1, DBS_2_0_7, DBS_2_0_7_pre7, deadlock_fix_attempt, DBS_2_0_7_pre6, DBS_2_0_7_pre5, DBS_2_0_7_pre4, DBS_2_0_7_pre3, DBS_2_0_7_pre1, DBS_2_0_6_patch_5, DBS_2_0_6_patch_4, DBS_2_0_6_patch_3, DBS_2_0_6_patch_2, DBS_2_0_6_patch1, DBS_2_0_6, DBS_2_0_6_pre8, DBS_2_0_6_pre7, DBS_2_0_6_pre6, DBS_2_0_6_pre5, DBS_2_0_6_pre4, DBS_2_0_6_pre3, DBS_2_0_6_pre2, DBS_2_0_6_pre1, DBS_2_0_5, DBS_2_0_5_pre7, DBS_2_0_5_pre6, DBS_2_0_5_pre5, DBS_2_0_5_pre4, DBS_2_0_5_pre3, DBS_2_0_5_pre2, DBS_2_0_5_pre1, DBS_2_0_4, DBS_2_0_4_pre2, DBS_2_0_4_pre1, DBS_2_0_3, DBS_2_0_3_pre2, DBS_2_0_3_pre, DBS_2_0_3_pre1, DBS_2_0_2, DBS_2_0_0, DBS_1_2_9, DBS_1_2_8, DBS_1_2_6, DBS_1_2_5, DBS_1_2_3, DBS_1_2_2, DBS_1_2_1, DBS_1_2_0, DBS_1_1_9, DBS_1_1_8, DBS_1_1_7, DBS_1_1_6, DBS_1_1_6_pre3, DBS_1_1_6_pre2, DBS_1_1_6_pre1, DBS_1_1_5, DBS_1_1_5_pre2, DBS_1_1_5_pre1, DBS_1_1_5_pre, DBS_1_1_4, DBS_1_1_3, DBS_1_1_2, DBS_1_1_2e, DBS_1_1_2d, DBS_1_1_2c, DBS_1_1_2b, DBS_1_1_2a, DBS_1_1_2_pre1, DBS_1_1_1a, DBS_1_1_1, DBS_1_1_0, DBS_1_0_9, DBS_1_0_9_pre4, DBS_1_0_9_pre3, DBS_1_0_9_pre2, DBS_1_0_9_pre1, DBS_1_0_8, DBS_1_0_8_pre7, DBS_1_0_8_pre6, DBS_1_0_8_pre5, DBS_1_0_8_pre4, DBS_1_0_8_pre3_b4code_rehash, DBS_1_0_8_pre2, DBS_1_0_8_pre1, DBS_1_0_7, DBS_1_0_7_pre2, DBS_1_0_7_pre1, DBS_1_0_6, DBS_1_0_5, DBS_1_0_4, DBS_1_0_4_pre2, DBS_1_0_4_pre1, DBS_1_0_3, DBS_1_0_3_pre1, DBS_1_0_2, DBS_1_0_1, DBS_1_0_0_noblockpathchk, DBS_1_0_0, DBS_1_0_0_pre8, DBS_1_0_0_pre7, DBS_1_0_0_pre6, DBS_1_0_0_pre5, pre5_v01_00_00, pre4_v01_00_00, pre3_v01_00_00, pre2_v01_00_00, pre_v01_00_00, v00_00_14, HEAD
Branch point for: DBS_2_0_6_patch_51, DBS_2_0_5_MAINT
Changes since 1.3: +15 -6 lines
Log Message:
Added listStorageElements and deleteSEFromBlock APIs for DLS integration

File Contents

# User Rev Content
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 sekhri 1.4 listStorageElements () {
94     message="Executing listStorageElements API..."
95     echo $message >> $outFile ; echo $message
96     out=`$CMD api=listStorageElements`
97     display "$out"
98     }
99    
100    
101 afaq 1.1 listFiles () {
102     message="Executing listFiles API..."
103     echo $message >> $outFile ; echo $message
104     out=`$CMD api=listFiles path=$path`
105     display "$out"
106     #$CMD api=listFiles block_name=$block
107     #$CMD api=listFiles path=$path pattern_lfn=*
108     }
109    
110     #insert primary dataset
111     insertPrimaryDataset () {
112     xmlString="<?xml version='1.0' standalone='yes'?>
113     <dbs>
114     <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'>
115     </primary-dataset>
116     </dbs>"
117     message="Executing insertPrimaryDataset API..."
118     echo $message >> $outFile ; echo $message
119     out=`$CMD api=insertPrimaryDataset "xmlinput=$xmlString"`
120     display "$out"
121     }
122    
123    
124     #insert Algorithm
125     insertAlgorithm () {
126     xmlString1="<?xml version='1.0' standalone='yes'?>
127     <dbs>
128     $algo1
129     </dbs>"
130    
131     xmlString2="<?xml version='1.0' standalone='yes'?>
132     <dbs>
133     $algo2
134     </dbs>"
135    
136     xmlString3="<?xml version='1.0' standalone='yes'?>
137     <dbs>
138     $algo3
139     </dbs>"
140    
141     xmlString4="<?xml version='1.0' standalone='yes'?>
142     <dbs>
143     $algo4
144     </dbs>"
145    
146     message="Executing insertAlgorithm API 4 times with different inputs..."
147     echo $message >> $outFile ; echo $message
148    
149     out=`$CMD api=insertAlgorithm "xmlinput=$xmlString1"`
150     display "$out"
151     out=`$CMD api=insertAlgorithm "xmlinput=$xmlString2"`
152     display "$out"
153     out=`$CMD api=insertAlgorithm "xmlinput=$xmlString3"`
154     display "$out"
155     out=`$CMD api=insertAlgorithm "xmlinput=$xmlString4"`
156     display "$out"
157     }
158    
159     # insert tier
160     insertTier () {
161     message="Executing insertTier API..."
162     echo $message >> $outFile ; echo $message
163     out=`$CMD api=insertTier tier_name="This_is_a_test_TIER_$rand"`
164     display "$out"
165     }
166    
167    
168     # insert run
169     insertRun () {
170     xmlString1="<?xml version='1.0' standalone='yes'?>
171     <dbs>
172     <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'/>
173     </dbs>"
174    
175     xmlString2="<?xml version='1.0' standalone='yes'?>
176     <dbs>
177     <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'/>
178     </dbs>"
179    
180     message="Executing insertRun API 2 times with different inputs..."
181     echo $message >> $outFile ; echo $message
182     out=`$CMD api=insertRun "xmlinput=$xmlString1"`
183     display "$out"
184     out=`$CMD api=insertRun "xmlinput=$xmlString2"`
185     display "$out"
186     }
187    
188    
189    
190     # insert lumi section
191     insertLumiSection () {
192     xmlString="<?xml version='1.0' standalone='yes'?>
193     <dbs>
194     <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'/>
195     </dbs>"
196     message="Executing insertLumiSection API..."
197     echo $message >> $outFile ; echo $message
198     out=`$CMD api=insertLumiSection "xmlinput=$xmlString"`
199     display "$out"
200     }
201    
202     # insert processed dataset
203     insertProcessedDataset () {
204     xmlString1="<?xml version='1.0' standalone='yes'?>
205     <dbs>
206     <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'>
207     <data_tier name='$tier_name1'/>
208     $algo1
209     $algo2
210     <run run_number='$run_number1'/>
211     <run run_number='$run_number2'/>
212     </processed-dataset>
213     </dbs>"
214    
215     xmlString2="<?xml version='1.0' standalone='yes'?>
216     <dbs>
217     <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'>
218     <data_tier name='$tier_name2'/>
219     <data_tier name='TEST_DIGI_$rand'/>
220     <data_tier name='TEST_GEN_$rand'/>
221     <parent path='$path'/>
222     $algo3
223     <run run_number='$run_number1'/>
224     </processed-dataset>
225     </dbs>"
226    
227     message="Executing insertProcessedDataset API 2 times with different inputs..."
228     echo $message >> $outFile ; echo $message
229     out=`$CMD api=insertProcessedDataset "xmlinput=$xmlString1"`
230     display "$out"
231     out=`$CMD api=insertProcessedDataset "xmlinput=$xmlString2"`
232     display "$out"
233     }
234    
235     insertBlock () {
236     xmlString="<?xml version='1.0' standalone='yes'?>
237     <dbs>
238     <block path='$path' name='$block_name' open_for_writing='1'/>
239     </dbs>"
240     message="Executing insertBlock API ..."
241     echo $message >> $outFile ; echo $message
242     out=`$CMD api=insertBlock "xmlinput=$xmlString"`
243     display "$out"
244     }
245    
246     insertFiles () {
247     xmlString="<?xml version='1.0' standalone='yes'?>
248     <dbs>
249     <processed_datatset path='$path' block_name='$block_name'>
250     <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'>
251     <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'/>
252     <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'/>
253     <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'/>
254     <data_tier name='$tier_name1'/>
255     <data_tier name='$tier_name2'/>
256     $algo1
257     $algo1
258     </file>
259     <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'>
260     <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'/>
261     <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'/>
262     <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'/>
263     <data_tier name='$tier_name1'/>
264     <data_tier name='$tier_name2'/>
265     <parent lfn='TEST_LFN_1_$rand'/>
266     $algo3
267     $algo4
268     </file>
269     </processed_datatset>
270     </dbs>"
271     message="Executing insertFiles API ..."
272     echo $message >> $outFile ; echo $message
273     out=`$CMD api=insertFiles "xmlinput=$xmlString"`
274     display "$out"
275    
276     }
277    
278 afaq 1.2 #insert primary dataset
279     createAnalysisDatasetFromPD () {
280     xmlString="<?xml version='1.0' standalone='yes'?>
281     <dbs>
282     <analysis-dataset annotation='aaaa$rand' name='AnalysisDS_$rand' type='VALID' status='TEST' path='$path' physics_group_name='AnyName_$rand' />
283     </dbs>"
284     message="Executing createAnalysisDatasetFromPD API..."
285     echo $message >> $outFile ; echo $message
286     out=`$CMD api=createAnalysisDatasetFromPD "xmlinput=$xmlString"`
287     display "$out"
288     }
289    
290    
291    
292 afaq 1.1
293 sekhri 1.4 #insertPrimaryDataset
294     #insertAlgorithm
295 afaq 1.1 #insertTier
296     #insertRun
297     #insertLumiSection
298 sekhri 1.4 #insertProcessedDataset
299     #insertBlock
300     #insertFiles
301     #createAnalysisDatasetFromPD
302 afaq 1.2 #listPrimaryDatasets
303 afaq 1.1 #listProcessedDatasets
304     #listAlgorithms
305     #listRuns
306     #listTiers
307     #listBlocks
308     #listFiles
309 sekhri 1.4 listStorageElements
310 afaq 1.1
311     echo
312     echo "*************************************************************"
313     echo "For more detail and the output of the APIs look in $outFile"
314     cd $savePWD