From 2ab747eaa6569d6e230b5222a0030cb6dbca6690 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 11 Apr 2025 14:16:46 +0200 Subject: [PATCH 1/3] CI CoreNetwork: define function getName() Some functionality (e.g., in cls_oaicitest.py) uses cn.getName(). Define that function to avoid assertions. --- ci-scripts/cls_corenetwork.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci-scripts/cls_corenetwork.py b/ci-scripts/cls_corenetwork.py index 7bb508d86b..e4dc3bf11a 100644 --- a/ci-scripts/cls_corenetwork.py +++ b/ci-scripts/cls_corenetwork.py @@ -162,6 +162,9 @@ class CoreNetwork: def getCmdPrefix(self): return self._cmd_prefix or "" + def getName(self): + return self._cn_name + def getHost(self): return self._host From 135b522cf4e2a0c4b0815e1ea8278d59134ea051 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 11 Apr 2025 14:17:50 +0200 Subject: [PATCH 2/3] CoreNetwork: do not look up IP for CN name printing In various places, e.g., during initialization (before deployment), we use the name of the CN object, previously including the IP address. However, the IP might not be available (because the CN is not deployed), so we would get warnings at this stage. Avoid this by not looking up the IP. There is now one place where we have to look up the IP address separately. Also, the exception in initialization might be misleading if we used {self}, because we complain about no node being present, but the {self} would include a non-existing node name => do not use it. --- ci-scripts/cls_corenetwork.py | 4 ++-- ci-scripts/cls_oaicitest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_corenetwork.py b/ci-scripts/cls_corenetwork.py index e4dc3bf11a..579bad585b 100644 --- a/ci-scripts/cls_corenetwork.py +++ b/ci-scripts/cls_corenetwork.py @@ -49,7 +49,7 @@ class CoreNetwork: self._host = c.get('Host').strip() if self._host == "%%current_host%%": if node is None: - raise Exception(f"core network {self} requires node, but none provided (cannot replace %%current_host%%)") + raise Exception(f"core network {cn_name} requires node, but none provided (cannot replace %%current_host%%)") self._host = node if d is not None: raise Exception("directory handling not implemented") @@ -66,7 +66,7 @@ class CoreNetwork: logging.info(f'initialized core {self} from {filename}') def __str__(self): - return f"{self._cn_name}@{self._host} [IP: {self.getIP()}]" + return f"{self._cn_name}@{self._host}" def __repr__(self): return self.__str__() diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 51a7108875..1f286e9083 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -862,7 +862,7 @@ class OaiCiTest(): success, output = cn.deploy() logging.info(f"deployment core network {core_name} success {success}, output:\n{output}") if success: - msg = f"Started {cn}" + msg = f"Started {cn} [{cn.getIP()}]" HTML.CreateHtmlTestRowQueue(core_name, 'OK', [msg]) else: msg = f"deployment of core network {core_name} FAILED" From 556396e56edeafe1a4d35e1ee47c25de3c5464f7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 11 Apr 2025 14:19:22 +0200 Subject: [PATCH 3/3] Ping: use cn name when checking for CN IP address --- ci-scripts/cls_oaicitest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 1f286e9083..cd40c807e1 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -464,7 +464,7 @@ class OaiCiTest(): return (False, f"UE {ue.getName()} has no IP address") svrIP = cn.getIP() if not svrIP: - return (False, f"Iperf server {ue.getName()} has no IP address") + return (False, f"Iperf server {cn.getName()} has no IP address") iperf_opt = self.iperf_args jsonReport = "--json"