Skip to content

Commit 5590ca0

Browse files
fstagniweb-flow
authored andcommitted
sweep: #6547 test: fix: use dirac-admin-get-proxy
1 parent 97fd32c commit 5590ca0

File tree

10 files changed

+14
-72
lines changed

10 files changed

+14
-72
lines changed

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ python_files=Test_*.py assert*.py
66
# in order to make sure that M2Crypto and pyGSI do not step
77
# on each other's feet
88
addopts = --no-cov -rx -v --color=yes --showlocals --tb=long --ignore=tests
9+
markers =
10+
slow: marks tests as slow (deselect with '-m "not slow"')

src/DIRAC/Core/Base/Script.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def __call__(self, func=None):
3838
"""Set the wrapped function or call the script
3939
4040
This function is either called with a decorator or directly to call the
41-
underlying function. When running with Python 2 the raw function will always
42-
be called however in Python 3 the priorities will be applied from the
41+
underlying function. The priorities will be applied from the
4342
dirac.extension_metadata entry_point.
4443
"""
4544
# If func is provided then the decorator is being applied to a function

src/DIRAC/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ def initialize(
244244
message = '/DIRAC/Setup is not defined. Have you ran "dirac-configure"?'
245245
if require_auth:
246246
raise exceptions.NotConfiguredError(message)
247-
else:
248-
warnings.warn(message, exceptions.DiracWarning)
247+
warnings.warn(message, exceptions.DiracWarning)
249248

250249
if require_auth:
251250
retVal = S_ERROR("No configuration servers found")

src/DIRAC/tests/Workflow/Integration/exe-script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# Main
88
if __name__ == "__main__":
99

10-
sys.exit(subprocess.call(shlex.split("echo Hello World")))
10+
sys.exit(subprocess.call(shlex.split("echo 'Hello World'")))

tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_SSCChain():
7272

7373
jobId = 1
7474

75-
exeScriptLocation = find_all("exe-script.py", "..", "/DIRAC/tests/Integration")[0]
75+
exeScriptLocation = find_all("exe-script.py", "../..", "/DIRAC/tests/Integration")[0]
7676
fileList = [exeScriptLocation]
7777

7878
res = ssc.uploadFilesAsSandbox(fileList)

tests/Integration/WorkloadManagementSystem/exe-script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# Main
88
if __name__ == "__main__":
99

10-
sys.exit(subprocess.call(shlex.split("echo Hello World")))
10+
sys.exit(subprocess.call(shlex.split("echo 'Hello World'")))

tests/Integration/WorkloadManagementSystem/inputsandbox/exe-script.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/Jenkins/dirac-proxy-download.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

tests/Jenkins/dirac-test-job.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
def base():
2929
job = Job()
30-
job.setName("helloWorld-TEST-TO-Jenkins")
3130
executablePath = find_all("exe-script.py", "..", "/DIRAC/tests/Workflow/")[0]
3231
job.setInputSandbox([executablePath])
3332
job.setExecutable(executablePath, "", "helloWorld.log")
@@ -41,6 +40,7 @@ def helloJob():
4140
"""Simple Hello Word job to DIRAC.Jenkins.ch"""
4241
gLogger.info("\n Submitting hello world job targeting DIRAC.Jenkins.ch")
4342
job = base()
43+
job.setName("helloWorld-Jenkins_base")
4444
result = dirac.submitJob(job)
4545
gLogger.info("Hello world job: ", result)
4646
if not result["OK"]:
@@ -52,6 +52,7 @@ def helloMP():
5252
"""Simple Hello Word job to DIRAC.Jenkins.ch, that needs to be matched by a MP WN"""
5353
gLogger.info("\n Submitting hello world job targeting DIRAC.Jenkins.ch and a MP WN")
5454
job = base()
55+
job.setName("helloWorld-Jenkins_MP")
5556
job.setNumberOfProcessors(2)
5657
result = dirac.submitJob(job)
5758
gLogger.info("Hello world job MP: ", result)

tests/Jenkins/utilities.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ submitJob() {
299299
set -e
300300
fi
301301

302-
cp "${TESTCODE}/DIRAC/tests/Jenkins/dirac-proxy-download.py" "."
303-
python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True -o /DIRAC/Security/CertFile=/home/dirac/certs/hostcert.pem -o /DIRAC/Security/KeyFile=/home/dirac/certs/hostkey.pem -o /DIRAC/Setup="${DIRACSETUP}" -ddd
302+
dirac-admin-get-proxy "${DIRACUSERDN}" "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True -o /DIRAC/Security/CertFile=/home/dirac/certs/hostcert.pem -o /DIRAC/Security/KeyFile=/home/dirac/certs/hostkey.pem -o /DIRAC/Setup="${DIRACSETUP}" --out="/tmp/x509up_u${UID}" -ddd
304303
if [[ -f "${TESTCODE}/${VO}DIRAC/tests/Jenkins/dirac-test-job.py" ]]; then
305304
cp "${TESTCODE}/${VO}DIRAC/tests/Jenkins/dirac-test-job.py" "."
306305
else
@@ -959,19 +958,17 @@ startRunsv(){
959958
downloadProxy() {
960959
echo '==> [downloadProxy]'
961960

962-
cp "${TESTCODE}/DIRAC/tests/Jenkins/dirac-proxy-download.py" .
963-
964961
if [[ "${PILOTCFG}" ]]; then
965962
if [[ -e "${CLIENTINSTALLDIR}/diracos/etc/dirac.cfg" ]]; then # called from the py3 client directory
966-
python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${CLIENTINSTALLDIR}/diracos/etc/dirac.cfg" "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}"
963+
dirac-admin-get-proxy "${DIRACUSERDN}" "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${CLIENTINSTALLDIR}/diracos/etc/dirac.cfg" "${PILOTINSTALLDIR}/$PILOTCFG" --out="/tmp/x509up_u${UID}" "${DEBUG}"
967964
else # assuming it's the pilot
968-
python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}"
965+
dirac-admin-get-proxy "${DIRACUSERDN}" "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${PILOTINSTALLDIR}/$PILOTCFG" --out="/tmp/x509up_u${UID}" "${DEBUG}"
969966
fi
970967
else
971968
if [[ -e "${CLIENTINSTALLDIR}/diracos/etc/dirac.cfg" ]]; then # called from the py3 client directory
972-
python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${CLIENTINSTALLDIR}/diracos/etc/dirac.cfg" "${PILOTINSTALLDIR}/$PILOTCFG" "${DEBUG}"
969+
dirac-admin-get-proxy "${DIRACUSERDN}" "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${CLIENTINSTALLDIR}/diracos/etc/dirac.cfg" "${PILOTINSTALLDIR}/etc/dirac.cfg" --out="/tmp/x509up_u${UID}" "${DEBUG}"
973970
else # assuming it's the pilot
974-
python dirac-proxy-download.py "${DIRACUSERDN}" -R "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${PILOTINSTALLDIR}/etc/dirac.cfg" "${DEBUG}"
971+
dirac-admin-get-proxy "${DIRACUSERDN}" "${DIRACUSERROLE}" -o /DIRAC/Security/UseServerCertificate=True --cfg "${PILOTINSTALLDIR}/etc/dirac.cfg" --out="/tmp/x509up_u${UID}" "${DEBUG}"
975972
fi
976973
fi
977974

0 commit comments

Comments
 (0)