CI: use svr_id for Ping in RFsim-based tests

This is not really used as of now, because most IPs are hardcoded. See
one of the next commits for the use of this.

To make sure that we have the correct IP, there is some code that
verifies that a hardcoded IP and the CN IP would be the same.

Note: need two separate ci_infra.yaml entries, because
- for FlexRIC, the container name is different (is the tutorial CN)
- for RFsim5G E1, we don't have ext-dn => ping UPF
This commit is contained in:
Robert Schmidt
2025-03-31 16:38:13 +02:00
parent a51190a7c5
commit 98ac540d57
21 changed files with 101 additions and 3 deletions
+11
View File
@@ -374,6 +374,17 @@ class OaiCiTest():
# if has pattern %cn_ip%, replace with cn IP address, else we assume the IP is present
if re.search('%cn_ip%', self.ping_args):
self.ping_args = re.sub('%cn_ip%', cn.getIP(), self.ping_args)
else:
# verify we would have the right IP
m = re.search(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', self.ping_args)
if not m:
raise Exception(f"no IP address in {self.ping_args}")
ip = m.group(0)
cnip = cn.getIP()
if ip != cnip:
raise Exception(f"IP mismatch: options specify {ip} but core has {cnip}")
else:
logging.warning(f"\u001B[1mIP {ip} in iperf options matches CN IP {cnip}\u001B[0m")
interface = f'-I {ue.getIFName()}' if ue.getIFName() else ''
ping_cmd = f'{ue.getCmdPrefix()} ping {interface} {self.ping_args} 2>&1 | tee /tmp/{ping_log_file}'
cmd = cls_cmd.getConnection(ue.getHost())