Commit 0d2212ca authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova Committed by Robert Schmidt

CI: Extend Custom_Script to accept arguments

parent 1dca20ba
...@@ -233,10 +233,10 @@ def Custom_Command(HTML, node, command): ...@@ -233,10 +233,10 @@ def Custom_Command(HTML, node, command):
HTML.CreateHtmlTestRowQueue(command, status, message) HTML.CreateHtmlTestRowQueue(command, status, message)
return status == 'OK' or status == 'Warning' return status == 'OK' or status == 'Warning'
def Custom_Script(HTML, node, script): def Custom_Script(HTML, node, script, args):
logging.info(f"Executing custom script on {node}") logging.info(f"Executing custom script on {node}")
with cls_cmd.getConnection(node) as c: with cls_cmd.getConnection(node) as c:
ret = c.exec_script(script, 90) ret = c.exec_script(script, 90, args)
logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}") logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}")
status = 'OK' status = 'OK'
message = [ret.stdout] message = [ret.stdout]
......
...@@ -328,9 +328,10 @@ def ExecuteActionWithParam(action, ctx): ...@@ -328,9 +328,10 @@ def ExecuteActionWithParam(action, ctx):
elif action == 'Custom_Script': elif action == 'Custom_Script':
node = test.findtext('node') node = test.findtext('node')
script = test.findtext('script') script = test.findtext('script')
args = test.findtext('args')
# Allow referencing repository workspace path in XML via %%workspace%% # Allow referencing repository workspace path in XML via %%workspace%%
script = script.replace("%%workspace%%", CONTAINERS.eNBSourceCodePath) script = script.replace("%%workspace%%", CONTAINERS.eNBSourceCodePath)
success = cls_oaicitest.Custom_Script(HTML, node, script) success = cls_oaicitest.Custom_Script(HTML, node, script, args)
elif action == 'Pull_Cluster_Image': elif action == 'Pull_Cluster_Image':
tag_prefix = test.findtext('tag_prefix') or "" tag_prefix = test.findtext('tag_prefix') or ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment