Add (Un)deployCoreNetwork in test framework
This commit is contained in:
@@ -854,6 +854,35 @@ class OaiCiTest():
|
|||||||
HTML.CreateHtmlTestRowQueue(f'N/A', 'OK', messages)
|
HTML.CreateHtmlTestRowQueue(f'N/A', 'OK', messages)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def DeployCoreNetwork(cn_id, HTML):
|
||||||
|
core_name = cn_id.strip()
|
||||||
|
cn = cls_corenetwork.CoreNetwork(core_name)
|
||||||
|
success, output = cn.deploy()
|
||||||
|
logging.info(f"deployment core network {core_name} success {success}, output:\n{output}")
|
||||||
|
if success:
|
||||||
|
msg = f"Started {cn}"
|
||||||
|
HTML.CreateHtmlTestRowQueue(core_name, 'OK', [msg])
|
||||||
|
else:
|
||||||
|
msg = f"deployment of core network {core_name} FAILED"
|
||||||
|
logging.error(msg)
|
||||||
|
HTML.CreateHtmlTestRowQueue(core_name, 'KO', [msg])
|
||||||
|
return success
|
||||||
|
|
||||||
|
def UndeployCoreNetwork(cn_id, HTML):
|
||||||
|
# Ping, Iperf, DeployObject put logs into a path based on YAML. We
|
||||||
|
# can't do this here (because there is no yaml), so hardcode a path for
|
||||||
|
# "cn_logs" for the moment
|
||||||
|
logPath = f'{os.getcwd()}/../cmake_targets/log/cn_logs'
|
||||||
|
with cls_cmd.getConnection('localhost') as local:
|
||||||
|
local.run(f'mkdir -p {logPath}', silent=True)
|
||||||
|
core_name = cn_id.strip()
|
||||||
|
cn = cls_corenetwork.CoreNetwork(core_name)
|
||||||
|
logs, output = cn.undeploy(log_dir=logPath)
|
||||||
|
logging.info(f"undeployed core network {core_name}, logs {logs}, output:\n{output}")
|
||||||
|
message = "Log files: " + ", ".join([os.path.basename(l) for l in logs])
|
||||||
|
HTML.CreateHtmlTestRowQueue(core_name, 'OK', [message])
|
||||||
|
return True
|
||||||
|
|
||||||
def LogCollectBuild(self,RAN):
|
def LogCollectBuild(self,RAN):
|
||||||
# Some pipelines are using "none" IP / Credentials
|
# Some pipelines are using "none" IP / Credentials
|
||||||
# In that case, just forget about it
|
# In that case, just forget about it
|
||||||
|
|||||||
@@ -339,6 +339,11 @@ def ExecuteActionWithParam(action):
|
|||||||
EPC.cnID = test.findtext('cn_id')
|
EPC.cnID = test.findtext('cn_id')
|
||||||
success = EPC.Terminate5GCN(HTML)
|
success = EPC.Terminate5GCN(HTML)
|
||||||
|
|
||||||
|
elif action == 'DeployCoreNetwork' or action == 'UndeployCoreNetwork':
|
||||||
|
cn_id = test.findtext('cn_id')
|
||||||
|
core_op = getattr(cls_oaicitest.OaiCiTest, action)
|
||||||
|
success = core_op(cn_id, HTML)
|
||||||
|
|
||||||
elif action == 'Deploy_Object' or action == 'Undeploy_Object' or action == "Create_Workspace":
|
elif action == 'Deploy_Object' or action == 'Undeploy_Object' or action == "Create_Workspace":
|
||||||
eNB_instance=test.findtext('eNB_instance')
|
eNB_instance=test.findtext('eNB_instance')
|
||||||
if (eNB_instance is None):
|
if (eNB_instance is None):
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
- Terminate_SPGW
|
- Terminate_SPGW
|
||||||
- Initialize_5GCN
|
- Initialize_5GCN
|
||||||
- Terminate_5GCN
|
- Terminate_5GCN
|
||||||
|
- DeployCoreNetwork
|
||||||
|
- UndeployCoreNetwork
|
||||||
- IdleSleep
|
- IdleSleep
|
||||||
- Build_Image
|
- Build_Image
|
||||||
- Build_Run_Tests
|
- Build_Run_Tests
|
||||||
|
|||||||
Reference in New Issue
Block a user