Commit 0e23b795 authored by Robert Schmidt's avatar Robert Schmidt

CI: use Custom_Script to execute SR-IOV/setup scripts for FHI72 pipeline

parent 5ee9e20f
......@@ -239,6 +239,19 @@ def Custom_Command(HTML, node, command, command_fail):
HTML.CreateHtmlTestRowQueue(command, status, message)
return status == 'OK' or status == 'Warning'
def Custom_Script(HTML, node, script, command_fail):
logging.info(f"Executing custom script on {node}")
ret = cls_cmd.runScript(node, script, 90)
logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}")
status = 'OK'
message = [ret.stdout]
if ret.returncode != 0 and not command_fail:
status = 'Warning'
if ret.returncode != 0 and command_fail:
status = 'KO'
HTML.CreateHtmlTestRowQueue(script, status, message)
return status == 'OK' or status == 'Warning'
def IdleSleep(HTML, idle_sleep_time):
time.sleep(idle_sleep_time)
HTML.CreateHtmlTestRow(f"{idle_sleep_time} sec", 'OK', CONST.ALL_PROCESSES_OK)
......
......@@ -428,6 +428,12 @@ def ExecuteActionWithParam(action):
command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
success = cls_oaicitest.Custom_Command(HTML, node, command, command_fail)
elif action == 'Custom_Script':
node = test.findtext('node')
script = test.findtext('script')
command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
success = cls_oaicitest.Custom_Script(HTML, node, script, command_fail)
elif action == 'Pull_Cluster_Image':
string_field = test.findtext('images_to_pull')
if (string_field is not None):
......
......@@ -42,4 +42,5 @@
- Pull_Local_Registry
- Clean_Test_Server_Images
- Custom_Command
- Custom_Script
- Create_Workspace
......@@ -45,10 +45,10 @@
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="200000">
<class>Custom_Command</class>
<class>Custom_Script</class>
<desc>Setup sriov and network interfaces VVDN</desc>
<node>cacofonix</node>
<command>/opt/FHI7.2/setup_sriov_vvdn.sh</command>
<script>yaml_files/sa_fhi_7.2_vvdn_gnb/setup_sriov_vvdn.sh</script>
<command_fail>yes</command_fail>
</testCase>
......@@ -157,11 +157,11 @@
</testCase>
<testCase id="888888">
<class>Custom_Command</class>
<class>Custom_Script</class>
<always_exec>true</always_exec>
<desc>Set CPU to idle state, set kernel parameters to default values</desc>
<node>cacofonix</node>
<command>/opt/FHI7.2/setup_cleanup.sh</command>
<script>yaml_files/sa_fhi_7.2_vvdn_gnb/setup_cleanup.sh</script>
<command_fail>yes</command_fail>
</testCase>
......
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