Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def jobexec(jobxml, wfParameters):
sys.exit(1)
workflow = fromXMLFile(jobfile)
gLogger.debug(workflow)
code = workflow.createCode()
gLogger.debug(code)
jobID = 0
if "JOBID" in os.environ:
jobID = os.environ["JOBID"]
Expand Down
29 changes: 29 additions & 0 deletions tests/System/test_wf_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python
# Test the possibility to use general workflow parameters as variables
# in the job description

import subprocess
import shlex
import sys
from pathlib import Path
from DIRAC.Interfaces.API.Job import Job

job = Job()

job.setExecutable("/bin/ls")
job.setExecutable("/bin/echo", arguments="@{InputData}")

file = Path("jobDescription.xml")
file.write_text(job.workflow.toXML())

status = subprocess.call(shlex.split("dirac-jobexec jobDescription.xml -p InputData='{input_file_1,input_file_2}'"))
if status:
sys.exit(status)

file = Path("Script2_echo.log")
content = file.read_text()
if not "input_file_1;input_file_2" in content:
print("Test failed !")
sys.exit(-1)

print("Test successful !")
1 change: 1 addition & 0 deletions tests/System/wms_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ declare -a commands=(
'dirac-wms-get-normalized-queue-length ce503.cern.ch/condor'
'dirac-wms-get-queue-normalization ce503.cern.ch/condor'
'dirac-wms-select-jobs --Status=Running'
'test_wf_job.py'
)

echo " "
Expand Down
Loading