CI: use Custom_Script to execute SR-IOV/setup scripts for FHI72 pipeline
This commit is contained in:
@@ -239,6 +239,19 @@ def Custom_Command(HTML, node, command, command_fail):
|
|||||||
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, 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):
|
def IdleSleep(HTML, idle_sleep_time):
|
||||||
time.sleep(idle_sleep_time)
|
time.sleep(idle_sleep_time)
|
||||||
HTML.CreateHtmlTestRow(f"{idle_sleep_time} sec", 'OK', CONST.ALL_PROCESSES_OK)
|
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']
|
command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
|
||||||
success = cls_oaicitest.Custom_Command(HTML, node, command, command_fail)
|
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':
|
elif action == 'Pull_Cluster_Image':
|
||||||
string_field = test.findtext('images_to_pull')
|
string_field = test.findtext('images_to_pull')
|
||||||
if (string_field is not None):
|
if (string_field is not None):
|
||||||
|
|||||||
@@ -42,4 +42,5 @@
|
|||||||
- Pull_Local_Registry
|
- Pull_Local_Registry
|
||||||
- Clean_Test_Server_Images
|
- Clean_Test_Server_Images
|
||||||
- Custom_Command
|
- Custom_Command
|
||||||
|
- Custom_Script
|
||||||
- Create_Workspace
|
- Create_Workspace
|
||||||
|
|||||||
@@ -45,10 +45,10 @@
|
|||||||
<TestCaseExclusionList></TestCaseExclusionList>
|
<TestCaseExclusionList></TestCaseExclusionList>
|
||||||
|
|
||||||
<testCase id="200000">
|
<testCase id="200000">
|
||||||
<class>Custom_Command</class>
|
<class>Custom_Script</class>
|
||||||
<desc>Setup sriov and network interfaces VVDN</desc>
|
<desc>Setup sriov and network interfaces VVDN</desc>
|
||||||
<node>cacofonix</node>
|
<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>
|
<command_fail>yes</command_fail>
|
||||||
</testCase>
|
</testCase>
|
||||||
|
|
||||||
@@ -157,11 +157,11 @@
|
|||||||
</testCase>
|
</testCase>
|
||||||
|
|
||||||
<testCase id="888888">
|
<testCase id="888888">
|
||||||
<class>Custom_Command</class>
|
<class>Custom_Script</class>
|
||||||
<always_exec>true</always_exec>
|
<always_exec>true</always_exec>
|
||||||
<desc>Set CPU to idle state, set kernel parameters to default values</desc>
|
<desc>Set CPU to idle state, set kernel parameters to default values</desc>
|
||||||
<node>cacofonix</node>
|
<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>
|
<command_fail>yes</command_fail>
|
||||||
</testCase>
|
</testCase>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user