Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:36:51

0001 #!/bin/bash
0002 
0003 check_for_success() {
0004     "${@}" && echo -e "\n ---> Passed test of '${@}'\n\n" || exit 1
0005 }
0006 
0007 check_for_failure() {
0008     "${@}" && exit 1 || echo -e "\n ---> Passed test of '${@}'\n\n"
0009 }
0010 
0011 check_for_full(){
0012     count=`echo ${@} | python3 -c 'import json,sys;data=json.load(sys.stdin);print(len(data.keys()))'`
0013     echo $count
0014     if [[ $count -gt 0 ]]
0015     then 
0016         entries=`echo ${@} | python3 -c 'import json,sys;data=json.load(sys.stdin);print(list(data.keys()))'`
0017         echo -e "\n ---> passed getPayloadData.py --discover test : found $count entries: $entries"
0018     else 
0019         echo -e "getPayloadData.py --discover test not passed... found no entries"
0020         exit 1
0021     fi
0022 }
0023 
0024 ########################################
0025 # Test help function
0026 ########################################
0027 check_for_success getPayloadData.py --help
0028 
0029 ########################################
0030 # Test discover function
0031 ########################################
0032 check_for_success getPayloadData.py --discover
0033 
0034 ########################################
0035 # Test length of discovered dictionary
0036 ########################################
0037 OUT=$(getPayloadData.py --discover)
0038 check_for_full $OUT
0039 
0040 ########################################
0041 # Test BasicPayload mult-iov single tag
0042 ########################################
0043 check_for_success getPayloadData.py \
0044     --plugin pluginBasicPayload_PayloadInspector \
0045     --plot plot_BasicPayload_data0 \
0046     --tag BasicPayload_v0 \
0047     --time_type Run \
0048     --iovs '{"start_iov": "1", "end_iov": "101"}' \
0049     --db Prod \
0050     --test ;
0051 
0052 ########################################
0053 # Test BasicPayload with input
0054 ########################################
0055 check_for_success getPayloadData.py \
0056     --plugin pluginBasicPayload_PayloadInspector \
0057     --plot plot_BasicPayload_data0_withInput \
0058     --tag BasicPayload_v0 \
0059     --input_params '{"Factor":"1","Offset":"2","Scale":"3"}' \
0060     --time_type Run \
0061     --iovs '{"start_iov": "1", "end_iov": "101"}' \
0062     --db Prod \
0063     --test ;
0064 
0065 ########################################
0066 # Test BasicPayload with wrong inputs
0067 ########################################
0068 check_for_failure getPayloadData.py \
0069     --plugin pluginBasicPayload_PayloadInspector \
0070     --plot plot_BasicPayload_data0 \
0071     --tag BasicPayload \
0072     --time_type Run \
0073     --iovs '{"start_iov": "1", "end_iov": "101"}' \
0074     --db Prod \
0075     --test ;
0076 
0077 ########################################
0078 # Test BasicPayload single-iov, multi-tag
0079 ########################################
0080 check_for_success getPayloadData.py \
0081     --plugin pluginBasicPayload_PayloadInspector \
0082     --plot plot_BasicPayload_data7 \
0083     --tag BasicPayload_v0 \
0084     --tagtwo BasicPayload_v1 \
0085     --time_type Run \
0086     --iovs '{"start_iov": "1", "end_iov": "1"}' \
0087     --iovstwo '{"start_iov": "101", "end_iov": "101"}' \
0088     --db Prod \
0089     --test ;
0090 
0091 ########################################
0092 # Test BasicPayload single-iov, with suppress output
0093 ########################################
0094 check_for_success getPayloadData.py \
0095     --plugin pluginBasicPayload_PayloadInspector \
0096     --plot plot_BasicPayload_data5 \
0097     --tag BasicPayload_v10.0 \
0098     --input_params '{}' \
0099     --time_type Run \
0100     --iovs '{"start_iov": "601", "end_iov": "601"}' \
0101     --db Prod \
0102     --suppress-output ;
0103 
0104 ########################################
0105 # Test in production style
0106 ########################################
0107 check_for_success getPayloadData.py \
0108     --plugin pluginBasicPayload_PayloadInspector \
0109     --plot plot_BasicPayload_data6 \
0110     --tag BasicPayload_v0 \
0111     --input_params '{}' \
0112     --time_type Run \
0113     --iovs '{"start_iov": "1", "end_iov": "1"}' \
0114     --db Prod \
0115     --suppress-output \
0116     --image_plot;
0117