diff --git a/Configs/Conf.cfg b/Configs/Conf.cfg deleted file mode 100644 index d8e433879fc7840dc47c08cbc7b18b3f2008b539..0000000000000000000000000000000000000000 --- a/Configs/Conf.cfg +++ /dev/null @@ -1,258 +0,0 @@ -########## Common parameters ########## - -# Log directory -LogDir: '/afs/cern.ch/user/l/lmarti/private/tdaq/log/' - -#Lock file -lockFile: 'SFO.lock' - -# Log severity level (DEBUG,INFO,WARNING,ERROR,CRITICAL) -LogLevel: 'debug' - -# ERS severity level (DEBUG,INFO,WARNING,ERROR,CRITICAL) -ERSLogLevel: 'info' - -# On / Off switch for ERS -ERSenabled: True - -# Email list which will receive error messages (list of strings) -mailList: [] - -# Email Log severity level (DEBUG,INFO,WARNING,ERROR,CRITICAL) -mailLevel: 'debug' - -# Email sender -mailSender: 'someone@cern.ch' - -# PYTHON_PATH add-ons -# e.g. ['/path/to/your/modules','/another/path'] -pythonPathPrepend: [] - - -########## VARIABLES FOR ERS ############## - -# Partition to log to -partition: "part_l2ef_nightly" - -# Stream ERS messages to -ers_info: "mrs" -ers_warning: "mrs" -ers_error: "mrs" -ers_debug: "mrs" - -########## METADATA DATABASE ########## - -# Oracle connection string -#connection: 'oracle://atonr_conf/ATLAS_SFO_T0' -#Use None to disable DB access -connection: None - -# File table name -file_table: "TEST_SCRIPT_FILE" -#file_table="SFO_TZ_FILE" - -# Lumiblock table name -lb_table: "TEST_SCRIPT_LUMI" -#lb_table="SFO_TZ_LUMIBLOCK" - -# Run table name -run_table: "TEST_SCRIPT_RUN" -#run_table="SFO_TZ_RUN" - - - -########## MAIN THREAD ########## - -# If Oracle database is down, retry to connect to it every DBTimeout (s) -DBTimeout: 2 - -# Timeout to refresh the Oracle connection -DBReconnectTimeout: 3600 - -# Filename parser module -Filenameparser: 'SFOFileNameParser' - -# Filename parser configuration -FilenameparserConf: {} - -# Module provide backend access functions -BackendModule: 'castorstorage' - -# Backend specific parameters -BackendModuleConf: {} - -# Keytab file for Kerberos auth. None to skip -#A keytab file can be generated with: -#$> /usr/kerberos/sbin/ktutil -#ktutil: add_entry -password -p <username>@CERN.CH -k 1 -e arcfour-hmac-md5 -#ktutil: add_entry -password -p <username>@CERN.CH -k 1 -e aes256-cts -#ktutil: wkt <filename> -Keytab: None - -# Kerberos user corresponding to the above keytab -KrbUser: 'atlascdr' - -# Path to custom Kerberos cache file. None to use the default one -KrbCache: '/tmp/castor_krbcache' - - -#[Manager] -########## MANAGER THREAD ########## - -# Directory List where to get Data Files (list of strings) -DirList: ['/data1', - '/data2'] - - -# Unix pathname pattern for file selection -DataFilePattern: ['*.data',] - -# A regular expression to exclude some file from being processed. -# The filename is checked against this regex after being selected by DataFilePattern -ExcludeFileRegex: None - -# Number of files to be deleted before to update the list of files to be copied -nDel: 2 - -# Sleep timeout (s) before updating the list of files to be copied -ManagerTimeout: 2 - -# Delay (s) before to put .PROBLEMATIC file back into the CopyQueue -ProblDelay: 3 - -# At each retry, the delay for .PROBLEMATIC files is scaled -# using this factor: -# ActualProblDelay = ProblDelay*e^(ProblScalingFactor*#retries) -ProblScalingFactor: 0.5 - -# Actual .PROBLEMATIC delay limit to enable CRITICAL messages -ProblDelayLimit: 200 - -# Minimal file size in kB -MinSizekB: 0. - -# If small files should be removed -RemoveSmallFiles: False - -# Directory where to copy the Data Files (string) -#Keywords can be used here -#%(year)s -#%(month)s -#%(streamtype)s -#%(streamname)s -#%(runnumber)s -#%(filenr)s -#%(lumiblocknr)s -#%(projecttag)s -#%(dataset)s -#%(applicationid)s -#%(directory)s -#%(userdef1)s -#%(userdef2)s -#%(userdef3)s -CopyDir: '/castor/cern.ch/somewhere/%(year)s' - -# Pool in Castor -Pool: 'default' - -# Stage Host -StageHost: 'castoratlas' - -# Stream driven pool [{'targetdir':'/some/where', 'stagehost':'castoratlas', -# 'pool':'t0atlas', 'projecttag':'data_test', 'streamtype':'physics', -# 'streamname':'something' ,'lumiblock':'22?', 'application':'SFO*', -# 'directory':'/some/dir'},] -drivenPool: [] - - -#[Copy] -########## COPY THREAD ########## - -# Max number of concurrent cp processes -maxCopy: 3 - -# In case of failure, max number of rfcp retries on the spot (before let the Manager take care of retring) -maxRetry: 2 - -# Timeout (s) after which kill and retry an rfcp command in None status -NoneTimeout: 10 - -# Sleep timeout (s) before checking again the copy process status -CopyTimeout: 2 - -# Kill ongoing transfers if a FS gets locked -avoidCopyOverlap: False - -# Calculate the adler32 checksum from the local file instead of using the one -# provided by the database (if any) -computeChecksum: False - -# Bandwidth limit (MB/s) -bwLimit: 0 - -# Bandwidth limit device -bwDevice: None - -#[Delete] -########## DELETE THREAD ########## -# Disable to completely disable the feature (thread not started) -DeleteEnabled: True - -# Is simultaneous writing and deleting allowed? -ignoreLock: True - -# Get filesystem info after nFiles have been copied -nFiles: 2 - -# Do not delete files more recent than minFileTime (s) -minFileTime: 600 - -# Is migration required before deleting? -migFlag: False - -# Module that will be used to check the migration state of merged files -# Will look for the function MergedNameModule.MergedNameModule -MergedNameModule: None - -## Configuration for MergeModule -MergedModuleConf: {} - -# Perform checksum check (for migrated files only) -checksumCheck: False - -# Max total filesystem usage allowed while waiting for migration (in %) -highCriticMark: 90 - -# Min total filesystem usage allowed while waiting for migration (in %) -lowCriticMark: 80 - -# Low watermark: do not delete if filesystems usage in DirList below threshold (in %) -lowWaterMark: [1,1,1] - -# Sleep timeout (s) before deleting next file in DeleteQueue -DeleteTimeout: 2 - -# Delay before to check if file is migrated to Castor tape (s) -MigDelay: 600 - -########## CHECK THREAD ########## -# Time (s) between checks for partition -CheckTimeout: 1 - -# Timout (s) before adding the ERS handler -ERSTimeout: 10 - -########## DDM MONITORING ########## -DdmMonitoringEnabled: False - -# Timeout for DdmMonitoringThread -DdmMonitoringTimeout: 2 - -# Server to publish DDM monitoring -DdmMonitoringEndpoint: 'https://rucio-lb-prod.cern.ch/traces/' - -# Proxy to reach DdmMonitoringEndpoint -DdmMonitoringProxy: 'atlasgw-exp:3128' - -# Queue between CopyThread and DdmMonitoringThread max size -DdmMonitoringQueueMaxSize: 200 diff --git a/Configs/template.cfg b/Configs/template.cfg index 6a846eff318eaa4f334af46368933db10f885aeb..e491f07b7de5e6f0babbcb9ba5ebed9ec130c623 100644 --- a/Configs/template.cfg +++ b/Configs/template.cfg @@ -1,5 +1,7 @@ ########## HOW TO USE ########## +# This config file is used by tests as well. + # Rename USERNAME with the USERNAME of current user # Rename YOUR@EMAIL.COM # To enable Kerberos AUTH, go uncomment the keytab line (And have your own keytab ready) diff --git a/Configs/test_eosuser_copy_jholm.cfg b/Configs/test_eosstorage.cfg similarity index 100% rename from Configs/test_eosuser_copy_jholm.cfg rename to Configs/test_eosstorage.cfg diff --git a/Test/local.cfg b/DeploymentTest/local.cfg similarity index 100% rename from Test/local.cfg rename to DeploymentTest/local.cfg diff --git a/Test/p1.test.atlascdr.bash b/DeploymentTest/p1.test.atlascdr.bash similarity index 100% rename from Test/p1.test.atlascdr.bash rename to DeploymentTest/p1.test.atlascdr.bash diff --git a/Test/p1.test.user.bash b/DeploymentTest/p1.test.user.bash similarity index 100% rename from Test/p1.test.user.bash rename to DeploymentTest/p1.test.user.bash diff --git a/Test/readme b/DeploymentTest/readme similarity index 53% rename from Test/readme rename to DeploymentTest/readme index 0e5882ed4c3ff37412052130c0547908b0523176..aaa451b00e0ef8c0a52631df8335abf86b075eb5 100644 --- a/Test/readme +++ b/DeploymentTest/readme @@ -20,34 +20,17 @@ git clone https://:@gitlab.cern.ch:8443/atlas-tdaq-software/CastorScript.git cd CastorScript/Test ./p1.test.user.bash pc-tdq-calib-XX -Point 1 Test Cookbook --------------------- -Select an unassigned calibration machine (for example): - https://atlasop.cern.ch/twiki/bin/view/Main/CalibrationFarm -Check that no instance of CastorScript is already on this machine -Copy test version of CastorScript you want to test to P1 -Make it accessible to atlascdr -Login to P1, then on the chosen machine - -sudo -u atlascdr -i -mkdir -p /tmp/atlascdr/logs -for i in `seq 0 9`; do dd if=/dev/zero of=/tmp/atlascdr/dummy$i.data bs=1M count=20; done -cd CastorScript/Test -cp test_config.cfg xxx.cfg -Modify xxx.cfg appropriately -To check files on EOS: xrd eosatlas dirlist /eos/atlas/atlastier0/daq/test/data_test - -source /sw/castor/script_setup.sh -# If you need to have an modified authorization file: -export CORAL_AUTH_PATH="$CORAL_AUTH_PATH:/path/to/CastorScript/coral/" -python -u ../Script/CastorScript.py xxx.cfg +If you need to have an modified authorization file: + source /sw/castor/script_setup.sh + export CORAL_AUTH_PATH="$CORAL_AUTH_PATH:/path/to/CastorScript/coral/" + python -u ../Script/CastorScript.py xxx.cfg +Cleanup after tests: rm -rf /tmp/atlascdr To clean EOS data_test, from lxplus as atlascdr: - xrd eosatlas dirlist /eos/atlas/atlastier0/daq/test/data_test > datatest.ls - awk '{ print $NF }' < datatest.ls > datatest.entries - for i in `cat datatest.entries`; do eos rm -r $i; done - rm datatest.ls datatest.entries + xrdfs eosatlas ls /eos/atlas/atlastier0/daq/test/data_test > datatest.ls + for i in `cat datatest.ls`; do xrdfs eosatlas rm $i; done + rm datatest.ls Testbed ------- @@ -62,5 +45,5 @@ vim xxx.cfg Change CopyDir to a user EOS area Change StageHost: 'eosuser' cm_setup nightly -export PATH=$LCG_INST_PATH/$TDAQ_LCG_RELEASE/xrootd/4.8.4/x86_64-centos7-gcc8-opt/bin:"$PATH" +export PATH="$LCG_INST_PATH/$TDAQ_LCG_RELEASE/xrootd/4.8.4/$CMTCONFIG/bin/:$PATH" python -u ../Script/CastorScript.py xxx.cfg diff --git a/Test/test_config.cfg b/DeploymentTest/test_config.cfg similarity index 100% rename from Test/test_config.cfg rename to DeploymentTest/test_config.cfg diff --git a/Environments/README b/Environments/README deleted file mode 100644 index fa257c2b20a5b631cde121d7a45d6db60500e086..0000000000000000000000000000000000000000 --- a/Environments/README +++ /dev/null @@ -1 +0,0 @@ -Commands and scripts for changing development Environment goes here. \ No newline at end of file diff --git a/tools/castor.checklogs b/ProductionTools/castor.checklogs similarity index 100% rename from tools/castor.checklogs rename to ProductionTools/castor.checklogs diff --git a/tools/castor.eostimeout.freq b/ProductionTools/castor.eostimeout.freq similarity index 100% rename from tools/castor.eostimeout.freq rename to ProductionTools/castor.eostimeout.freq diff --git a/tools/castor.greplogs b/ProductionTools/castor.greplogs similarity index 100% rename from tools/castor.greplogs rename to ProductionTools/castor.greplogs diff --git a/tools/castor.logdir b/ProductionTools/castor.logdir similarity index 100% rename from tools/castor.logdir rename to ProductionTools/castor.logdir diff --git a/tools/castor.logsfreq b/ProductionTools/castor.logsfreq similarity index 100% rename from tools/castor.logsfreq rename to ProductionTools/castor.logsfreq diff --git a/tools/castor.notrunning b/ProductionTools/castor.notrunning similarity index 100% rename from tools/castor.notrunning rename to ProductionTools/castor.notrunning diff --git a/tools/castor.ps b/ProductionTools/castor.ps similarity index 100% rename from tools/castor.ps rename to ProductionTools/castor.ps diff --git a/tools/castor.pslocal b/ProductionTools/castor.pslocal similarity index 100% rename from tools/castor.pslocal rename to ProductionTools/castor.pslocal diff --git a/tools/castor.starttime b/ProductionTools/castor.starttime similarity index 100% rename from tools/castor.starttime rename to ProductionTools/castor.starttime diff --git a/tools/castor.stopall b/ProductionTools/castor.stopall similarity index 100% rename from tools/castor.stopall rename to ProductionTools/castor.stopall diff --git a/tools/check_copied_files_in_eos.sh b/ProductionTools/check_copied_files_in_eos.sh similarity index 100% rename from tools/check_copied_files_in_eos.sh rename to ProductionTools/check_copied_files_in_eos.sh diff --git a/tools/ddm.test.py b/ProductionTools/ddm.test.py similarity index 100% rename from tools/ddm.test.py rename to ProductionTools/ddm.test.py diff --git a/tools/ddmtiming.test.py b/ProductionTools/ddmtiming.test.py similarity index 100% rename from tools/ddmtiming.test.py rename to ProductionTools/ddmtiming.test.py diff --git a/tools/README b/ProductionTools/generate_instance_lists.sh similarity index 77% rename from tools/README rename to ProductionTools/generate_instance_lists.sh index c5138d32678e9fd838b66f8cf03967ec34a057f0..15ee8c3599cf46799e03e43b07e0c9dfbcd88225 100644 --- a/tools/README +++ b/ProductionTools/generate_instance_lists.sh @@ -1,7 +1,7 @@ +#!/usr/bin/env bash find /daq_area/castor/*/atlascdr/ -name '*.cfg' > castor.confs find /mnt/daq_area_rw/castor/*/atlascdr/ -name '*.cfg' > castor.WRITABLE.confs awk -F'/' '{print $4}' < castor.confs | sort | uniq > castor.machines # Machines on which there are several instances -awk -F'/' '{print $4}' < castor.confs | sort | uniq -d - +# awk -F'/' '{print $4}' < castor.confs | sort | uniq -d diff --git a/tools/sfotzdb_reader.py b/ProductionTools/sfotzdb_reader.py similarity index 100% rename from tools/sfotzdb_reader.py rename to ProductionTools/sfotzdb_reader.py diff --git a/tools/sfotzdb_writer.py b/ProductionTools/sfotzdb_writer.py similarity index 100% rename from tools/sfotzdb_writer.py rename to ProductionTools/sfotzdb_writer.py diff --git a/README b/README deleted file mode 100644 index d236dff985a3cc6c8bcbd16da04ca4c30ce35b8a..0000000000000000000000000000000000000000 --- a/README +++ /dev/null @@ -1,36 +0,0 @@ -CastorScript -===== - -Linux (for offline development) ------ - -If the script_setup.sh won't work, try the following commands in a terminal: - -##### Add mailinglogger to the PYTHONPATH -`export PYTHONPATH="$(dirname ${BASH_SOURCE[0]})/mailinglogger":"$PYTHONPATH"` - -##### Edit /Test/local.cfg -**Todo: make script to automate this process** - -###### "LogDir" Where should the log files be saved? -`LogDir: '/tmp/USERNAME/logs/'` - -###### "DirList" Where do you want to copy data FROM?: -`DirList: ['/tmp/USERNAME/src',]` - -###### "CopyDir" Where do you want to copy data TO?: -`CopyDir: '/tmp/USERNAME/dst'` - -###### "Keytab" Disable Kerberos -comment it out, to disable kerberos - -##### How to run it from terminal: -1. `cd PATH/TO/THE/CastorScript` -2. `python Script/CastorScript.py Test/local.cfg` -3. **You should now have the following files in your LogDir**: -.. `CopyLog.out DatabaseLog.out DeleteLog.out mainLog.out ManagerLog.out` - - -##### Notes: List of "weird" resources I don't know how to get to: -+ `/cvmfs/sft.cern.ch/lcg/views/LCG_87/x86_64-slc6-gcc62-opt/setup.sh` -+ `/afs/cern.ch/atlas/project/tdaq/cmake/cmake_tdaq/bin/cm_setup.sh tdaq-07-01-00 x86_64-slc6-gcc62-opt` \ No newline at end of file diff --git a/Script/Tests/TestCases.txt b/Script/Tests/TestCases.txt deleted file mode 100644 index c76219f6c28bcd8e67773f25b784cc7e4de2701e..0000000000000000000000000000000000000000 --- a/Script/Tests/TestCases.txt +++ /dev/null @@ -1,39 +0,0 @@ -# Test cases - -#### Wildcards: -* Connections? - -#### Integration Tests: -I actually don't really know what else to test than P1... - -* P1 Integration test (script Made by Fabrice) - - -#### Functional Tests: - -* Can copy files -* Can produce relevant log files -* Produces appropriate errors - * Maybe wait with this until production of solution -* Makes use of config files in the expected manner (Don't know how) - - -#### Unit Tests: -* Files with the word "Logger" in them (Might be the most important to learn) - * CastorScript.py-(42) - * castorStorage.py-(28) - * eosstorage.py-(20) - * localstorage.py-(17) - * CheckThread.py-(9) - * storagetester.py-(6) - * ~~DDMMigrated.py~~-(5) - * ~~MergedMigrated.py~~-(3) - * CopyThread.py-(2) - * Database.py-(2) - * utils.py-(2) - * DdmMonitoringThread.py-(1) - * DeleteThread.py-(1) - * ManagerThread.py-(1) - -* Filename parsers -* Utilities \ No newline at end of file diff --git a/Script/Tests/Test_BaseFileNameParser.py b/Script/UnitTests/Test_BaseFileNameParser.py similarity index 100% rename from Script/Tests/Test_BaseFileNameParser.py rename to Script/UnitTests/Test_BaseFileNameParser.py diff --git a/Script/Tests/Test_Functional.py b/Script/UnitTests/Test_Functional.py similarity index 96% rename from Script/Tests/Test_Functional.py rename to Script/UnitTests/Test_Functional.py index cc73bcfded132e80606b693a5e5c10a64b241921..f7cd6c080c9376f9f4e5fed6b26b46f6e4b1c22f 100644 --- a/Script/Tests/Test_Functional.py +++ b/Script/UnitTests/Test_Functional.py @@ -11,7 +11,7 @@ if __name__ == '__main__': SCRIPT_DIR = abspath(join(dirname(__file__), '..')) sys.path.append(SCRIPT_DIR) -from Tests.testUtils import DirectoryChecker, findCastorScriptPids +from UnitTests.testUtils import DirectoryChecker, findCastorScriptPids # I'm a developer, I want to see if the script can copy files. class TestCanCopyFilesLocally(unittest.TestCase): @@ -28,11 +28,11 @@ class TestCanCopyFilesLocally(unittest.TestCase): self.thisdir = os.path.dirname(__file__) self.tmp = "tmp" - + self.src = self.tmp + "/src" self.des = self.tmp + "/des" self.log = self.tmp + "/log" - + self.tmpPath = os.path.abspath(os.path.join(self.thisdir, self.tmp)) self.srcPath = os.path.abspath(os.path.join(self.thisdir, self.src)) @@ -53,7 +53,7 @@ class TestCanCopyFilesLocally(unittest.TestCase): os.makedirs(self.srcPath) os.makedirs(self.desPath) os.makedirs(self.logPath) - except: + except: shutil.rmtree(self.tmpPath) os.makedirs(self.srcPath) os.makedirs(self.desPath) @@ -95,13 +95,13 @@ class TestCanCopyFilesLocally(unittest.TestCase): # Run the script with config #NON SHELL - + #self.castorscriptprocess = Popen(scriptcommand) scriptcommand = ["python", self.thisdir + "/../CastorScript.py", self.tmpPath + "/funcTestConf.cfg" ] self.castorscriptprocess = Popen(scriptcommand) #Run in shell #self.castorscriptprocess = Popen("python " + self.thisdir + "/../CastorScript.py " + self.tmpPath + "/funcTestConf.cfg", shell=True) - # To kill the process for debugging + # To kill the process for debugging #self.castorscriptprocess.kill() @classmethod @@ -149,14 +149,14 @@ class TestCanCopyFilesLocally(unittest.TestCase): def test_E_src_files_should_be_deleted(self): self.timeToTimeout = 5 self.srcDirUtil.waitForEmptyDir(self.timeToTimeout) - + self.timeout = self.srcDirUtil.timerUtil.timedout output = self.srcDirUtil.lsOutput timeoutMessage = "Timeout, found no empty dir within a timeframe of " + str(self.timeToTimeout) + " seconds" - + self.assertFalse(self.timeout, msg=timeoutMessage) self.assertTrue(output.find("file") == -1, msg="No files ending with .out found in log directory, found:" + output) if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/Script/Tests/__init__.py b/Script/UnitTests/__init__.py similarity index 100% rename from Script/Tests/__init__.py rename to Script/UnitTests/__init__.py diff --git a/Script/Tests/testUtils.py b/Script/UnitTests/testUtils.py similarity index 100% rename from Script/Tests/testUtils.py rename to Script/UnitTests/testUtils.py diff --git a/Script/cs/StorageBackends/castorstorage.py b/Script/cs/StorageBackends/castorstorage.py index cdf6bc178bf02bc42592cbd4ba1749c851d7ff24..d38ff186f0d3322dac2ebe05876ddbb2b89bb9b0 100644 --- a/Script/cs/StorageBackends/castorstorage.py +++ b/Script/cs/StorageBackends/castorstorage.py @@ -155,6 +155,6 @@ if __name__=='__main__': # add /../../CastorScript/Script to path so imports keeps working SCRIPT_DIR = abspath(join(dirname(__file__), '..','..')) sys.path.append(SCRIPT_DIR) - - import cs.Tools.storagetester as storagetester + + import cs.StorageBackends.storagetester as storagetester storagetester.execute(sys.modules[__name__]) diff --git a/Script/cs/StorageBackends/eosstorage.py b/Script/cs/StorageBackends/eosstorage.py index 4d8735989c233b3509f98c4170d5d6da7bb0713a..65e20e260adc7b4987875dfa212a8e0bfd321f0a 100644 --- a/Script/cs/StorageBackends/eosstorage.py +++ b/Script/cs/StorageBackends/eosstorage.py @@ -152,5 +152,5 @@ copystate = castorstorage.copystate copystdout = castorstorage.copystdout if __name__=='__main__': - import cs.Tools.storagetester as storagetester - storagetester.execute(sys.modules[__name__]) \ No newline at end of file + import cs.StorageBackends.storagetester as storagetester + storagetester.execute(sys.modules[__name__]) diff --git a/Script/cs/StorageBackends/localstorage.py b/Script/cs/StorageBackends/localstorage.py index 2c2078d5c75fd95e25007d0df8aac8e1298e9c0e..c6a095220f2903274af38f217805820d4ff43382 100644 --- a/Script/cs/StorageBackends/localstorage.py +++ b/Script/cs/StorageBackends/localstorage.py @@ -102,8 +102,6 @@ def copystdout(proc): if __name__=='__main__': - import sys - import cs.Tools.storagetester as storagetester - + import cs.StorageBackends.storagetester as storagetester storagetester.execute(sys.modules[__name__]) diff --git a/Script/cs/Tools/storagetester.py b/Script/cs/StorageBackends/storagetester.py similarity index 100% rename from Script/cs/Tools/storagetester.py rename to Script/cs/StorageBackends/storagetester.py diff --git a/readme b/readme new file mode 100644 index 0000000000000000000000000000000000000000..9d4edf04649e5ca2d4ca91a88cd8cb7f81ed1b3e --- /dev/null +++ b/readme @@ -0,0 +1,17 @@ +This is the software that transfers file from ATLAS online infrastructure to +offline storage. The name, CastorScript, has historical reasons: it used to copy +files directly to the CASTOR system (it does not anymore). + +Contents + Configs: reference, template and test configs + DeploymentTest: deployment test + Script: the actual code + ProductionTools: set of Bash and Python scripts used on the production system to + ease maintenance tasks + + pylintrc: configuration of pylint (used by CI) + readme: this file (are you even following?) + run_unit_tests.sh: script to search and run Python unit tests + script_setup.sh: script used in P1 to setup the running environment + watchdog.sh: script called by sysadmin's cron task that starts and maintains + CastorScript instance up and running. Also handles log turn over. diff --git a/runtests.sh b/run_unit_tests.sh similarity index 57% rename from runtests.sh rename to run_unit_tests.sh index 14ebd6ebdeb23c52659e19537b0b48fcf5f8a6bb..100fb8037ef4ab59aeeaf3fc802a7d9c0ca1692c 100755 --- a/runtests.sh +++ b/run_unit_tests.sh @@ -1,6 +1,5 @@ #!/bin/bash TOPDIR=$(cd `dirname $0` && echo `pwd`"/Script" ) -STARTDIR=$(echo $TOPDIR"/Tests") +STARTDIR=$(echo $TOPDIR"/UnitTests") python -m unittest discover -t $TOPDIR -s $STARTDIR -p "Test_*.py" -f -#python -m unittest discover "CastorScript/Script/" "Test_Bas*.py" diff --git a/watchdog.sh b/watchdog.sh index 9791eafa969a0fb681f11eca0c37836d04012bb5..ee3402546b406fc28051896a85c8ffa260f168df 100755 --- a/watchdog.sh +++ b/watchdog.sh @@ -27,11 +27,7 @@ for cfg in $CONFDIR/*.cfg; do find $logdir -maxdepth 1 -name logbackup\* -printf "%T@ %p\n" | sort -n | head -n -5 | awk '{print $2}' | xargs rm -rf # Source required environment - if [ $(uname -i) == i386 ];then - source $SWDIR/script_setup32.sh - else - source $SWDIR/script_setup.sh - fi + source $SWDIR/script_setup.sh # Start script python -u $SWDIR/Script/CastorScript.py $cfg > $logdir/log.out 2>&1 &