mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
CI: Allow to select service for RT stats analysis
When running phytest with FHI7.2 in Docker, two services are deployed: dpdk-init and oai-gnb. Previously, AnalyzeRTStatsObject selected the first deployed service for RT stats analysis. Allow to explicitly select the service used for RT stats analysis instead of relying on the first deployed service.
This commit is contained in:
@@ -789,7 +789,7 @@ class Containerize():
|
||||
logging.error('\u001B[1m Undeploying objects Failed\u001B[0m')
|
||||
return success
|
||||
|
||||
def AnalyzeRTStatsObject(self, HTML, node, ctx, thresholds):
|
||||
def AnalyzeRTStatsObject(self, HTML, node, ctx, thresholds, service=None):
|
||||
logging.info(f'Analyzing realtime stats from server: {node}')
|
||||
yaml = self.yamlPath.strip('/')
|
||||
wd = f'{self.eNBSourceCodePath}/{yaml}'
|
||||
@@ -797,7 +797,13 @@ class Containerize():
|
||||
|
||||
with cls_cmd.getConnection(node) as cmd:
|
||||
services = GetDeployedServices(cmd, wd_yaml)
|
||||
s, _ = services[0] # we simply assume something is deployed, if not Exception will report
|
||||
if not services:
|
||||
raise RuntimeError("No deployed docker compose services found")
|
||||
deployed_services = [s for s, _ in services]
|
||||
s = service or deployed_services[0] # choose first service if not provided
|
||||
if s not in deployed_services:
|
||||
raise RuntimeError(f"Requested service {s} not found among services: {deployed_services}")
|
||||
logging.info(f"Analyzing deployed service '{s}'")
|
||||
# similar to BuildRunTests(), use docker cp to avoid problems with permissions
|
||||
cmd.run(f'docker compose -f {wd_yaml} cp {s}:/opt/oai-gnb/nrL1_stats.log {wd}/')
|
||||
l1_file = archiveArtifact(cmd, ctx, f"{wd}/nrL1_stats.log")
|
||||
|
||||
@@ -259,7 +259,8 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
|
||||
elif action == 'AnalyzeRTStats_Object':
|
||||
yaml = test.findtext('stats_cfg')
|
||||
success = CONTAINERS.AnalyzeRTStatsObject(HTML, node, ctx, yaml)
|
||||
service = test.findtext('service')
|
||||
success = CONTAINERS.AnalyzeRTStatsObject(HTML, node, ctx, yaml, service)
|
||||
|
||||
else:
|
||||
logging.warning(f"unknown action {action}, skip step")
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<class>AnalyzeRTStats_Object</class>
|
||||
<desc>Analyze Real-Time Stats</desc>
|
||||
<stats_cfg>datalog_rt_stats.100.4x4.fhi72.yaml</stats_cfg>
|
||||
<service>oai-gnb</service>
|
||||
<node>bulbul</node>
|
||||
</testCase>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user