diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 0db451b63c..4e13cdf7b3 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -34,7 +34,6 @@ import time import os import cls_oai_html -import cls_analysis import constants as CONST import helpreadme as HELP import cls_containerize @@ -417,29 +416,3 @@ class Cluster: c.run(f'cp -r {ctx.logPath} {os.getcwd()}/test_log_{ctx.test_id}/') return status - - def deploy_oc_physim(self, ctx, HTML, node, workdir, script, options): - logging.debug(f'Running physims from server: {node}') - with cls_cmd.getConnection(node) as c: - ret = c.exec_script(script, 600, options) - logging.debug(f'"{script}" finished with code {ret.returncode}, output:\n{ret.stdout}') - with cls_cmd.getConnection(node) as ssh: - details_json = archiveArtifact(ssh, ctx, f'{workdir}/desc-tests.json') - result_junit = archiveArtifact(ssh, ctx, f'{workdir}/results-run.xml') - archiveArtifact(ssh, ctx, f'{workdir}/physim_log.txt') - archiveArtifact(ssh, ctx, f'{workdir}/LastTestsFailed.log') - archiveArtifact(ssh, ctx, f'{workdir}/LastTest.log') - test_status, test_summary, test_result = cls_analysis.Analysis.analyze_oc_physim(result_junit, details_json, ctx.logPath) - if test_summary: - if test_status: - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - HTML.CreateHtmlTestRowPhySimTestResult(test_summary, test_result) - logging.info('\u001B[1m Physical Simulator Pass\u001B[0m') - else: - HTML.CreateHtmlTestRowQueue('At least one physical simulator test failed!', 'KO', ["See below for details"]) - HTML.CreateHtmlTestRowPhySimTestResult(test_summary, test_result) - logging.error('\u001B[1m Physical Simulator Fail\u001B[0m') - else: - HTML.CreateHtmlTestRowQueue('Physical simulator failed', 'KO', [test_result]) - logging.error('\u001B[1m Physical Simulator Fail\u001B[0m') - return test_status diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 623bf3e5bf..69a06f906b 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -46,6 +46,7 @@ import constants as CONST import cls_module import cls_corenetwork +import cls_analysis import cls_cmd from cls_ci_helper import archiveArtifact @@ -250,6 +251,32 @@ def IdleSleep(HTML, idle_sleep_time): HTML.CreateHtmlTestRow(f"{idle_sleep_time} sec", 'OK', CONST.ALL_PROCESSES_OK) return True +def Deploy_Physim(ctx, HTML, node, workdir, script, options): + logging.debug(f'Running physims on server {node} workdir {workdir}') + with cls_cmd.getConnection(node) as c: + ret = c.exec_script(script, 600, options) + logging.debug(f'"{script}" finished with code {ret.returncode}, output:\n{ret.stdout}') + with cls_cmd.getConnection(node) as ssh: + details_json = archiveArtifact(ssh, ctx, f'{workdir}/desc-tests.json') + result_junit = archiveArtifact(ssh, ctx, f'{workdir}/results-run.xml') + archiveArtifact(ssh, ctx, f'{workdir}/physim_log.txt') + archiveArtifact(ssh, ctx, f'{workdir}/LastTestsFailed.log') + archiveArtifact(ssh, ctx, f'{workdir}/LastTest.log') + test_status, test_summary, test_result = cls_analysis.Analysis.analyze_oc_physim(result_junit, details_json, ctx.logPath) + if test_summary: + if test_status: + HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRowPhySimTestResult(test_summary, test_result) + logging.info('\u001B[1m Physical Simulator Pass\u001B[0m') + else: + HTML.CreateHtmlTestRowQueue('At least one physical simulator test failed!', 'KO', ["See below for details"]) + HTML.CreateHtmlTestRowPhySimTestResult(test_summary, test_result) + logging.error('\u001B[1m Physical Simulator Fail\u001B[0m') + else: + HTML.CreateHtmlTestRowQueue('Physical simulator failed', 'KO', [test_result]) + logging.error('\u001B[1m Physical Simulator Fail\u001B[0m') + return test_status + #----------------------------------------------------------- # OaiCiTest Class Definition #----------------------------------------------------------- diff --git a/ci-scripts/main.py b/ci-scripts/main.py index cdbf6c64d9..e6b8c68cc1 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -249,7 +249,7 @@ def ExecuteActionWithParam(action, ctx): image_tag = cls_containerize.CreateTag(CLUSTER.ranCommitID, CLUSTER.ranBranch, CLUSTER.ranAllowMerge) options = f"oaicicd-core-for-ci-ran {oc_release} {image_tag} {CLUSTER.eNBSourceCodePath}" workdir = CLUSTER.eNBSourceCodePath - success = CLUSTER.deploy_oc_physim(ctx, HTML, node, workdir, script, options) + success = cls_oaicitest.Deploy_Physim(ctx, HTML, node, workdir, script, options) elif action == 'DeployCoreNetwork' or action == 'UndeployCoreNetwork': cn_id = test.findtext('cn_id')