From 564cb131d2d6ddbd6e5f8a5a72113044a7d77acd Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Tue, 21 Jul 2020 13:24:29 +0200 Subject: [PATCH 1/2] ComponentInstaller uses --cfg --- FrameworkSystem/Client/ComponentInstaller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FrameworkSystem/Client/ComponentInstaller.py b/FrameworkSystem/Client/ComponentInstaller.py index 764bb0a4d72..ef90a4d9621 100644 --- a/FrameworkSystem/Client/ComponentInstaller.py +++ b/FrameworkSystem/Client/ComponentInstaller.py @@ -1910,7 +1910,8 @@ def installComponent(self, componentType, system, component, extensions, compone [[ "%(componentType)s" = "agent" ]] && renice 20 -p $$ #%(bashVariables)s # -exec python $DIRAC/DIRAC/Core/scripts/dirac-%(componentType)s.py %(system)s/%(component)s %(componentCfg)s < /dev/null +exec python $DIRAC/DIRAC/Core/scripts/dirac-%(componentType)s.py \ + %(system)s/%(component)s --cfg %(componentCfg)s < /dev/null """ % {'bashrc': os.path.join(self.instancePath, 'bashrc'), 'bashVariables': bashVars, 'componentType': componentType, From a68d268d00d9cecd4c5f5929e1d3b636ef15f9dd Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Tue, 28 Jul 2020 11:44:28 +0200 Subject: [PATCH 2/2] Tests: use --cfg --- .../WorkloadManagementSystem/Test_TimeLeft.sh | 6 +++--- .../WorkloadManagementSystem/Test_dirac-jobexec.sh | 10 +++++----- tests/Integration/all_integration_client_tests.sh | 2 +- tests/Integration/all_integration_server_tests.sh | 2 +- tests/Jenkins/dirac_ci.sh | 2 +- tests/Jenkins/utilities.sh | 10 +++++----- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/Integration/WorkloadManagementSystem/Test_TimeLeft.sh b/tests/Integration/WorkloadManagementSystem/Test_TimeLeft.sh index 4ba69fab49d..65264fc3194 100755 --- a/tests/Integration/WorkloadManagementSystem/Test_TimeLeft.sh +++ b/tests/Integration/WorkloadManagementSystem/Test_TimeLeft.sh @@ -19,7 +19,7 @@ fi ############################################################################### # Can't find anywhere a batch plugin, not even MJF -$DIRACSCRIPTS/dirac-wms-get-queue-cpu-time $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-wms-get-queue-cpu-time --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 0 ]]; then echo -e "\nSuccess\n\n" @@ -35,7 +35,7 @@ fi export MACHINEFEATURES=$DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/sb.cfg export JOBFEATURES=$DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/sb.cfg -$DIRACSCRIPTS/dirac-wms-get-queue-cpu-time $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-wms-get-queue-cpu-time --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 0 ]]; then echo -e "\nSuccess\n\n" @@ -51,7 +51,7 @@ fi export MACHINEFEATURES=$DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/MJF/ export JOBFEATURES=$DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/MJF/ -$DIRACSCRIPTS/dirac-wms-get-queue-cpu-time $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-wms-get-queue-cpu-time --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 0 ]]; then echo -e "\nSuccess\n\n" diff --git a/tests/Integration/WorkloadManagementSystem/Test_dirac-jobexec.sh b/tests/Integration/WorkloadManagementSystem/Test_dirac-jobexec.sh index 14a58aea1c2..7b7204167fe 100755 --- a/tests/Integration/WorkloadManagementSystem/Test_dirac-jobexec.sh +++ b/tests/Integration/WorkloadManagementSystem/Test_dirac-jobexec.sh @@ -21,7 +21,7 @@ python $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/createJobXMLDescr # Running the real tests # OK -$DIRACSCRIPTS/dirac-jobexec jobDescription-OK.xml $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-jobexec jobDescription-OK.xml --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 0 ]]; then echo -e "\nSuccess\n\n" else @@ -30,7 +30,7 @@ else fi # OK2 -$DIRACSCRIPTS/dirac-jobexec jobDescription-OK-multiSteps.xml $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-jobexec jobDescription-OK-multiSteps.xml --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 0 ]]; then echo -e "\nSuccess\n\n" else @@ -40,7 +40,7 @@ fi # FAIL -$DIRACSCRIPTS/dirac-jobexec jobDescription-FAIL.xml $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-jobexec jobDescription-FAIL.xml --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 111 ]]; then echo -e "\nSuccess\n\n" else @@ -49,7 +49,7 @@ else fi # FAIL2 -$DIRACSCRIPTS/dirac-jobexec jobDescription-FAIL-multiSteps.xml $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-jobexec jobDescription-FAIL-multiSteps.xml --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 111 ]]; then echo -e "\nSuccess\n\n" else @@ -59,7 +59,7 @@ fi # FAIL with exit code > 255 -$DIRACSCRIPTS/dirac-jobexec jobDescription-FAIL1502.xml $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG +$DIRACSCRIPTS/dirac-jobexec jobDescription-FAIL1502.xml --cfg $DIRAC/DIRAC/tests/Integration/WorkloadManagementSystem/pilot.cfg $DEBUG if [[ "${?}" -eq 222 ]]; then # This is 1502 & 255 (0xDE) echo -e "\nSuccess\n\n" else diff --git a/tests/Integration/all_integration_client_tests.sh b/tests/Integration/all_integration_client_tests.sh index 0d9cc956c90..b397fa5a89e 100644 --- a/tests/Integration/all_integration_client_tests.sh +++ b/tests/Integration/all_integration_client_tests.sh @@ -44,7 +44,7 @@ pytest "${CLIENTINSTALLDIR}/DIRAC/tests/Integration/ResourceStatusSystem/Test_Pu #-------------------------------------------------------------------------------# echo -e "*** $(date -u) **** WMS TESTS ****\n" # pytest "${CLIENTINSTALLDIR}"/DIRAC/tests/Integration/WorkloadManagementSystem/Test_PilotsLoggingClient.py |& tee -a clientTestOutputs.txt -python "${CLIENTINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py" "$WORKSPACE/TestCode/DIRAC/tests/Integration/WorkloadManagementSystem/sb.cfg" |& tee -a clientTestOutputs.txt; (( ERR |= "${?}" )) +python "${CLIENTINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py" --cfg "$WORKSPACE/TestCode/DIRAC/tests/Integration/WorkloadManagementSystem/sb.cfg" |& tee -a clientTestOutputs.txt; (( ERR |= "${?}" )) pytest "${CLIENTINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_JobWrapper.py" |& tee -a clientTestOutputs.txt; (( ERR |= "${?}" )) pytest "${CLIENTINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_PilotsClient.py" |& tee -a clientTestOutputs.txt; (( ERR |= "${?}" )) diff --git a/tests/Integration/all_integration_server_tests.sh b/tests/Integration/all_integration_server_tests.sh index 940fb537686..141130a695b 100644 --- a/tests/Integration/all_integration_server_tests.sh +++ b/tests/Integration/all_integration_server_tests.sh @@ -35,7 +35,7 @@ pytest "${SERVERINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Tes pytest "${SERVERINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_TaskQueueDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" )) pytest "${SERVERINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_ElasticJobDB.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" )) pytest "${SERVERINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_JobParameters_MySQLandES.py" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" )) -python "${SERVERINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py" "${WORKSPACE}/TestCode/DIRAC/tests/Integration/WorkloadManagementSystem/sb.cfg" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" )) +python "${SERVERINSTALLDIR}/DIRAC/tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py" --cfg "${WORKSPACE}/TestCode/DIRAC/tests/Integration/WorkloadManagementSystem/sb.cfg" |& tee -a "${SERVER_TEST_OUTPUT}"; (( ERR |= "${?}" )) #-------------------------------------------------------------------------------# echo -e "*** $(date -u) **** DMS TESTS ****\n" diff --git a/tests/Jenkins/dirac_ci.sh b/tests/Jenkins/dirac_ci.sh index 9e3472802fc..0e4f781a3b6 100644 --- a/tests/Jenkins/dirac_ci.sh +++ b/tests/Jenkins/dirac_ci.sh @@ -153,7 +153,7 @@ installSite() { echo "==> Done installing, now configuring" source "${SERVERINSTALLDIR}/bashrc" - if ! dirac-configure "${SERVERINSTALLDIR}/install.cfg" "${DEBUG}"; then + if ! dirac-configure --cfg "${SERVERINSTALLDIR}/install.cfg" "${DEBUG}"; then echo "ERROR: dirac-configure failed" >&2 exit 1 fi diff --git a/tests/Jenkins/utilities.sh b/tests/Jenkins/utilities.sh index ee1a1b9292d..3915eea2ae9 100644 --- a/tests/Jenkins/utilities.sh +++ b/tests/Jenkins/utilities.sh @@ -398,7 +398,7 @@ getUserProxy() { echo '==> Started getUserProxy' cp "${TESTCODE}/DIRAC/tests/Jenkins/dirac-cfg-update.py" "." - if ! python dirac-cfg-update.py -S "${DIRACSETUP}" "${CLIENTINSTALLDIR}/etc/dirac.cfg" -F "${CLIENTINSTALLDIR}/etc/dirac.cfg" -o /DIRAC/Security/UseServerCertificate=True -o /DIRAC/Security/CertFile=/home/dirac/certs/hostcert.pem -o /DIRAC/Security/KeyFile=/home/dirac/certs/hostkey.pem "${DEBUG}"; then + if ! python dirac-cfg-update.py -S "${DIRACSETUP}" --cfg "${CLIENTINSTALLDIR}/etc/dirac.cfg" -F "${CLIENTINSTALLDIR}/etc/dirac.cfg" -o /DIRAC/Security/UseServerCertificate=True -o /DIRAC/Security/CertFile=/home/dirac/certs/hostcert.pem -o /DIRAC/Security/KeyFile=/home/dirac/certs/hostkey.pem "${DEBUG}"; then echo 'ERROR: dirac-cfg-update failed' >&2 exit 1 fi @@ -1025,15 +1025,15 @@ downloadProxy() { if [[ "${PILOTCFG}" ]]; then if [[ -e "${CLIENTINSTALLDIR}/etc/dirac.cfg" ]]; then # called from the client directory - python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True "${CLIENTINSTALLDIR}/etc/dirac.cfg" "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}" + python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${CLIENTINSTALLDIR}/etc/dirac.cfg" "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}" else # assuming it's the pilot - python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}" + python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}" fi else if [[ -e "${CLIENTINSTALLDIR}/etc/dirac.cfg" ]]; then # called from the client directory - python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True "${CLIENTINSTALLDIR}/etc/dirac.cfg" "${DEBUG}" + python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${CLIENTINSTALLDIR}/etc/dirac.cfg" "${DEBUG}" else # assuming it's the pilot - python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True "${PILOTINSTALLDIR}/etc/dirac.cfg" "${DEBUG}" + python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${PILOTINSTALLDIR}/etc/dirac.cfg" "${DEBUG}" fi fi