Skip to content
Snippets Groups Projects
Commit 788dd999 authored by Mark Stockton's avatar Mark Stockton Committed by Melissa Yexley
Browse files

DB test - Add copy of tnsnames

DB test - Add copy of tnsnames
parent 40062b96
No related branches found
No related tags found
No related merge requests found
...@@ -35,13 +35,23 @@ moveJSON.prmon = False ...@@ -35,13 +35,23 @@ moveJSON.prmon = False
# Common DB commands # Common DB commands
# Setup
# - setup TDAQ release to access TriggerDB scripts
# - copy authentication files as can't be read on afs/eos, set TRIGGER_DB_ART to use these files
# - copy TNS lookup file as not in ART container
trigDBsetup = '&& source /cvmfs/atlas.cern.ch/repo/sw/tdaq/tdaq/prod/installed/setup.sh \ trigDBsetup = '&& source /cvmfs/atlas.cern.ch/repo/sw/tdaq/tdaq/prod/installed/setup.sh \
&& export TRIGGER_DB_ART=1 \ && export TRIGGER_DB_ART=1 \
&& export EOS_MGM_URL=root://eosuser.cern.ch \ && export EOS_MGM_URL=root://eosuser.cern.ch \
&& xrdcp root://eosuser.cern.ch//eos/user/t/trigcomm/.dbauth/run3/write/dblookup.xml . \ && xrdcp root://eosuser.cern.ch//eos/user/t/trigcomm/.dbauth/run3/write/dblookup.xml . \
&& xrdcp root://eosuser.cern.ch//eos/user/t/trigcomm/.dbauth/run3/write/authentication.xml . ' && xrdcp root://eosuser.cern.ch//eos/user/t/trigcomm/.dbauth/run3/write/authentication.xml . \
trigDBfinalise = '&& rm authentication.xml && rm dblookup.xml \ && export TNS_ADMIN="." \
&& grep smk uploadRecord*.json | awk \'{print "SMK=" substr($2, 1, length($2)-1)}\' > exportMenuKeys.sh \ && xrdcp root://eosuser.cern.ch//eos/project/o/oracle/public/admin/tnsnames.ora .'
# Cleanup
# - remove copied files
trigDBcleanup = '&& rm authentication.xml && rm dblookup.xml && rm tnsnames.ora'
# Export
# - create file containing keys to be used to set the env in later steps
trigDBexport = '&& grep smk uploadRecord*.json | awk \'{print "SMK=" substr($2, 1, length($2)-1)}\' > exportMenuKeys.sh \
&& grep l1PSK uploadRecord*.json | awk \'{print "L1PSK=" substr($2, 1, length($2)-1)}\' >> exportMenuKeys.sh \ && grep l1PSK uploadRecord*.json | awk \'{print "L1PSK=" substr($2, 1, length($2)-1)}\' >> exportMenuKeys.sh \
&& grep hltPSK uploadRecord*.json | awk \'{print "HLTPSK=" substr($2, 1, length($2)-1)}\' >> exportMenuKeys.sh' && grep hltPSK uploadRecord*.json | awk \'{print "HLTPSK=" substr($2, 1, length($2)-1)}\' >> exportMenuKeys.sh'
...@@ -53,7 +63,8 @@ uploadDB.input = '' ...@@ -53,7 +63,8 @@ uploadDB.input = ''
uploadDB.executable = '(cd filesForUpload' uploadDB.executable = '(cd filesForUpload'
uploadDB.executable += trigDBsetup uploadDB.executable += trigDBsetup
uploadDB.executable += '&& insertAll.py --dbalias TRIGGERDBART --comment "ART test SMK upload `date +%F` release ${AtlasVersion} ${AtlasBuildStamp}" --directory ./ ' uploadDB.executable += '&& insertAll.py --dbalias TRIGGERDBART --comment "ART test SMK upload `date +%F` release ${AtlasVersion} ${AtlasBuildStamp}" --directory ./ '
uploadDB.executable += trigDBfinalise uploadDB.executable += trigDBcleanup
uploadDB.executable += trigDBexport
uploadDB.executable += '&& cd ..)' uploadDB.executable += '&& cd ..)'
uploadDB.prmon = False uploadDB.prmon = False
...@@ -66,9 +77,9 @@ downloadDB.executable = '(mkdir filesDownloaded && cd filesDownloaded' ...@@ -66,9 +77,9 @@ downloadDB.executable = '(mkdir filesDownloaded && cd filesDownloaded'
downloadDB.executable += trigDBsetup downloadDB.executable += trigDBsetup
downloadDB.executable += '&& source ../filesForUpload/exportMenuKeys.sh \ downloadDB.executable += '&& source ../filesForUpload/exportMenuKeys.sh \
&& extractMenu.py --dbalias TRIGGERDBART --smk $SMK \ && extractMenu.py --dbalias TRIGGERDBART --smk $SMK \
&& extractPrescales.py --dbalias TRIGGERDBART --l1psk $L1PSK --hltpsk $HLTPSK \ && extractPrescales.py --dbalias TRIGGERDBART --l1psk $L1PSK --hltpsk $HLTPSK'
&& rm authentication.xml && rm dblookup.xml \ downloadDB.executable += trigDBcleanup
&& cd .. \ downloadDB.executable += '&& cd .. \
&& diff -q -s filesDownloaded/L1Prescale_${L1PSK}.json filesForUpload/L1PrescalesSet_*.json \ && diff -q -s filesDownloaded/L1Prescale_${L1PSK}.json filesForUpload/L1PrescalesSet_*.json \
&& diff -q -s filesDownloaded/HLTPrescale_${HLTPSK}.json filesForUpload/HLTPrescalesSet_*.json \ && diff -q -s filesDownloaded/HLTPrescale_${HLTPSK}.json filesForUpload/HLTPrescalesSet_*.json \
&& diff -q -s filesDownloaded/SMK_${SMK}/L1Menu_${SMK}.json filesForUpload/L1Menu_*.json \ && diff -q -s filesDownloaded/SMK_${SMK}/L1Menu_${SMK}.json filesForUpload/L1Menu_*.json \
...@@ -111,7 +122,8 @@ uploadDBdupe.input = '' ...@@ -111,7 +122,8 @@ uploadDBdupe.input = ''
uploadDBdupe.executable = '(cd filesDuplicate' uploadDBdupe.executable = '(cd filesDuplicate'
uploadDBdupe.executable += trigDBsetup uploadDBdupe.executable += trigDBsetup
uploadDBdupe.executable += '&& insertAll.py --dbalias TRIGGERDBART --comment "ART test duplicate SMK upload `date +%F` release ${AtlasVersion} ${AtlasBuildStamp}" --directory ./' uploadDBdupe.executable += '&& insertAll.py --dbalias TRIGGERDBART --comment "ART test duplicate SMK upload `date +%F` release ${AtlasVersion} ${AtlasBuildStamp}" --directory ./'
uploadDBdupe.executable += trigDBfinalise uploadDBdupe.executable += trigDBcleanup
uploadDBdupe.executable += trigDBexport
uploadDBdupe.executable += '&& cd .. \ uploadDBdupe.executable += '&& cd .. \
&& diff -q -s filesDuplicate/exportMenuKeys.sh filesForUpload/exportMenuKeys.sh)' && diff -q -s filesDuplicate/exportMenuKeys.sh filesForUpload/exportMenuKeys.sh)'
uploadDBdupe.prmon = False uploadDBdupe.prmon = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment