From 7f55a110451eceaa498b68ca69aa9d083e56e353 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 19 Mar 2025 09:29:35 +0100 Subject: [PATCH 01/35] Fix: when calling unknown test case class, fail pipeline --- ci-scripts/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index cafcb24313..44639db5b0 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -697,6 +697,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re HTML.desc=CiTestObj.desc action = test.findtext('class') if (CheckClassValidity(xml_class_list, action, id) == False): + task_set_succeeded = False continue CiTestObj.ShowTestID() if not task_set_succeeded and not always_exec: From c3e9e62f719c3e68675c90c10e5e2e1d2974d1f9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 13 Nov 2024 10:07:03 +0100 Subject: [PATCH 02/35] cls_cmd: printed commands are debug --- ci-scripts/cls_cmd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_cmd.py b/ci-scripts/cls_cmd.py index b338a6938f..fb074bdfce 100644 --- a/ci-scripts/cls_cmd.py +++ b/ci-scripts/cls_cmd.py @@ -124,12 +124,12 @@ class LocalCmd(Cmd): ret.args += f" &> {redirect}" ret.stdout = "" if not silent: - logging.info(f"local> {ret.args}") + logging.debug(f"local> {ret.args}") return ret def run(self, line, timeout=300, silent=False, reportNonZero=True): if not silent: - logging.info(f"local> {line}") + logging.debug(f"local> {line}") try: if line.strip().endswith('&'): # if we wait for stdout, subprocess does not return before the end of the command @@ -244,7 +244,7 @@ class RemoteCmd(Cmd): p = parameters if parameters else "" r = f"> {redirect}" if redirect else "" if not silent: - logging.info(f"local> ssh {host} bash -s {p} < {path} {r} # {path} from localhost") + logging.debug(f"local> ssh {host} bash -s {p} < {path} {r} # {path} from localhost") client = RemoteCmd._ssh_init() cfg = RemoteCmd._lookup_ssh_config(host) client.connect(**cfg) @@ -264,7 +264,7 @@ class RemoteCmd(Cmd): def run(self, line, timeout=300, silent=False, reportNonZero=True): if not silent: - logging.info(f"ssh[{self.hostname}]> {line}") + logging.debug(f"ssh[{self.hostname}]> {line}") if self.cwd: line = f"cd {self.cwd} && {line}" try: From 67ffa02416d2c6cf1ca9665120d8beae8a007a53 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Nov 2024 19:03:06 +0100 Subject: [PATCH 03/35] Improve logging in cls_module.Module_UE: prints the same --- ci-scripts/cls_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_module.py b/ci-scripts/cls_module.py index 731dd5776a..e314281a0e 100644 --- a/ci-scripts/cls_module.py +++ b/ci-scripts/cls_module.py @@ -65,7 +65,7 @@ class Module_UE: self.runIperf3Server = m.get('RunIperf3Server', True) self.namespace = m.get('Namespace') self.cnPath = m.get('CNPath') - logging.info(f'initialized {self.module_name}@{self.host} from {filename}') + logging.info(f'initialized UE {self} from {filename}') def __str__(self): return f"{self.module_name}@{self.host} [IP: {self.getIP()}]" From 32cd3a03e62fe4ab15cddd8bf9d8f0bf1d48516b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 10:30:13 +0100 Subject: [PATCH 04/35] Remove porcepix-cn5g, there is no 5GC on that machine --- ci-scripts/ci_infra.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index 0a4e78e4b5..378d8651e0 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -93,12 +93,6 @@ porcepix-cn4g: NetworkScript: docker exec prod-trf-gen ip a show dev eth0 CmdPrefix: docker exec prod-trf-gen -porcepix-cn5g: - Host: porcepix - NetworkScript: docker exec prod-trf-gen ip a show dev eth0 - CmdPrefix: docker exec prod-trf-gen - RunIperf3Server: False - nano-cn4g: Host: nano NetworkScript: docker exec prod-trf-gen ip a show dev eth0 From b29b60cdf83cb6e7bfc55edaf8287226877ed0cc Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Nov 2024 08:00:21 +0100 Subject: [PATCH 05/35] Remove unused functions in epc.py --- ci-scripts/epc.py | 90 ----------------------------------------------- 1 file changed, 90 deletions(-) diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index e025c514d9..a3b8d72ea1 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -347,96 +347,6 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) response=mySSH.command3('oc pods ls -f name=oai-amf', 10) - def CheckHSSProcess(self, status_queue): - try: - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker top ' + self.containerPrefix + '-oai-hss', '\$', 5) - else: - mySSH.command('stdbuf -o0 ps -aux | grep --color=never hss | grep -v grep', '\$', 5) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - result = re.search('oai_hss -j', mySSH.getBefore()) - elif re.match('OAI', self.Type, re.IGNORECASE): - result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) - elif re.match('ltebox', self.Type, re.IGNORECASE): - result = re.search('hss_sim s6as diam_hss', mySSH.getBefore()) - else: - logging.error('This should not happen!') - if result is None: - logging.debug('\u001B[1;37;41m HSS Process Not Found! \u001B[0m') - status_queue.put(CONST.HSS_PROCESS_FAILED) - else: - status_queue.put(CONST.HSS_PROCESS_OK) - mySSH.close() - except: - os.kill(os.getppid(),signal.SIGUSR1) - - def CheckMMEProcess(self, status_queue): - try: - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - self.isMagmaUsed = False - mySSH.command('docker ps -a', '\$', 5) - result = re.search('magma', mySSH.getBefore()) - if result is not None: - self.isMagmaUsed = True - if self.isMagmaUsed: - mySSH.command('docker top ' + self.containerPrefix + '-magma-mme', '\$', 5) - else: - mySSH.command('docker top ' + self.containerPrefix + '-oai-mme', '\$', 5) - else: - mySSH.command('stdbuf -o0 ps -aux | grep --color=never mme | grep -v grep', '\$', 5) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - result = re.search('oai_mme -c ', mySSH.getBefore()) - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - result = re.search('mme -c', mySSH.getBefore()) - elif re.match('OAI', self.Type, re.IGNORECASE): - result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) - elif re.match('ltebox', self.Type, re.IGNORECASE): - result = re.search('mme|amf', mySSH.getBefore()) - else: - logging.error('This should not happen!') - if result is None: - logging.debug('\u001B[1;37;41m MME|AMF Process Not Found! \u001B[0m') - status_queue.put(CONST.MME_PROCESS_FAILED) - else: - status_queue.put(CONST.MME_PROCESS_OK) - mySSH.close() - except: - os.kill(os.getppid(),signal.SIGUSR1) - - def CheckSPGWProcess(self, status_queue): - try: - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker top ' + self.containerPrefix + '-oai-spgwc', '\$', 5) - result = re.search('oai_spgwc -', mySSH.getBefore()) - if result is not None: - mySSH.command('docker top ' + self.containerPrefix + '-oai-spgwu-tiny', '\$', 5) - result = re.search('oai_spgwu -', mySSH.getBefore()) - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('stdbuf -o0 ps -aux | grep --color=never spgw | grep -v grep', '\$', 5) - result = re.search('spgwu -c ', mySSH.getBefore()) - elif re.match('OAI', self.Type, re.IGNORECASE): - mySSH.command('stdbuf -o0 ps -aux | grep --color=never spgw | grep -v grep', '\$', 5) - result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) - elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('stdbuf -o0 ps -aux | grep --color=never xGw | grep -v grep', '\$', 5) - result = re.search('xGw|upf', mySSH.getBefore()) - else: - logging.error('This should not happen!') - if result is None: - logging.debug('\u001B[1;37;41m SPGW|UPF Process Not Found! \u001B[0m') - status_queue.put(CONST.SPGW_PROCESS_FAILED) - else: - status_queue.put(CONST.SPGW_PROCESS_OK) - mySSH.close() - except: - os.kill(os.getppid(),signal.SIGUSR1) - def TerminateHSS(self, HTML): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) From 083765f7a7e08bf847a69028b4cf5fa5722437a0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 08:25:52 +0100 Subject: [PATCH 06/35] Remove outdated/unused XML files --- .../container_lte_b200_tdd_05Mhz_tm2.xml | 205 ------------------ ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 204 ----------------- .../fr1_nsa_2x2_quectel_attach_detach.xml | 171 --------------- ci-scripts/xml_files/fr1_nsa_quectel.xml | 195 ----------------- .../fr1_nsa_quectel_attach_detach.xml | 159 -------------- ci-scripts/xml_files/fr1_nsa_quectel_long.xml | 157 -------------- ci-scripts/xml_files/sa_cn5g_asue_closure.xml | 38 ---- 7 files changed, 1129 deletions(-) delete mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml delete mode 100644 ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml delete mode 100644 ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml delete mode 100644 ci-scripts/xml_files/fr1_nsa_quectel.xml delete mode 100644 ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml delete mode 100644 ci-scripts/xml_files/fr1_nsa_quectel_long.xml delete mode 100644 ci-scripts/xml_files/sa_cn5g_asue_closure.xml diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml deleted file mode 100644 index 1a3bfa6692..0000000000 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - test-tdd-05-tm2 - Test-TDD-05MHz-TM2 - tasks - -100000 -111110 -040101 -800813 -030105 -040301 040502 040606 040608 040646 040648 040401 040201 -030205 -200000 - - - - - Pull_Local_Registry - Pull Images from Local Registry - 0 - oai-enb - - - Custom_Command - Disable Sleep States - starsky - sudo cpupower idle-set -D 0 - - - Custom_Command - true - Enable Sleep States - starsky - sudo cpupower idle-set -E - - - Create_Workspace - Create new Workspace for server 0 - 0 - 0 - - - Deploy_Object - Deploy eNB (TDD/Band40/5MHz/B200) in a container - ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2 - 0 - 0 - - - - IdleSleep - Sleep - 5 - - - - Undeploy_Object - true - Undeploy eNB - ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2 - 0 - 0 - - - - Initialize_UE - Initialize UE - adb_ue_1 adb_ue_2 - - - Terminate_UE - true - Terminate UE - adb_ue_1 adb_ue_2 - - - Attach_UE - Attach UE - adb_ue_1 adb_ue_2 - - - Detach_UE - true - Detach UE - adb_ue_1 adb_ue_2 - - - - Ping - ping (5MHz - 20 sec) - -c 20 %cn_ip% - 25 - adb_ue_1 adb_ue_2 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) - -u -b 6.5M -t 30 -R - 50 - balanced - adb_ue_1 adb_ue_2 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) - -u -b 6.5M -t 30 -R - 50 - adb_ue_1 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 6.5M -t 30 - 50 - unbalanced - adb_ue_1 adb_ue_2 - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -R - adb_ue_1 - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec) - -t 30 -R - adb_ue_1 adb_ue_2 - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 - 50 - balanced - adb_ue_1 adb_ue_2 - ltebox-nano - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 - 50 - adb_ue_1 - ltebox-nano - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 - 50 - unbalanced - adb_ue_1 adb_ue_2 - ltebox-nano - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec)(single-ue) - -t 30 - adb_ue_1 - ltebox-nano - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec) - -t 30 - adb_ue_1 adb_ue_2 - ltebox-nano - - - diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml deleted file mode 100644 index adef26b7c6..0000000000 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - TEST-NSA-FR1-TM2-Tab1 - NSA 2x2 Ping DL UL with QUECTEL - tasks - - 100000 - 700000 - 010002 - 300000 - 030000 - 040000 - 000002 - 010000 010010 - 000001 - 050000 - 050001 - 000002 - 070000 - 070001 - 070002 - 000001 - 010011 010002 - 080001 - 080000 - 200000 - 800000 - - - - - Custom_Command - Disable Sleep States (obelix) - obelix - sudo cpupower idle-set -D 0 - - - Custom_Command - true - Enable Sleep States (obelix) - obelix - sudo cpupower idle-set -E - - - Custom_Command - Disable Sleep States (asterix) - asterix - sudo cpupower idle-set -D 0 - - - Custom_Command - true - Enable Sleep States (asterix) - asterix - sudo cpupower idle-set -E - - - - Initialize_UE - Initialize Quectel - nrmodule2_quectel - - - Terminate_UE - true - Terminate Quectel - nrmodule2_quectel - - - Attach_UE - Attach Quectel - nrmodule2_quectel - - - Detach_UE - true - Detach Quectel - nrmodule2_quectel - - - - - Initialize_eNB - Initialize eNB - -O ci-scripts/conf_files/enb.band38.nsa_2x2.100prb.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time,line_num,function - 0 - 0 - lte - 172.21.19.13 - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.nsa.band78.106prb.usrpn310.2x2.conf --nsa -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time,line_num,function - 1 - 1 - nr - datalog_rt_stats.2x2.yaml - 172.21.19.14 - - - Custom_Command - Reboot USRP - asterix - ssh root@172.21.19.14 reboot ; sleep 45 - - - IdleSleep - Sleep - 60 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - nrmodule2_quectel - -c 20 %cn_ip% - 5 - - - - Ping - Ping: 100pings in 20sec - nrmodule2_quectel - -c 100 -i 0,2 %cn_ip% - 5 - - - - Iperf - iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile) - -u -b 125M -t 60 -R - nrmodule2_quectel - 15 - 85 - - - - Iperf - iperf (UL/1Mbps/UDP)(20 sec)(single-ue profile) - -u -b 3M -t 60 - nrmodule2_quectel - 5 - - - - Iperf - iperf (BIDIR TCP)(10 sec)(single-ue profile) - -t 10 --bidir - nrmodule2_quectel - - - - - - Terminate_eNB - true - Terminate eNB - 0 - 0 - lte - - - - Terminate_eNB - true - Terminate gNB - 1 - 1 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml deleted file mode 100644 index f59f883319..0000000000 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - TEST-NSA-FR1-TM2-Tab2 - NSA 2x2 Attach-Detach with QUECTEL - tasks - - 100000 - 300000 - 010002 - 031000 - 041000 - 000002 - 010000 - 000001 - 050000 - 000002 - 010004 - 000002 - 010003 - 000001 - 050000 - 000002 - 010004 - 000002 - 010003 - 000001 - 050000 - 000002 - 010002 - 080001 - 080000 - 200000 - 400000 - - - - - Initialize_UE - Initialize Quectel - nrmodule2_quectel - - - Terminate_UE - true - Terminate Quectel - nrmodule2_quectel - - - Attach_UE - Attach Quectel - nrmodule2_quectel - - - Detach_UE - Detach Quectel - nrmodule2_quectel - - - - Custom_Command - Disable Sleep States (asterix) - asterix - sudo cpupower idle-set -D 0 - - - Custom_Command - true - Enable Sleep States (asterix) - asterix - sudo cpupower idle-set -E - - - Custom_Command - Disable Sleep States (obelix) - obelix - sudo cpupower idle-set -D 0 - - - Custom_Command - true - Enable Sleep States (obelix) - obelix - sudo cpupower idle-set -E - - - - Initialize_eNB - Initialize eNB - -O ci-scripts/conf_files/enb.band38.nsa_2x2.100prb.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time,line_num,function - 0 - 0 - lte - 172.21.19.13 - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.nsa.band78.106prb.usrpn310.2x2.conf --nsa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time,line_num,function - 1 - 1 - nr - datalog_rt_stats.2x2.yaml - 172.21.19.14 - - - - IdleSleep - Sleep - 60 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - nrmodule2_quectel - -c 20 %cn_ip% - 5 - - - - - - Terminate_eNB - true - Terminate eNB - 0 - 0 - lte - - - - Terminate_eNB - true - Terminate gNB - 1 - 1 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml deleted file mode 100644 index 7f824010d9..0000000000 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - TEST-NSA-FR1-TM1 - NSA Ping DL UL with QUECTEL - tasks - - 100000 - 200000 - 400000 - 010002 - 030000 - 040000 - 000002 - 010000 - 010010 - 000001 - 050000 - 050001 - 000001 - 070000 - 070001 - 000001 - 050000 - 050001 - 010011 - 010002 - 080001 - 080000 - 300000 - 500000 - - - - - Custom_Command - To reset USRP - obelix - sudo -S b2xx_fx3_utils --reset-device - - - - Custom_Command - Disable Sleep States (obelix) - obelix - sudo cpupower idle-set -D 0 - - - Custom_Command - Enable Sleep States (obelix) - obelix - sudo cpupower idle-set -E - - - Custom_Command - Disable Sleep States (nepes) - nepes - sudo cpupower idle-set -D 0 - - - Custom_Command - Enable Sleep States (nepes) - nepes - sudo cpupower idle-set -E - - - - Initialize_UE - Initialize Quectel - idefix - - - Terminate_UE - true - Terminate Quectel - idefix - - - Attach_UE - Attach Quectel - idefix - - - Detach_UE - true - Detach Quectel - idefix - - - - Initialize_eNB - Initialize eNB - -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function - 0 - 0 - lte - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4" --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function - 1 - 1 - nr - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - Ping - Ping: 20pings in 20sec - idefix - -c 20 %cn_ip% - 1 - 15 - - - - Ping - Ping: 100pings in 20sec - idefix - -c 100 -i 0.2 %cn_ip% - 1 - 15 - - - - Iperf - iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile) - -u -b 125M -t 60 -R - idefix - 25 - 80 - - - - Iperf - iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile) - -u -b 8M -t 60 - idefix - 1 - 95 - - - - Terminate_eNB - true - Terminate eNB - 0 - 0 - lte - - - - Terminate_eNB - true - Terminate gNB - 1 - 1 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml deleted file mode 100644 index faa365a105..0000000000 --- a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - TEST-NSA-FR1-TM1 - NSA Ping Attach Detach with QUECTEL - tasks - - 030000 - 040000 - 000002 - 010000 - 000001 - 050000 - 000001 - 010004 - 000001 - 010003 - 000001 - 050000 - 000001 - 010004 - 000001 - 010003 - 000001 - 050000 - 000001 - 010002 - 080001 - 080000 - - - - - Initialize_UE - Initialize Quectel - idefix - - - Terminate_UE - true - Terminate Quectel - idefix - - - Attach_UE - Attach Quectel - idefix - - - Detach_UE - Detach Quectel - idefix - - - - Initialize_eNB - Initialize eNB - -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function - 0 - 0 - lte - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --log_config.global_log_options level,nocolor,time,line_num,function - 1 - 1 - nr - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - idefix - -c 20 %cn_ip% - 50 - - - - Ping - Ping: 100pings in 20sec - idefix - -c 100 -i 0.2 %cn_ip% - 50 - - - - Iperf - iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile) - -u -b 20M -t 60 -R - idefix - 50 - - - - Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 - idefix - 50 - - - - - Terminate_eNB - true - Terminate eNB - 0 - 0 - lte - - - - Terminate_eNB - true - Terminate gNB - 1 - 1 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml deleted file mode 100644 index 7687363d78..0000000000 --- a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - TEST-NSA-FR1-TM1 - NSA Ping DL UL with QUECTEL (Longer) - tasks - - 030000 - 040000 - 000002 - 010000 010010 - 000001 - 050000 - 050001 - 000001 - 070000 - 000001 - 070001 - 000001 - 010011 - 010002 - 080001 - 080000 - - - - - Initialize_UE - Initialize Quectel - idefix - - - - - Terminate_UE - true - Terminate Quectel - idefix - - - Attach_UE - Attach Quectel - idefix - - - Detach_UE - true - Detach Quectel - idefix - - - - - Initialize_eNB - Initialize eNB - -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function - 0 - 0 - lte - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --log_config.global_log_options level,nocolor,time,line_num,function - 1 - 1 - nr - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - idefix - -c 20 %cn_ip% - 50 - - - - Ping - Ping: 100pings in 20sec - idefix - -c 100 -i 0.2 %cn_ip% - 50 - - - - Iperf - iperf (DL/20Mbps/UDP)(600 sec)(single-ue profile) - -u -b 20M -t 600 -R - idefix - 50 - - - - Iperf - iperf (UL/3Mbps/UDP)(600 sec)(single-ue profile) - -u -b 3M -t 600 - idefix - 50 - - - - - Terminate_eNB - true - Terminate eNB - 0 - 0 - lte - - - - Terminate_eNB - true - Terminate gNB - 1 - 1 - nr - - - - diff --git a/ci-scripts/xml_files/sa_cn5g_asue_closure.xml b/ci-scripts/xml_files/sa_cn5g_asue_closure.xml deleted file mode 100644 index f0448d528d..0000000000 --- a/ci-scripts/xml_files/sa_cn5g_asue_closure.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - cn5g-closure - CN5G-Closure - log-out - -060000 - - - - - Terminate_5GCN - Terminate 5G Core - --type stop-mini-as-ue --scenario 1 - - - From 60094de81f64967cbec7b5f0cba830b0bedbf021 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 08:38:49 +0100 Subject: [PATCH 07/35] Remove two unused/duplicate steps --- ci-scripts/xml_files/container_5g_f1_rfsim.xml | 9 --------- ci-scripts/xml_files/container_5g_rfsim.xml | 11 +---------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index a9bd7b761e..280475e182 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -170,15 +170,6 @@ 80 - - Ping - Ping ext-dn from all NR-UEs - rfsim5g_ue - cacofonix - -c 5 192.168.72.135 -i0.5 -w25 - 80 - - Custom_Command Verify Reestablishment diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index 6388a3fe3e..fdc1d57ba0 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -48,7 +48,7 @@ 020005 444444 333333 - 020006 + 020005 100001 222222 @@ -181,15 +181,6 @@ 5 - - Ping - Ping ext-dn from both UEs - rfsim5g_ue rfsim5g_ue2 - cacofonix cacofonix - -c 20 -i 0.25 192.168.72.135 - 5 - - Ping Ping ext-dn from all UEs From 4a9bb6dbe4228244b52821937855b5b791f50e5b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 08:40:12 +0100 Subject: [PATCH 08/35] Ping from correct UE --- ci-scripts/xml_files/container_5g_rfsim.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index fdc1d57ba0..3897421c27 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -157,7 +157,7 @@ Ping Ping ext-dn from Second NR-UE - rfsim5g_ue + rfsim5g_ue2 cacofonix -c 20 -i 0.25 192.168.72.135 5 From 19932b10f6f0fd27a4e686d67c42616d3e2ed0cb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Nov 2024 07:54:24 +0100 Subject: [PATCH 09/35] Configurable infrastructure file for Ping and Iperf() - Make configurable to override (to be used later in extended tests with new core class) - Move ping-iperf test infra to tests/ directory --- ci-scripts/ci_infra.yaml | 4 ---- ci-scripts/cls_oaicitest.py | 10 +++++----- ci-scripts/tests/config/infra_ping_iperf.yaml | 3 +++ ci-scripts/tests/ping-iperf.py | 6 ++++-- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 ci-scripts/tests/config/infra_ping_iperf.yaml diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index 378d8651e0..cc7c642ca1 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -396,7 +396,3 @@ l2sim4g_ext_dn: Host: "%%current_host%%" NetworkScript: docker exec l2sim4g-trf-gen ip a show dev eth0 CmdPrefix: docker exec l2sim4g-trf-gen - -test: - Host: localhost - NetworkScript: echo "inet 127.0.0.1 mtu 1500" diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 5268a73e9a..e141277a03 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -434,7 +434,7 @@ class OaiCiTest(): return (True, message) - def Ping(self, HTML, EPC, CONTAINERS): + def Ping(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"): if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') @@ -446,7 +446,7 @@ class OaiCiTest(): ymlPath = CONTAINERS.yamlPath[0].split('/') logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' local.run(f'mkdir -p {logPath}', silent=True) - ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] + ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)] logging.debug(ues) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(self.Ping_common, EPC, ue, logPath) for ue in ues] @@ -516,7 +516,7 @@ class OaiCiTest(): return (status, f'{ue_header}\n{msg}') - def Iperf(self,HTML,EPC,CONTAINERS): + def Iperf(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"): if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) sys.exit('Insufficient Parameter') @@ -530,8 +530,8 @@ class OaiCiTest(): ymlPath = CONTAINERS.yamlPath[0].split('/') logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' local.run(f'mkdir -p {logPath}', silent=True) - ues = [cls_module.Module_UE(ue_id, server_name) for ue_id, server_name in zip(self.ue_ids, self.nodes)] - svr = cls_module.Module_UE(self.svr_id,self.svr_node) + ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)] + svr = cls_module.Module_UE(self.svr_id,self.svr_node, infra_file) logging.debug(ues) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, i, len(ues), logPath) for i, ue in enumerate(ues)] diff --git a/ci-scripts/tests/config/infra_ping_iperf.yaml b/ci-scripts/tests/config/infra_ping_iperf.yaml new file mode 100644 index 0000000000..ac09c9e412 --- /dev/null +++ b/ci-scripts/tests/config/infra_ping_iperf.yaml @@ -0,0 +1,3 @@ +test: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py index 6ba35d04d3..39d08823ff 100644 --- a/ci-scripts/tests/ping-iperf.py +++ b/ci-scripts/tests/ping-iperf.py @@ -33,8 +33,9 @@ class TestPingIperf(unittest.TestCase): def test_ping(self): self.ci.ping_args = "-c3 127.0.0.1" self.ci.ping_packetloss_threshold = "0" + infra_file = "tests/config/infra_ping_iperf.yaml" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Ping(self.html, self.epc, self.cont) + success = self.ci.Ping(self.html, self.epc, self.cont, infra_file=infra_file) self.assertTrue(success) def test_iperf(self): @@ -47,8 +48,9 @@ class TestPingIperf(unittest.TestCase): self.ci.iperf_packetloss_threshold = "0" self.ci.iperf_bitrate_threshold = "0" self.ci.iperf_profile = "balanced" + infra_file = "tests/config/infra_ping_iperf.yaml" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Iperf(self.html, self.epc, self.cont) + success = self.ci.Iperf(self.html, self.epc, self.cont, infra_file=infra_file) self.assertTrue(success) if __name__ == '__main__': From ac6b296616dfcaa190d305616f646e8c804bc642 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 12:11:07 +0100 Subject: [PATCH 10/35] Iperf: Redirect server output to NULL It's not needed/used anywhere, and some CI pipelines have a lot of useless output. On this occasion, also remove the unused nohup. --- 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 e141277a03..bb1717d291 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -501,7 +501,7 @@ class OaiCiTest(): t = iperf_time * 2.5 cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False, silent=True) if runIperf3Server: - cmd_svr.run(f'{svr.getCmdPrefix()} nohup timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} &', timeout=t) + cmd_svr.run(f'{svr.getCmdPrefix()} timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} >> /dev/null &', timeout=t) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -B {ueIP} -c {svrIP} -p {port} {iperf_opt} {jsonReport} {serverReport} -O 5 >> /tmp/{client_filename}', timeout=t) # note: copy iperf3 log to the current directory for log analysis and log collection dest_filename = f'{logPath}/{client_filename}' From e5d8c250840911f0d158f9b921aa2e8d8734d8fa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Nov 2024 18:55:46 +0100 Subject: [PATCH 11/35] Add configurable infra for Iperf2_Unidir, test, fixes Add a possibility to use an "infrastructure YAML file" to configure both ends of the iperf2 call through a file. Fix bugs in Iperf2: at least on my machine, iperf2 start time is logged at 0.00 not 0.0, so update the regex to match both. Do not overwrite results if the matched regex (otherwise, the result might be None at the end) and suppress server output. Add a unit test to test that this function actually works (on my machine, with iperf v2.2.1), as well as a unit test for analysis. --- ci-scripts/cls_oaicitest.py | 13 ++++---- ci-scripts/tests/iperf-analysis.py | 12 ++++++++ ci-scripts/tests/log/iperf_udp_v2_ok.log | 39 ++++++++++++++++++++++++ ci-scripts/tests/log/iperf_udp_v2_ok.txt | 5 +++ ci-scripts/tests/ping-iperf.py | 12 ++++++++ 5 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 ci-scripts/tests/log/iperf_udp_v2_ok.log create mode 100644 ci-scripts/tests/log/iperf_udp_v2_ok.txt diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index bb1717d291..7bd0798e57 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -183,11 +183,10 @@ def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetlos return (False, 'Iperf UDP: Server report not found!') if (os.path.getsize(server_filename)==0): return (False, 'Iperf UDP: Log file is empty') - # Computing the requested bandwidth in float - statusTemplate = r'(?:|\[ *\d+\].*) +0\.0-\s*(?P[0-9\.]+) +sec +[0-9\.]+ [kKMG]Bytes +(?P[0-9\.]+) (?P[kKMG])bits\/sec +(?P[0-9\.]+) ms +(\d+\/ *\d+) +(\((?P[0-9\.]+)%\))' + statusTemplate = r'(?:|\[ *\d+\].*) +0\.0+-\s*(?P[0-9\.]+) +sec +[0-9\.]+ [kKMG]Bytes +(?P[0-9\.]+) (?P[kKMG])bits\/sec +(?P[0-9\.]+) ms +(\d+\/ *\d+) +(\((?P[0-9\.]+)%\))' with open(server_filename, 'r') as server_file: for line in server_file.readlines(): - result = re.search(statusTemplate, str(line)) + result = re.search(statusTemplate, str(line)) or result if result is None: return (False, 'Could not parse server report!') bitrate = float(result.group('bitrate')) @@ -555,11 +554,11 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', messages) return success - def Iperf2_Unidir(self,HTML,EPC,CONTAINERS): + def Iperf2_Unidir(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"): if self.ue_ids == [] or self.svr_id == None or len(self.ue_ids) != 1: raise Exception("no module names in self.ue_ids or/and self.svr_id provided, multi UE scenario not supported") - ue = cls_module.Module_UE(self.ue_ids[0].strip(),self.nodes[0].strip()) - svr = cls_module.Module_UE(self.svr_id,self.svr_node) + ue = cls_module.Module_UE(self.ue_ids[0].strip(),self.nodes[0].strip(), infra_file) + svr = cls_module.Module_UE(self.svr_id,self.svr_node, infra_file) ueIP = ue.getIP() if not ueIP: return (False, f"UE {ue.getName()} has no IP address") @@ -577,7 +576,7 @@ class OaiCiTest(): with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(EPC.IPAddress) as cmd_svr: cmd_ue.run(f'rm /tmp/{server_filename}', reportNonZero=False) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} iperf -B {ueIP} -s -u -i1 >> /tmp/{server_filename} &', timeout=t) - cmd_svr.run(f'{svr.getCmdPrefix()} timeout -vk3 {t} iperf -c {ueIP} -B {svrIP} {iperf_opt} -i1', timeout=t) + cmd_svr.run(f'{svr.getCmdPrefix()} timeout -vk3 {t} iperf -c {ueIP} -B {svrIP} {iperf_opt} -i1 >> /dev/null', timeout=t) localPath = f'{os.getcwd()}' # note: copy iperf2 log to the directory for log collection cmd_ue.copyin(f'/tmp/{server_filename}', f'{localPath}/{logPath}/{server_filename}') diff --git a/ci-scripts/tests/iperf-analysis.py b/ci-scripts/tests/iperf-analysis.py index 53d5bdda1d..af261d6e4d 100644 --- a/ci-scripts/tests/iperf-analysis.py +++ b/ci-scripts/tests/iperf-analysis.py @@ -73,5 +73,17 @@ class TestIperfAnalysis(unittest.TestCase): self.assertEqual(msg, "Iperf3 UDP: Log file not present") self.assertFalse(success) + def test_iperf_analyzeV2UDP(self): + filename_ok = "tests/log/iperf_udp_v2_ok.log" + msg_filename_ok = "tests/log/iperf_udp_v2_ok.txt" + target_bitrate = "2.00" + bitrate_thresh = 80 + packetloss_thresh = 25 + with open(msg_filename_ok, 'r') as file: + expected_msg_ok = file.read().strip() + success, msg = cls_oaicitest.Iperf_analyzeV2UDP(filename_ok, bitrate_thresh, packetloss_thresh, target_bitrate) + self.assertEqual(msg, expected_msg_ok) + self.assertTrue(success) + if __name__ == '__main__': unittest.main() diff --git a/ci-scripts/tests/log/iperf_udp_v2_ok.log b/ci-scripts/tests/log/iperf_udp_v2_ok.log new file mode 100644 index 0000000000..ce53e36f4f --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_v2_ok.log @@ -0,0 +1,39 @@ +------------------------------------------------------------ +Server listening on UDP port 5001 +Binding to local address 10.0.2.2 +Receiving 1470 byte datagrams +UDP buffer size: 208 KByte (default) +------------------------------------------------------------ +[ 3] local 10.0.2.2 port 5001 connected with 10.0.2.1 port 45771 +[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams +[ 3] 0.0- 1.0 sec 258 KBytes 2.12 Mbits/sec 7.930 ms 0/ 180 (0%) +[ 3] 1.0- 2.0 sec 257 KBytes 2.11 Mbits/sec 7.839 ms 0/ 179 (0%) +[ 3] 2.0- 3.0 sec 256 KBytes 2.09 Mbits/sec 7.154 ms 0/ 178 (0%) +[ 3] 3.0- 4.0 sec 257 KBytes 2.11 Mbits/sec 7.834 ms 0/ 179 (0%) +[ 3] 4.0- 5.0 sec 258 KBytes 2.12 Mbits/sec 7.943 ms 0/ 180 (0%) +[ 3] 5.0- 6.0 sec 256 KBytes 2.09 Mbits/sec 6.986 ms 0/ 178 (0%) +[ 3] 6.0- 7.0 sec 250 KBytes 2.05 Mbits/sec 8.111 ms 0/ 174 (0%) +[ 3] 7.0- 8.0 sec 257 KBytes 2.11 Mbits/sec 8.026 ms 0/ 179 (0%) +[ 3] 8.0- 9.0 sec 258 KBytes 2.12 Mbits/sec 7.993 ms 0/ 180 (0%) +[ 3] 9.0-10.0 sec 258 KBytes 2.12 Mbits/sec 7.997 ms 0/ 180 (0%) +[ 3] 10.0-11.0 sec 251 KBytes 2.06 Mbits/sec 7.973 ms 0/ 175 (0%) +[ 3] 11.0-12.0 sec 258 KBytes 2.12 Mbits/sec 7.871 ms 0/ 180 (0%) +[ 3] 12.0-13.0 sec 257 KBytes 2.11 Mbits/sec 8.005 ms 0/ 179 (0%) +[ 3] 13.0-14.0 sec 258 KBytes 2.12 Mbits/sec 7.890 ms 0/ 180 (0%) +[ 3] 14.0-15.0 sec 250 KBytes 2.05 Mbits/sec 8.119 ms 0/ 174 (0%) +[ 3] 15.0-16.0 sec 260 KBytes 2.13 Mbits/sec 7.940 ms 0/ 181 (0%) +[ 3] 16.0-17.0 sec 258 KBytes 2.12 Mbits/sec 8.078 ms 0/ 180 (0%) +[ 3] 17.0-18.0 sec 251 KBytes 2.06 Mbits/sec 7.839 ms 0/ 175 (0%) +[ 3] 18.0-19.0 sec 257 KBytes 2.11 Mbits/sec 8.033 ms 0/ 179 (0%) +[ 3] 19.0-20.0 sec 260 KBytes 2.13 Mbits/sec 7.936 ms 0/ 181 (0%) +[ 3] 20.0-21.0 sec 250 KBytes 2.05 Mbits/sec 8.032 ms 0/ 174 (0%) +[ 3] 21.0-22.0 sec 260 KBytes 2.13 Mbits/sec 8.089 ms 0/ 181 (0%) +[ 3] 22.0-23.0 sec 256 KBytes 2.09 Mbits/sec 7.889 ms 0/ 178 (0%) +[ 3] 23.0-24.0 sec 258 KBytes 2.12 Mbits/sec 8.115 ms 0/ 180 (0%) +[ 3] 24.0-25.0 sec 253 KBytes 2.07 Mbits/sec 7.976 ms 0/ 176 (0%) +[ 3] 25.0-26.0 sec 256 KBytes 2.09 Mbits/sec 7.597 ms 0/ 178 (0%) +[ 3] 26.0-27.0 sec 258 KBytes 2.12 Mbits/sec 7.924 ms 0/ 180 (0%) +[ 3] 27.0-28.0 sec 254 KBytes 2.08 Mbits/sec 7.957 ms 0/ 177 (0%) +[ 3] 28.0-29.0 sec 257 KBytes 2.11 Mbits/sec 7.276 ms 0/ 179 (0%) +[ 3] 29.0-30.0 sec 253 KBytes 2.07 Mbits/sec 21.383 ms 0/ 176 (0%) +[ 3] 0.0-30.2 sec 7.50 MBytes 2.08 Mbits/sec 21.383 ms 0/ 5350 (0%) diff --git a/ci-scripts/tests/log/iperf_udp_v2_ok.txt b/ci-scripts/tests/log/iperf_udp_v2_ok.txt new file mode 100644 index 0000000000..edf56efbde --- /dev/null +++ b/ci-scripts/tests/log/iperf_udp_v2_ok.txt @@ -0,0 +1,5 @@ +Req Bitrate : 2.00 +Bitrate : 2.08 +Bitrate Perf: 104.00 % +Jitter : 21.383 +Packet Loss : 0.0 diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py index 39d08823ff..94186de606 100644 --- a/ci-scripts/tests/ping-iperf.py +++ b/ci-scripts/tests/ping-iperf.py @@ -53,5 +53,17 @@ class TestPingIperf(unittest.TestCase): success = self.ci.Iperf(self.html, self.epc, self.cont, infra_file=infra_file) self.assertTrue(success) + def test_iperf2_unidir(self): + self.ci.iperf_args = "-u -t 5 -b 1M" + self.ci.svr_id = "test" + self.ci.svr_node = "localhost" + self.ci.iperf_packetloss_threshold = "0" + self.ci.iperf_bitrate_threshold = "0" + self.ci.iperf_profile = "balanced" + infra_file = "tests/config/infra_ping_iperf.yaml" + # TODO Should need nothing but options and UE(s) to use + success = self.ci.Iperf2_Unidir(self.html, self.epc, self.cont, infra_file=infra_file) + self.assertTrue(success) + if __name__ == '__main__': unittest.main() From c8534a0b51f058d792b100a84ea778da5edfd0a1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 27 Mar 2025 19:11:15 +0100 Subject: [PATCH 12/35] CI: Correct Iperf2_Unidir(): only status code required --- ci-scripts/cls_oaicitest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 7bd0798e57..23e0ca79d6 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -561,10 +561,10 @@ class OaiCiTest(): svr = cls_module.Module_UE(self.svr_id,self.svr_node, infra_file) ueIP = ue.getIP() if not ueIP: - return (False, f"UE {ue.getName()} has no IP address") + return False svrIP = svr.getIP() if not svrIP: - return (False, f"Iperf server {ue.getName()} has no IP address") + return False server_filename = f'iperf_server_{self.testCase_id}_{ue.getName()}.log' ymlPath = CONTAINERS.yamlPath[0].split('/') logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' From f55c1a7a4f256ee42b9716cd332680693120a8b5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 27 Mar 2025 19:17:19 +0100 Subject: [PATCH 13/35] Correct UE interface for fembms test --- ci-scripts/ci_infra.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index cc7c642ca1..ec13d1ada8 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -379,9 +379,9 @@ rfsim4g_enb_fembms: rfsim4g_ue_fembms: Host: "%%current_host%%" - NetworkScript: docker exec rfsim4g-oai-lte-ue0 ip a show dev oaitun_uem1 + NetworkScript: docker exec rfsim4g-oai-lte-ue0 ip a show dev oaitun_uem2 CmdPrefix: docker exec rfsim4g-oai-lte-ue0 - IF: oaitun_uem1 + IF: oaitun_uem2 l2sim4g_ue: Host: "%%current_host%%" From 703bf07c810b4c1f6236ea3e98fe7d10d5fe7f9c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 12 Nov 2024 19:25:22 +0100 Subject: [PATCH 14/35] Remove EPC from InitializeNB()/TerminateeNB() These two functions use the EPC class to potentially fill in EPC/5GC-related information, or start a packet tracer (tshark). The only pipeline that uses these functions is RAN-gNB-N300-Timing-Phytest-LDPC, which does not use a core network. This functionality is not used, and can therefore be removed. --- ci-scripts/main.py | 6 +++--- ci-scripts/ran.py | 49 ++-------------------------------------------- 2 files changed, 5 insertions(+), 50 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 44639db5b0..b02cd447f9 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -180,7 +180,7 @@ def ExecuteActionWithParam(action): cmd_prefix = test.findtext('cmd_prefix') if cmd_prefix is not None: RAN.cmd_prefix = cmd_prefix - success = RAN.InitializeeNB(HTML, EPC) + success = RAN.InitializeeNB(HTML) elif action == 'Terminate_eNB': eNB_instance=test.findtext('eNB_instance') @@ -208,7 +208,7 @@ def ExecuteActionWithParam(action): RAN.air_interface[RAN.eNB_instance] = 'lte-softmodem' else: RAN.air_interface[RAN.eNB_instance] = air_interface.lower() +'-softmodem' - success = RAN.TerminateeNB(HTML, EPC) + success = RAN.TerminateeNB(HTML) elif action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Terminate_UE' or action == 'CheckStatusUE' or action == 'DataEnable_UE' or action == 'DataDisable_UE': CiTestObj.ue_ids = test.findtext('id').split(' ') @@ -511,7 +511,7 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): RAN.eNB_instance=0 RAN.eNB_serverId[0]='0' RAN.eNBSourceCodePath='/tmp/' - RAN.TerminateeNB(HTML, EPC) + RAN.TerminateeNB(HTML) elif re.match('^TerminateHSS$', mode, re.IGNORECASE): if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 96ec6306e9..6f58478476 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -102,7 +102,7 @@ class RANManagement(): # RAN management functions #----------------------------------------------------------- - def InitializeeNB(self, HTML, EPC): + def InitializeeNB(self, HTML): if self.eNB_serverId[self.eNB_instance] == '0': lIpAddr = self.eNBIPAddress lUserName = self.eNBUserName @@ -127,20 +127,6 @@ class RANManagement(): mySSH = SSH.SSHConnection() cwd = os.getcwd() - # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB - if EPC.IPAddress != "none": - localEpcIpAddr = EPC.IPAddress - localEpcUserName = EPC.UserName - localEpcPassword = EPC.Password - mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) - eth_interface = 'any' - fltr = 'sctp' - logging.debug('\u001B[1m Launching tshark on EPC on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') - self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap' - mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5) - mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) - mySSH.close() - mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath, '\$', 5) # Initialize_eNB_args usually start with -O and followed by the location in repository @@ -166,10 +152,7 @@ class RANManagement(): result = re.search('^rru|^rcc|^du.band', str(config_file)) if result is not None: rruCheck = True - # Make a copy and adapt to EPC / eNB IP addresses mySSH.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) - localMmeIpAddr = EPC.MmeIPAddress - mySSH.command('sed -i -e \'s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + lIpAddr + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_GNB_IP_ADDR/' + lIpAddr + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_RCC_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); @@ -225,20 +208,6 @@ class RANManagement(): doLoop = False logging.error('\u001B[1;37;41m eNB/gNB logging system did not show got sync! \u001B[0m') HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'KO', CONST.ALL_PROCESSES_OK) - # In case of T tracer recording, we need to kill tshark on EPC side - localEpcIpAddr = EPC.IPAddress - localEpcUserName = EPC.UserName - localEpcPassword = EPC.Password - mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) - logging.debug('\u001B[1m Stopping tshark on EPC \u001B[0m') - mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) - if self.epcPcapFile != '': - mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5) - mySSH.close() - if self.epcPcapFile != '': - copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.') - if (copyin_res == 0): - mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.') return False else: mySSH.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | grep -E --text --color=never -i "wait|sync|Starting|Started"', '\$', 4) @@ -316,7 +285,7 @@ class RANManagement(): mySSH.close() return success - def TerminateeNB(self, HTML, EPC): + def TerminateeNB(self, HTML): if self.eNB_serverId[self.eNB_instance] == '0': lIpAddr = self.eNBIPAddress lUserName = self.eNBUserName @@ -359,20 +328,6 @@ class RANManagement(): mySSH.command('echo ' + lPassWord + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) time.sleep(1) mySSH.close() - if EPC.IPAddress != "none" and EPC.IPAddress != '': - localEpcIpAddr = EPC.IPAddress - localEpcUserName = EPC.UserName - localEpcPassword = EPC.Password - logging.debug('\u001B[1m Stopping tshark on EPC (' + localEpcIpAddr + ') \u001B[0m') - mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) - mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) - time.sleep(1) - if self.epcPcapFile != '': - mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5) - mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.') - mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.') - mySSH.command('killall --signal SIGKILL record', '\$', 5) - mySSH.close() # if T tracer was run with option 0 (no logs), analyze logs # from textlog, otherwise do normal analysis (e.g., option 2) result = re.search('T_stdout 0', str(self.Initialize_eNB_args)) From dc694475d0d059f1588a2b87b92bd536d40b124f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 7 Nov 2024 16:33:11 +0100 Subject: [PATCH 15/35] Add helper class for core network handling in CI This adds a helper class to manage various core networks in the CI testing framework. Specifically, it reads from a YAML file information such as a node, (un-)deployment script (file), log collection instructions, etc., in order to allow a common interface to be used to deploy and undeploy various core network implementations. This commit adds the class (in cls_corenetwork.py) as well as tests for this class. --- ci-scripts/cls_corenetwork.py | 169 +++++++++++++++++++ ci-scripts/tests/README.md | 1 + ci-scripts/tests/config/test_core_infra.yaml | 46 +++++ ci-scripts/tests/corenetwork.py | 66 ++++++++ ci-scripts/tests/scripts/deploy-core.sh | 12 ++ 5 files changed, 294 insertions(+) create mode 100644 ci-scripts/cls_corenetwork.py create mode 100644 ci-scripts/tests/config/test_core_infra.yaml create mode 100644 ci-scripts/tests/corenetwork.py create mode 100755 ci-scripts/tests/scripts/deploy-core.sh diff --git a/ci-scripts/cls_corenetwork.py b/ci-scripts/cls_corenetwork.py new file mode 100644 index 0000000000..7bb508d86b --- /dev/null +++ b/ci-scripts/cls_corenetwork.py @@ -0,0 +1,169 @@ +# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more +# * contributor license agreements. See the NOTICE file distributed with +# * this work for additional information regarding copyright ownership. +# * The OpenAirInterface Software Alliance licenses this file to You under +# * the OAI Public License, Version 1.1 (the "License"); you may not use this file +# * except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * http://www.openairinterface.org/?page_id=698 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# *------------------------------------------------------------------------------- +# * For more information about the OpenAirInterface (OAI) Software Alliance: +# * contact@openairinterface.org +# */ +#--------------------------------------------------------------------- +# +# Required Python Version +# Python 3.x +# +#--------------------------------------------------------------------- + +import logging +import yaml +import re + +import cls_cmd + +def listify(s): + if s is None: + return None + if isinstance(s, list): + return [str(x) for x in s] + return [str(s)] + +class CoreNetwork: + + def __init__(self, cn_name, node=None, d=None, filename="ci_infra.yaml"): + with open(filename, "r") as f: + all_cns = yaml.load(f, Loader=yaml.FullLoader) # TODO why full? + c = all_cns.get(cn_name) + if c is None: + raise Exception(f'no such core network name "{cn_name}" in "{filename}"') + self._cn_name = cn_name + 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%%)") + self._host = node + if d is not None: + raise Exception("directory handling not implemented") + self._deploy = listify(c.get('Deploy')) + self._undeploy = listify(c.get('Undeploy')) + self._logCollect = listify(c.get('LogCollect')) + # check if at least one command contains "%%log_dir%%" + if self._logCollect and not any(filter(lambda s: "%%log_dir%%" in s, self._logCollect)): + raise ValueError(f"(At least one) LogCollect expression for {cn_name} must contain \"%%log_dir%%\"") + self._getNetwork = listify(c.get('NetworkScript')) + self._cmd_prefix = c.get('CmdPrefix') + iperf = c.get('RunIperf3Server') + self._run_iperf = bool(iperf if iperf is not None else True) + logging.info(f'initialized core {self} from {filename}') + + def __str__(self): + return f"{self._cn_name}@{self._host} [IP: {self.getIP()}]" + + def __repr__(self): + return self.__str__() + + def _exec_script(host, line, silent): + # take off "!", split in words + words = line[1:].strip().split(" ") + script_name = words[0] + options = " ".join(words[1:]) + ret = cls_cmd.runScript(host, script_name, 300, parameters=options, silent=silent) + return ret + + def _command(self, cmd_list, must_succeed=False, silent=False): + succeeded = True + output = "" + with cls_cmd.getConnection(self._host) as c: + for cmd in cmd_list: + cmd = cmd.strip() + if cmd.startswith("!"): + ret = CoreNetwork._exec_script(self._host, cmd, silent=silent) + else: + ret = c.run(cmd, silent=silent) + output += ret.stdout + if ret.returncode != 0: + logging.warn(f"cmd \"{cmd}\" returned code {ret.returncode}, stdout {ret.stdout}") + if ret.returncode != 0 and must_succeed: + succeeded = False + break + return succeeded, output + + def deploy(self): + # we first undeploy to make sure the core has been stopped + logging.info(f'undeploy core network {self} before deployment') + self._command(self._undeploy) + logging.info(f'deploy core network {self}') + success, output = self._command(self._deploy, must_succeed=True) + if not success: + logging.error(f'failure during deployment of core network {self}:\n{output}') + return False, output + logging.info(f'retrieve IP address') + ip = self.getIP() + if ip is None: + logging.error(f'could not retrieve pingable address of core network {self}') + return False, output + logging.info(f'deployed core network {self}, pingable IP address {ip}') + return True, output + + def _collect_logs(self, log_dir): + logging.info(f'collecting logs into (local) {log_dir}') + remote_dir = "/tmp/cn-undeploy-logs" + with cls_cmd.getConnection(self._host) as c: + # create a directory for log collection + c.run(f'rm -rf {remote_dir}') + ret = c.run(f'mkdir {remote_dir}') + if ret.returncode != 0: + logging.error("cannot create directory for log collection") + return [] + # inform core network implementation where to store logs + # (remote_dir), and trigger log collection + log_cmd = [s.replace('%%log_dir%%', remote_dir) for s in self._logCollect] + self._command(log_cmd) + # enumerate collected files + ret = c.run(f'ls {remote_dir}/*') + if ret.returncode != 0: + logging.error("cannot enumerate log files") + return [] + log_files = [] + # copy them to the executor one by one, and store in log_dir + for f in ret.stdout.split("\n"): + l = f.replace(remote_dir, log_dir) + c.copyin(f, l) + log_files.append(l) + c.run(f'rm -rf {remote_dir}') + return log_files + + def undeploy(self, log_dir=None): + log_files = [] + if log_dir is not None: + log_files = self._collect_logs(log_dir) + else: + logging.warning("no directory for log collection specified, cannot retrieve core network logs") + logging.info(f'undeploy core network {self}') + _, output = self._command(self._undeploy) + return log_files, output + + def getIP(self): + success, output = self._command(self._getNetwork) + result = re.search(r'inet (?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output) + if success and result and result.group('ip'): + return result.group('ip') + return None + + def getCmdPrefix(self): + return self._cmd_prefix or "" + + def getHost(self): + return self._host + + def runIperf3Server(self): + return self._run_iperf diff --git a/ci-scripts/tests/README.md b/ci-scripts/tests/README.md index 364cf031d3..f583c51c08 100644 --- a/ci-scripts/tests/README.md +++ b/ci-scripts/tests/README.md @@ -12,6 +12,7 @@ To run individual unit tests, start them like so: python tests/build.py -v python tests/cmd.py -v + python tests/corenetwork.py -v python tests/deployment.py -v python tests/iperf-analysis.py -v python tests/ping-iperf.py -v diff --git a/ci-scripts/tests/config/test_core_infra.yaml b/ci-scripts/tests/config/test_core_infra.yaml new file mode 100644 index 0000000000..dfa0b4817d --- /dev/null +++ b/ci-scripts/tests/config/test_core_infra.yaml @@ -0,0 +1,46 @@ +test: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" + Deploy: echo deploy + Undeploy: echo undeploy + LogCollect: echo logs > %%log_dir%%/logs + +test_list: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" + Deploy: + - echo deploy + - echo multistep deploy!! + Undeploy: + - "echo undeploy" + - "echo terminated" + LogCollect: + - echo logs > %%log_dir%%/logs + RunIperf3Server: false + +test_fail: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" + Deploy: + - echo deploy + - "false" + - echo multistep deploy!! + Undeploy: + - "echo undeploy" + - "echo terminated" + LogCollect: + - echo logs > %%log_dir%%/logs + +test_script: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" + Deploy: ! tests/scripts/deploy-core.sh + Undeploy: "echo undeploy" + LogCollect: echo logs > %%log_dir%%/logs + +test_script_fail: + Host: localhost + NetworkScript: echo "inet 127.0.0.1 mtu 1500" + Deploy: ! tests/scripts/deploy-core.sh WILLFAIL + Undeploy: "echo undeploy" + LogCollect: echo logs > %%log_dir%%/logs diff --git a/ci-scripts/tests/corenetwork.py b/ci-scripts/tests/corenetwork.py new file mode 100644 index 0000000000..77e5c7629e --- /dev/null +++ b/ci-scripts/tests/corenetwork.py @@ -0,0 +1,66 @@ +import sys +import logging +logging.basicConfig( + level=logging.DEBUG, + stream=sys.stdout, + format="[%(asctime)s] %(levelname)8s: %(message)s" +) +import os + +import unittest + +sys.path.append('./') # to find OAI imports below +import cls_corenetwork +import cls_cmd + +class TestCoreNetwork(unittest.TestCase): + def test_simple_core(self): + c = cls_corenetwork.CoreNetwork("test", filename="tests/config/test_core_infra.yaml") + success, output = c.deploy() + self.assertTrue(success) + self.assertEqual(output, "deploy") + # should not have it set in config + self.assertTrue(c.runIperf3Server()) + self.assertEqual(c.getIP(), "127.0.0.1") + log_files, output = c.undeploy(log_dir="/tmp") + self.assertEqual(output, "undeploy") + with cls_cmd.LocalCmd() as cmd: + # there must be one log file for this (test) core + self.assertEqual(len(log_files), 1) + # test core writes to %%log_dir%%/logs, which expands to /tmp/logs + l = log_files[0] + self.assertEqual(l, "/tmp/logs") + ret = cmd.run(f"cat {l}") + self.assertEqual(ret.returncode, 0) # command must succeed + self.assertEqual(ret.stdout, "logs") # output should be "logs" + + def test_core_list(self): + c = cls_corenetwork.CoreNetwork("test_list", filename="tests/config/test_core_infra.yaml") + success, _ = c.deploy() + self.assertTrue(success) + self.assertFalse(c.runIperf3Server()) + c.undeploy(log_dir="/tmp") + + def test_core_fail(self): + c = cls_corenetwork.CoreNetwork("test_fail", filename="tests/config/test_core_infra.yaml") + success, _ = c.deploy() + self.assertFalse(success) + # undeployment should still work + c.undeploy(log_dir="/tmp") + + def test_core_script(self): + c = cls_corenetwork.CoreNetwork("test_script", filename="tests/config/test_core_infra.yaml") + success, output = c.deploy() + self.assertTrue(success) + self.assertEqual(output, "deployment from script") + c.undeploy() + + def test_core_script_fail(self): + c = cls_corenetwork.CoreNetwork("test_script_fail", filename="tests/config/test_core_infra.yaml") + success, output = c.deploy() + self.assertFalse(success) + self.assertEqual(output, "deployment from script\nfailing") + c.undeploy() + +if __name__ == '__main__': + unittest.main() diff --git a/ci-scripts/tests/scripts/deploy-core.sh b/ci-scripts/tests/scripts/deploy-core.sh new file mode 100755 index 0000000000..215ee15f70 --- /dev/null +++ b/ci-scripts/tests/scripts/deploy-core.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function die() { + echo $@ + exit 1 +} + +echo "deployment from script" + +[ $# -gt 0 ] && die "failing" + +exit 0 From d1f58d14300c458d143765e0a19f1ce6e6804c13 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Nov 2024 19:02:47 +0100 Subject: [PATCH 16/35] Use new core network class in Iperf()/Iperf2_Unidir()/Ping() Use the core network class to configure one "end" of these tests. This will make the tests more generic and predictable, as they are explicitly configured through two ci_infra.yaml "entities", instead of some implicit "EPC" IP address given in configuration. As of this commit, no XML passes this info into the framework, so no XML step will work. As it is many changes, the following commits will add the necessary info one by one. --- ci-scripts/cls_module.py | 12 ------ ci-scripts/cls_oaicitest.py | 69 +++++++++++++--------------------- ci-scripts/main.py | 7 ++-- ci-scripts/tests/ping-iperf.py | 13 ++----- 4 files changed, 34 insertions(+), 67 deletions(-) diff --git a/ci-scripts/cls_module.py b/ci-scripts/cls_module.py index e314281a0e..4eadddf686 100644 --- a/ci-scripts/cls_module.py +++ b/ci-scripts/cls_module.py @@ -62,9 +62,6 @@ class Module_UE: self.trace = m.get('trace') == True self.logStore = m.get('LogStore') self.cmd_prefix = m.get('CmdPrefix') - self.runIperf3Server = m.get('RunIperf3Server', True) - self.namespace = m.get('Namespace') - self.cnPath = m.get('CNPath') logging.info(f'initialized UE {self} from {filename}') def __str__(self): @@ -190,15 +187,6 @@ class Module_UE: def getHost(self): return self.host - def getNamespace(self): - return self.namespace - - def getCNPath(self): - return self.cnPath - - def getRunIperf3Server(self): - return self.runIperf3Server - def getCmdPrefix(self): return self.cmd_prefix if self.cmd_prefix else "" diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 23e0ca79d6..fbc6fa4002 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -45,6 +45,7 @@ import helpreadme as HELP import constants as CONST import cls_module +import cls_corenetwork import cls_cmd #----------------------------------------------------------- @@ -362,8 +363,7 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue('NA', 'OK', messages) return True - def Ping_common(self, EPC, ue, logPath): - # Launch ping on the EPC side (true for ltebox and old open-air-cn) + def Ping_common(self, cn, ue, logPath): ping_status = 0 ueIP = ue.getIP() if not ueIP: @@ -371,18 +371,9 @@ class OaiCiTest(): ping_log_file = f'ping_{self.testCase_id}_{ue.getName()}.log' ping_time = re.findall("-c *(\d+)",str(self.ping_args)) local_ping_log_file = f'{logPath}/{ping_log_file}' - # if has pattern %cn_ip%, replace with core IP address, else we assume the IP is present + # 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): - #target address is different depending on EPC type - if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE): - self.ping_args = re.sub('%cn_ip%', EPC.MmeIPAddress, self.ping_args) - elif re.match('OAICN5G', EPC.Type, re.IGNORECASE): - self.ping_args = re.sub('%cn_ip%', EPC.MmeIPAddress, self.ping_args) - elif re.match('OC-OAI-CN5G', EPC.Type, re.IGNORECASE): - self.ping_args = re.sub('%cn_ip%', '172.21.6.100', self.ping_args) - else: - self.ping_args = re.sub('%cn_ip%', EPC.IPAddress, self.ping_args) - #ping from module NIC rather than IP address to make sure round trip is over the air + self.ping_args = re.sub('%cn_ip%', cn.getIP(), self.ping_args) 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()) @@ -433,13 +424,9 @@ class OaiCiTest(): return (True, message) - def Ping(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - - if self.ue_ids == []: - raise Exception("no module names in self.ue_ids provided") + def Ping(self, HTML, CONTAINERS, infra_file="ci_infra.yaml"): + if self.ue_ids == [] or self.svr_id == None: + raise Exception("no module names in self.ue_ids or/and self.svr_id provided") # Creating destination log folder if needed on the python executor workspace with cls_cmd.getConnection('localhost') as local: ymlPath = CONTAINERS.yamlPath[0].split('/') @@ -447,8 +434,10 @@ class OaiCiTest(): local.run(f'mkdir -p {logPath}', silent=True) ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)] logging.debug(ues) + cn = cls_corenetwork.CoreNetwork(self.svr_id, self.svr_node, filename=infra_file) + logging.debug(cn) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: - futures = [executor.submit(self.Ping_common, EPC, ue, logPath) for ue in ues] + futures = [executor.submit(self.Ping_common, cn, ue, logPath) for ue in ues] results = [f.result() for f in futures] # each result in results is a tuple, first member goes to successes, second to messages successes, messages = map(list, zip(*results)) @@ -469,15 +458,14 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(self.ping_args, 'KO', messages) return success - def Iperf_Module(self, EPC, ue, svr, idx, ue_num, logPath): + def Iperf_Module(self, cn, ue, idx, ue_num, logPath): ueIP = ue.getIP() if not ueIP: return (False, f"UE {ue.getName()} has no IP address") - svrIP = svr.getIP() + svrIP = cn.getIP() if not svrIP: return (False, f"Iperf server {ue.getName()} has no IP address") - runIperf3Server = svr.getRunIperf3Server() iperf_opt = self.iperf_args jsonReport = "--json" serverReport = "" @@ -494,13 +482,13 @@ class OaiCiTest(): # hack: the ADB UEs don't have iperf in $PATH, so we need to hardcode for the moment iperf_ue = '/data/local/tmp/iperf3' if re.search('adb', ue.getName()) else 'iperf3' ue_header = f'UE {ue.getName()} ({ueIP})' - with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(EPC.IPAddress) as cmd_svr: + with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(cn.getHost()) as cmd_svr: port = 5002 + idx # note: some core setups start an iperf3 server automatically, indicated in ci_infra by runIperf3Server: False` t = iperf_time * 2.5 cmd_ue.run(f'rm /tmp/{client_filename}', reportNonZero=False, silent=True) - if runIperf3Server: - cmd_svr.run(f'{svr.getCmdPrefix()} timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} >> /dev/null &', timeout=t) + if cn.runIperf3Server(): + cmd_svr.run(f'{cn.getCmdPrefix()} timeout -vk3 {t} iperf3 -s -B {svrIP} -p {port} -1 {jsonReport} >> /dev/null &', timeout=t) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} {iperf_ue} -B {ueIP} -c {svrIP} -p {port} {iperf_opt} {jsonReport} {serverReport} -O 5 >> /tmp/{client_filename}', timeout=t) # note: copy iperf3 log to the current directory for log analysis and log collection dest_filename = f'{logPath}/{client_filename}' @@ -515,11 +503,7 @@ class OaiCiTest(): return (status, f'{ue_header}\n{msg}') - def Iperf(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - + def Iperf(self, HTML, CONTAINERS, infra_file="ci_infra.yaml"): logging.debug(f'Iperf: iperf_args "{self.iperf_args}" iperf_packetloss_threshold "{self.iperf_packetloss_threshold}" iperf_bitrate_threshold "{self.iperf_bitrate_threshold}" iperf_profile "{self.iperf_profile}" iperf_options "{self.iperf_options}"') if self.ue_ids == [] or self.svr_id == None: @@ -530,10 +514,11 @@ class OaiCiTest(): logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' local.run(f'mkdir -p {logPath}', silent=True) ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)] - svr = cls_module.Module_UE(self.svr_id,self.svr_node, infra_file) logging.debug(ues) + cn = cls_corenetwork.CoreNetwork(self.svr_id, self.svr_node, filename=infra_file) + logging.debug(cn) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: - futures = [executor.submit(self.Iperf_Module, EPC, ue, svr, i, len(ues), logPath) for i, ue in enumerate(ues)] + futures = [executor.submit(self.Iperf_Module, cn, ue, i, len(ues), logPath) for i, ue in enumerate(ues)] results = [f.result() for f in futures] # each result in results is a tuple, first member goes to successes, second to messages successes, messages = map(list, zip(*results)) @@ -554,15 +539,15 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(self.iperf_args, 'KO', messages) return success - def Iperf2_Unidir(self, HTML, EPC, CONTAINERS, infra_file="ci_infra.yaml"): + def Iperf2_Unidir(self, HTML, CONTAINERS, infra_file="ci_infra.yaml"): if self.ue_ids == [] or self.svr_id == None or len(self.ue_ids) != 1: raise Exception("no module names in self.ue_ids or/and self.svr_id provided, multi UE scenario not supported") ue = cls_module.Module_UE(self.ue_ids[0].strip(),self.nodes[0].strip(), infra_file) - svr = cls_module.Module_UE(self.svr_id,self.svr_node, infra_file) + cn = cls_corenetwork.CoreNetwork(self.svr_id, self.svr_node, filename=infra_file) ueIP = ue.getIP() if not ueIP: return False - svrIP = svr.getIP() + svrIP = cn.getIP() if not svrIP: return False server_filename = f'iperf_server_{self.testCase_id}_{ue.getName()}.log' @@ -573,17 +558,15 @@ class OaiCiTest(): t = iperf_time*2.5 with cls_cmd.getConnection('localhost') as local: local.run(f'mkdir -p {logPath}') - with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(EPC.IPAddress) as cmd_svr: + with cls_cmd.getConnection(ue.getHost()) as cmd_ue, cls_cmd.getConnection(cn.getHost()) as cmd_svr: cmd_ue.run(f'rm /tmp/{server_filename}', reportNonZero=False) cmd_ue.run(f'{ue.getCmdPrefix()} timeout -vk3 {t} iperf -B {ueIP} -s -u -i1 >> /tmp/{server_filename} &', timeout=t) - cmd_svr.run(f'{svr.getCmdPrefix()} timeout -vk3 {t} iperf -c {ueIP} -B {svrIP} {iperf_opt} -i1 >> /dev/null', timeout=t) + cmd_svr.run(f'{cn.getCmdPrefix()} timeout -vk3 {t} iperf -c {ueIP} -B {svrIP} {iperf_opt} -i1 >> /dev/null', timeout=t) localPath = f'{os.getcwd()}' # note: copy iperf2 log to the directory for log collection - cmd_ue.copyin(f'/tmp/{server_filename}', f'{localPath}/{logPath}/{server_filename}') - # note: copy iperf2 log to the current directory for log analysis and log collection - cmd_ue.copyin(f'/tmp/{server_filename}', f'{localPath}/{server_filename}') + cmd_ue.copyin(f'/tmp/{server_filename}', f'{logPath}/{server_filename}') cmd_ue.run(f'rm /tmp/{server_filename}', reportNonZero=False) - success, msg = Iperf_analyzeV2UDP(server_filename, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) + success, msg = Iperf_analyzeV2UDP(f'{logPath}/{server_filename}', self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate) ue_header = f'UE {ue.getName()} ({ueIP})' logging.info(f'\u001B[1;37;45m iperf result for {ue_header}\u001B[0m') for l in msg.split('\n'): diff --git a/ci-scripts/main.py b/ci-scripts/main.py index b02cd447f9..0bb21a785d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -242,6 +242,7 @@ def ExecuteActionWithParam(action): CiTestObj.ping_args = test.findtext('ping_args') CiTestObj.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold') CiTestObj.ue_ids = test.findtext('id').split(' ') + CiTestObj.svr_id = test.findtext('svr_id') or None if force_local: # Change all execution targets to localhost CiTestObj.nodes = ['localhost'] * len(CiTestObj.ue_ids) @@ -254,7 +255,7 @@ def ExecuteActionWithParam(action): else: CiTestObj.nodes = [None] * len(CiTestObj.ue_ids) ping_rttavg_threshold = test.findtext('ping_rttavg_threshold') or '' - success = CiTestObj.Ping(HTML,EPC,CONTAINERS) + success = CiTestObj.Ping(HTML, CONTAINERS) elif action == 'Iperf' or action == 'Iperf2_Unidir': CiTestObj.iperf_args = test.findtext('iperf_args') @@ -285,9 +286,9 @@ def ExecuteActionWithParam(action): logging.error('test-case has wrong option ' + CiTestObj.iperf_options) CiTestObj.iperf_options = 'check' if action == 'Iperf': - success = CiTestObj.Iperf(HTML, EPC, CONTAINERS) + success = CiTestObj.Iperf(HTML, CONTAINERS) elif action == 'Iperf2_Unidir': - success = CiTestObj.Iperf2_Unidir(HTML, EPC, CONTAINERS) + success = CiTestObj.Iperf2_Unidir(HTML, CONTAINERS) elif action == 'IdleSleep': st = test.findtext('idle_sleep_time_in_sec') or "5" diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py index 94186de606..6fcc159e3d 100644 --- a/ci-scripts/tests/ping-iperf.py +++ b/ci-scripts/tests/ping-iperf.py @@ -14,7 +14,6 @@ sys.path.append('./') # to find OAI imports below import cls_oai_html import cls_oaicitest import cls_containerize -import epc class TestPingIperf(unittest.TestCase): def setUp(self): @@ -24,18 +23,14 @@ class TestPingIperf(unittest.TestCase): self.ci.ue_ids = ["test"] self.ci.nodes = ["localhost"] self.cont = cls_containerize.Containerize() - self.epc = epc.EPCManagement() - self.epc.IPAddress = "localhost" - self.epc.UserName = None - self.epc.Password = None - self.epc.SourceCodePath = os.getcwd() def test_ping(self): self.ci.ping_args = "-c3 127.0.0.1" self.ci.ping_packetloss_threshold = "0" + self.ci.svr_id = "test" infra_file = "tests/config/infra_ping_iperf.yaml" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Ping(self.html, self.epc, self.cont, infra_file=infra_file) + success = self.ci.Ping(self.html, self.cont, infra_file=infra_file) self.assertTrue(success) def test_iperf(self): @@ -50,7 +45,7 @@ class TestPingIperf(unittest.TestCase): self.ci.iperf_profile = "balanced" infra_file = "tests/config/infra_ping_iperf.yaml" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Iperf(self.html, self.epc, self.cont, infra_file=infra_file) + success = self.ci.Iperf(self.html, self.cont, infra_file=infra_file) self.assertTrue(success) def test_iperf2_unidir(self): @@ -62,7 +57,7 @@ class TestPingIperf(unittest.TestCase): self.ci.iperf_profile = "balanced" infra_file = "tests/config/infra_ping_iperf.yaml" # TODO Should need nothing but options and UE(s) to use - success = self.ci.Iperf2_Unidir(self.html, self.epc, self.cont, infra_file=infra_file) + success = self.ci.Iperf2_Unidir(self.html, self.cont, infra_file=infra_file) self.assertTrue(success) if __name__ == '__main__': From 6bd96f1b5f9ff9b30de652e452dfb8ac7f6217d1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 12:10:41 +0100 Subject: [PATCH 17/35] CI Ping, Iperf: remove UE/CN logging, is done automatically --- ci-scripts/cls_oaicitest.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index fbc6fa4002..77c4d940f7 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -433,9 +433,7 @@ class OaiCiTest(): logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' local.run(f'mkdir -p {logPath}', silent=True) ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)] - logging.debug(ues) cn = cls_corenetwork.CoreNetwork(self.svr_id, self.svr_node, filename=infra_file) - logging.debug(cn) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(self.Ping_common, cn, ue, logPath) for ue in ues] results = [f.result() for f in futures] @@ -514,9 +512,7 @@ class OaiCiTest(): logPath = f'{os.getcwd()}/../cmake_targets/log/{ymlPath[-1]}' local.run(f'mkdir -p {logPath}', silent=True) ues = [cls_module.Module_UE(ue_id, server_name, infra_file) for ue_id, server_name in zip(self.ue_ids, self.nodes)] - logging.debug(ues) cn = cls_corenetwork.CoreNetwork(self.svr_id, self.svr_node, filename=infra_file) - logging.debug(cn) with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor: futures = [executor.submit(self.Iperf_Module, cn, ue, i, len(ues), logPath) for i, ue in enumerate(ues)] results = [f.result() for f in futures] From 246ad2dda31d7c0a635a87ec9bd92d004d92ae5b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 13 Nov 2024 10:15:04 +0100 Subject: [PATCH 18/35] Add (Un)deployCoreNetwork in test framework --- ci-scripts/cls_oaicitest.py | 29 +++++++++++++++++++++++++++++ ci-scripts/main.py | 5 +++++ ci-scripts/xml_class_list.yml | 2 ++ 3 files changed, 36 insertions(+) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 77c4d940f7..282667df31 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -854,6 +854,35 @@ class OaiCiTest(): HTML.CreateHtmlTestRowQueue(f'N/A', 'OK', messages) 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): # Some pipelines are using "none" IP / Credentials # In that case, just forget about it diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 0bb21a785d..efb4f97166 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -339,6 +339,11 @@ def ExecuteActionWithParam(action): EPC.cnID = test.findtext('cn_id') 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": eNB_instance=test.findtext('eNB_instance') if (eNB_instance is None): diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index a526058af0..5ad4c0820e 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -25,6 +25,8 @@ - Terminate_SPGW - Initialize_5GCN - Terminate_5GCN + - DeployCoreNetwork + - UndeployCoreNetwork - IdleSleep - Build_Image - Build_Run_Tests From 5f3f8370212d22e14d6c0165e5aa894377f863f3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Nov 2024 08:03:38 +0100 Subject: [PATCH 19/35] CI: deploy sabox 5GC through cls_core.py, use in Ping/Iperf - issue sabox commands from ci_infra.yaml - use for sabox-nepes (un)deployment, ping, iperf in all XML files --- ci-scripts/ci_infra.yaml | 7 +++++++ ci-scripts/epc.py | 20 ++----------------- .../xml_files/container_sa_b200_quectel.xml | 2 ++ .../container_sa_e1_b200_quectel.xml | 1 + .../container_sa_f1_b200_quectel.xml | 4 ++++ .../container_sa_sc_b200_quectel.xml | 2 ++ ci-scripts/xml_files/fr1_5gc_closure.xml | 3 ++- ci-scripts/xml_files/fr1_5gc_start.xml | 3 ++- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index ec13d1ada8..06e42bd5e6 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -105,6 +105,13 @@ ltebox-nano: sabox-nepes: Host: nepes NetworkScript: ip a show dev tun1 + Deploy: + - "sudo su -c 'screen -dm -S simulated_5g_hss /opt/hss_sim0609/start_5g_hss'" + - "sleep 1" + - "sudo /opt/ltebox/tools/start_sabox < /dev/null &> /dev/null" + - "sleep 1" + LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{amfLog.0,ngapcLog.0,ngapcommonLog.0,ngapsLog.0,xGwLog.0,upfLog.0} %%log_dir%%" + Undeploy: "sudo /opt/ltebox/tools/stop_sabox; sudo killall screen" ltebox-nepes: Host: nepes diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index a3b8d72ea1..e10c9ef485 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -252,16 +252,7 @@ class EPCManagement(): mySSH = cls_cmd.getConnection(self.IPAddress) html_cell = '' if re.match('ltebox', self.Type, re.IGNORECASE): - logging.debug('Using the SABOX simulated HSS') - mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) - mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('cd /opt/hss_sim0609', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f hss.log', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S echo "Starting sudo session" && sudo su -c "screen -dm -S simulated_5g_hss ./start_5g_hss"', '\$', 5) - logging.debug('Using the sabox') - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./start_sabox', '\$', 5) - html_cell += 'N/A\n' + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): logging.debug('Starting OAI CN5G') mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) @@ -464,14 +455,7 @@ class EPCManagement(): mySSH = cls_cmd.getConnection(self.IPAddress) message = '' if re.match('ltebox', self.Type, re.IGNORECASE): - logging.debug('Terminating SA BOX') - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_sabox', '\$', 5) - time.sleep(1) - mySSH.command('cd ' + self.SourceCodePath, '\$', 5) - mySSH.command('cd scripts', '\$', 5) - time.sleep(1) - mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_5g_hss -X quit', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): logging.debug('OAI CN5G Collecting Log files to workspace') mySSH.command('echo ' + self.Password + ' | sudo rm -rf ' + self.SourceCodePath + '/logs', '\$', 5) diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index 51d9c314b4..e75eb2a977 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -130,6 +130,7 @@ Ping Ping: 20pings in 20sec idefix + sabox-nepes -c 20 %cn_ip% 1 15 @@ -139,6 +140,7 @@ Ping Ping: 100pings in 20sec idefix + sabox-nepes -c 100 -i 0.2 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml index f93da0e890..10acef9644 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml @@ -131,6 +131,7 @@ Ping Ping: 50pings in 10sec idefix + sabox-nepes -c 20 -i 0.2 %cn_ip% 1 25 diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index 82f3cc84e5..d9743704df 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -143,6 +143,7 @@ Ping Ping: 20pings in 20sec idefix + sabox-nepes -c 20 %cn_ip% 1 25 @@ -152,6 +153,7 @@ Ping Ping: 100pings in 20sec idefix + sabox-nepes -c 100 -i 0.2 %cn_ip% 1 110 @@ -161,6 +163,7 @@ Ping Ping: 20pings in 20sec idefix + sabox-nepes -c 20 %cn_ip% 1 110 @@ -170,6 +173,7 @@ Ping Ping: 100pings in 20sec idefix + sabox-nepes -c 100 -i 0.2 %cn_ip% 1 110 diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml index 0c76a17eb9..d301bee3ac 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml @@ -124,6 +124,7 @@ Ping Ping: 20pings in 20sec idefix + sabox-nepes -c 20 %cn_ip% 1 15 @@ -133,6 +134,7 @@ Ping Ping: 100pings in 20sec idefix + sabox-nepes -c 100 -i 0.2 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/fr1_5gc_closure.xml b/ci-scripts/xml_files/fr1_5gc_closure.xml index e5e57fa694..fa524a60aa 100644 --- a/ci-scripts/xml_files/fr1_5gc_closure.xml +++ b/ci-scripts/xml_files/fr1_5gc_closure.xml @@ -30,8 +30,9 @@ - Terminate_5GCN + UndeployCoreNetwork Terminate 5GC + sabox-nepes diff --git a/ci-scripts/xml_files/fr1_5gc_start.xml b/ci-scripts/xml_files/fr1_5gc_start.xml index 8758b761cd..14bb55f612 100644 --- a/ci-scripts/xml_files/fr1_5gc_start.xml +++ b/ci-scripts/xml_files/fr1_5gc_start.xml @@ -31,8 +31,9 @@ - Initialize_5GCN + DeployCoreNetwork Initialize 5GC + sabox-nepes From bd2b833c5858568df22cd43d44587f5886c93b42 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 19 Mar 2025 08:51:47 +0100 Subject: [PATCH 20/35] CI: deploy OpenShift-based 5GC through CoreNetwork, use in Ping/Iperf - Use scripts to deploy OpenShift-based 5GC in ci_infra.yaml - Use for oc-cn5g, oc-cn5g-20897, and oc-cn5g-20897-aerial2 for (un)deployment, ping, iperf in relevant XML files - Convert hardcoded IP addresses to %cn_ip% --- ci-scripts/ci_infra.yaml | 15 +++--- ci-scripts/cls_cluster.py | 46 ------------------- ci-scripts/epc.py | 39 +++------------- ci-scripts/scripts/oc-cn5g-deploy.sh | 14 ++++++ ci-scripts/scripts/oc-cn5g-logcollect.sh | 21 +++++++++ ci-scripts/scripts/oc-cn5g-undeploy.sh | 14 ++++++ .../xml_files/container_sa_aerial_quectel.xml | 7 +-- .../xml_files/container_sa_aw2s_asue.xml | 2 + .../xml_files/container_sa_aw2s_asue_2x2.xml | 2 + .../container_sa_fhi72_metanoia_up2_2x2.xml | 3 +- .../xml_files/container_sa_fhi72_vvdn_up2.xml | 3 +- .../xml_files/container_sa_n310_nrue.xml | 2 + .../xml_files/sa_cn5g_20897_closure.xml | 2 +- ci-scripts/xml_files/sa_cn5g_20897_start.xml | 2 +- ci-scripts/xml_files/sa_cn5g_closure.xml | 2 +- ci-scripts/xml_files/sa_cn5g_start.xml | 2 +- ci-scripts/xml_files/sa_oaiue_cn5g_deploy.xml | 2 +- .../xml_files/sa_oaiue_cn5g_undeploy.xml | 2 +- 18 files changed, 84 insertions(+), 96 deletions(-) create mode 100755 ci-scripts/scripts/oc-cn5g-deploy.sh create mode 100755 ci-scripts/scripts/oc-cn5g-logcollect.sh create mode 100755 ci-scripts/scripts/oc-cn5g-undeploy.sh diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index 06e42bd5e6..f1c7d4b294 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -63,24 +63,27 @@ adb_ue_2: oc-cn5g: Host: avra - Namespace: "oaicicd-core-for-ci-ran" - CNPath: "/opt/oai-cn5g-fed-develop-2025-jan" NetworkScript: echo "inet 172.21.6.102" RunIperf3Server: False + Deploy: "! scripts/oc-cn5g-deploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-ci-ran" + Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-ci-ran" + LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-ci-ran %%log_dir%%" oc-cn5g-20897: Host: cacofonix - Namespace: "oaicicd-core-for-fhi72" - CNPath: "/opt/oai-cn5g-fed-develop-2025-jan" NetworkScript: echo "inet 172.21.6.105" RunIperf3Server: False + Deploy: "! scripts/oc-cn5g-deploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-fhi72" + Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-fhi72" + LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-fhi72 %%log_dir%%" oc-cn5g-20897-aerial2: Host: aerial2 - Namespace: "oaicicd-core-for-nvidia-aerial" - CNPath: "/opt/oai-cn5g-fed-develop-2025-jan" NetworkScript: echo "inet 172.21.6.105" RunIperf3Server: False + Deploy: "! scripts/oc-cn5g-deploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-nvidia-aerial" + Undeploy: "! scripts/oc-cn5g-undeploy.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-nvidia-aerial" + LogCollect: "! scripts/oc-cn5g-logcollect.sh /opt/oai-cn5g-fed-develop-2025-jan oaicicd-core-for-nvidia-aerial %%log_dir%%" matix-cn5g: Host: matix diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index bfa315b28e..67e6253dcc 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -43,9 +43,6 @@ NAMESPACE = "oaicicd-ran" OCUrl = "https://api.oai.cs.eurecom.fr:6443" OCRegistry = "default-route-openshift-image-registry.apps.oai.cs.eurecom.fr" CI_OC_RAN_NAMESPACE = "oaicicd-ran" -CN_IMAGES = ["mysql", "oai-nrf", "oai-amf", "oai-smf", "oai-upf", "oai-ausf", "oai-udm", "oai-udr", "oai-traffic-server"] -CN_CONTAINERS = ["", "-c nrf", "-c amf", "-c smf", "-c upf", "-c ausf", "-c udm", "-c udr", ""] - def OC_login(cmd, ocUserName, ocPassword, ocProjectName): if ocUserName == '' or ocPassword == '' or ocProjectName == '': @@ -67,49 +64,6 @@ def OC_login(cmd, ocUserName, ocPassword, ocProjectName): def OC_logout(cmd): cmd.run(f'oc logout') -def OC_deploy_CN(cmd, ocUserName, ocPassword, ocNamespace, path): - logging.debug(f'OC OAI CN5G: Deploying OAI CN5G on Openshift Cluster: {ocNamespace}') - succeeded = OC_login(cmd, ocUserName, ocPassword, ocNamespace) - if not succeeded: - return False, CONST.OC_LOGIN_FAIL - cmd.run(f'helm list -aq -n {ocNamespace} | xargs -r helm uninstall -n {ocNamespace} --wait') - ret = cmd.run(f'helm install --wait oai5gcn {path}/ci-scripts/charts/oai-5g-basic/.') - if ret.returncode != 0: - logging.error('OC OAI CN5G: Deployment failed') - OC_logout(cmd) - return False, CONST.OC_PROJECT_FAIL - report = cmd.run('oc get pods') - OC_logout(cmd) - return True, report - -def OC_undeploy_CN(cmd, ocUserName, ocPassword, ocNamespace, path): - logging.debug(f'OC OAI CN5G: Terminating CN on Openshift Cluster: {ocNamespace}') - succeeded = OC_login(cmd, ocUserName, ocPassword, ocNamespace) - if not succeeded: - return False, CONST.OC_LOGIN_FAIL - cmd.run(f'rm -Rf {path}/logs') - cmd.run(f'mkdir -p {path}/logs') - logging.debug('OC OAI CN5G: Collecting log files to workspace') - cmd.run(f'oc describe pod &> {path}/logs/describe-pods-post-test.log') - cmd.run(f'oc get pods.metrics.k8s &> {path}/logs/nf-resource-consumption.log') - for ii, ci in zip(CN_IMAGES, CN_CONTAINERS): - podName = cmd.run(f"oc get pods | grep {ii} | awk \'{{print $1}}\'").stdout.strip() - if not podName: - logging.debug(f'{ii} pod not found!') - else: - cmd.run(f'oc logs -f {podName} {ci} &> {path}/logs/{ii}.log &') - cmd.run(f'cd {path}/logs && zip -r -qq test_logs_CN.zip *.log') - cmd.copyin(f'{path}/logs/test_logs_CN.zip','test_logs_CN.zip') - ret = cmd.run(f'helm list -aq -n {ocNamespace} | xargs -r helm uninstall -n {ocNamespace} --wait') - if ret.returncode != 0: - logging.error('OC OAI CN5G: Undeployment failed') - cmd.run(f'helm list -aq -n {ocNamespace} | xargs -r helm uninstall -n {ocNamespace} --wait') - OC_logout(cmd) - return False, CONST.OC_PROJECT_FAIL - report = cmd.run('oc get pods') - OC_logout(cmd) - return True, report - class Cluster: def __init__(self): self.eNBIPAddress = "" diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index e10c9ef485..c4585b98b3 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -293,20 +293,7 @@ class EPCManagement(): html_cell += '(' + res4.group('date') + ')' html_cell += '\n' elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - cn = cls_module.Module_UE(self.cnID) - succeeded, report = OC.OC_deploy_CN(mySSH, self.OCUserName, self.OCPassword, cn.getNamespace(), cn.getCNPath()) - if not succeeded: - HTML.CreateHtmlTestRow('N/A', 'KO', report) - HTML.CreateHtmlTabFooter(False) - mySSH.close() - logging.error("OC OAI CN5G: CN deployment failed!") - return False - for line in report.stdout.split('\n')[1:]: - columns = line.strip().split() - name = columns[0] - status = columns[2] - html_cell += status + ' ' + name - html_cell += '\n' + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() @@ -334,9 +321,7 @@ class EPCManagement(): logging.error('no container with name oai-amf found, could not retrieve AMF IP address') mySSH.close() elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - response=mySSH.command3('oc pods ls -f name=oai-amf', 10) + raise NotImplemented("use cls_corenetwork.py") def TerminateHSS(self, HTML): mySSH = SSH.SSHConnection() @@ -479,15 +464,7 @@ class EPCManagement(): mySSH.copyin(f'{self.SourceCodePath}/logs/test_logs_CN.zip','test_logs_CN.zip') logging.debug(message) elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - cn = cls_module.Module_UE(self.cnID) - succeeded, report = OC.OC_undeploy_CN(mySSH, self.OCUserName, self.OCPassword, cn.getNamespace(), cn.getCNPath()) - if not succeeded: - HTML.CreateHtmlTestRow('N/A', 'KO', report) - HTML.CreateHtmlTabFooter(False) - logging.error("OC OAI CN5G: CN undeployment failed!") - return False - else: - message = report.stdout + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This should not happen!') mySSH.close() @@ -737,7 +714,7 @@ class EPCManagement(): elif re.match('OAICN5G', self.Type, re.IGNORECASE): logging.debug('LogCollect is bypassed for that variant') elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - logging.debug('LogCollect is bypassed for that variant') + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('zip hss.log.zip hss*.log', '\$', 60) mySSH.command('echo ' + self.Password + ' | sudo -S rm hss*.log', '\$', 5) @@ -777,9 +754,7 @@ class EPCManagement(): mySSH.command('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap','\$', 30) mySSH.command('mv mme.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - mySSH.run('cd ' + self.SourceCodePath + '/logs') - mySSH.run('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap') - mySSH.run('mv mme.log.zip ' + self.SourceCodePath + '/scripts') + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('zip mme.log.zip mme*.log', '\$', 60) mySSH.command('echo ' + self.Password + ' | sudo -S rm mme*.log', '\$', 5) @@ -814,9 +789,7 @@ class EPCManagement(): mySSH.command('zip spgw.log.zip oai-smf.log oai-spgwu.log','\$', 30) mySSH.command('mv spgw.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5) - mySSH.command('zip spgw.log.zip oai-smf.log oai-spgwu.log','\$', 30) - mySSH.command('mv spgw.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('zip spgw.log.zip spgw*.log', '\$', 60) mySSH.command('echo ' + self.Password + ' | sudo -S rm spgw*.log', '\$', 5) diff --git a/ci-scripts/scripts/oc-cn5g-deploy.sh b/ci-scripts/scripts/oc-cn5g-deploy.sh new file mode 100755 index 0000000000..99ba768898 --- /dev/null +++ b/ci-scripts/scripts/oc-cn5g-deploy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +function die() { echo $@; exit 1; } +[ $# -eq 2 ] || die "usage: $0 " + +OC_DIR=${1} +OC_NS=${2} + +cat ${OC_DIR}/oc-password | oc login -u oaicicd --server https://api.oai.cs.eurecom.fr:6443 > /dev/null +oc project ${OC_NS} > /dev/null +helm install --wait oai5gcn ${OC_DIR}/ci-scripts/charts/oai-5g-basic/. +oc logout > /dev/null diff --git a/ci-scripts/scripts/oc-cn5g-logcollect.sh b/ci-scripts/scripts/oc-cn5g-logcollect.sh new file mode 100755 index 0000000000..52cc5a8f8d --- /dev/null +++ b/ci-scripts/scripts/oc-cn5g-logcollect.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +function die() { echo $@; exit 1; } +[ $# -eq 3 ] || die "usage: $0 " + +OC_DIR=${1} +OC_NS=${2} +DIR=${3} + +cat ${OC_DIR}/oc-password | oc login -u oaicicd --server https://api.oai.cs.eurecom.fr:6443 > /dev/null +oc project ${OC_NS} > /dev/null +oc describe pod > ${DIR}/describe-pods-post-test.log +oc get pods.metrics.k8s &> ${DIR}/nf-resource-consumption.log +for p in nrf amf smf upf ausf udm udr; do + oc logs -l app.kubernetes.io/name=oai-${p} -c ${p} --tail=-1 > ${DIR}/oai-${p}.log +done +oc logs -l app.kubernetes.io/name=mysql --tail=-1 > ${DIR}/mysql.log +oc logs -l app.kubernetes.io/name=oai-traffic-server --tail=-1 > ${DIR}/oai-traffic-server.log +oc logout > /dev/null diff --git a/ci-scripts/scripts/oc-cn5g-undeploy.sh b/ci-scripts/scripts/oc-cn5g-undeploy.sh new file mode 100755 index 0000000000..e9cf421f6b --- /dev/null +++ b/ci-scripts/scripts/oc-cn5g-undeploy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +function die() { echo $@; exit 1; } +[ $# -eq 2 ] || die "usage: $0 " + +OC_DIR=${1} +OC_NS=${2} + +cat ${OC_DIR}/oc-password | oc login -u oaicicd --server https://api.oai.cs.eurecom.fr:6443 > /dev/null +oc project ${OC_NS} > /dev/null +helm uninstall oai5gcn --wait +oc logout > /dev/null diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml index 0b110cab3b..1d91dbd482 100644 --- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml +++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml @@ -42,7 +42,7 @@ - Initialize_5GCN + DeployCoreNetwork Initialize 5G Core oc-cn5g-20897-aerial2 @@ -89,7 +89,8 @@ Ping Ping: 100pings in 20sec up2-aerial - -c 100 -i 0.2 172.21.6.104 + oc-cn5g-20897-aerial2 + -c 100 -i 0.2 %cn_ip% 5 @@ -140,7 +141,7 @@ - Terminate_5GCN + UndeployCoreNetwork true Terminate 5G Core oc-cn5g-20897-aerial2 diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 701d4c23d5..29c864e8d1 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -225,6 +225,7 @@ Ping Ping: 50 pings in 10sec, multi-ue amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 + oc-cn5g -c 50 -i 0.2 %cn_ip% 5 25 @@ -240,6 +241,7 @@ Ping Ping: 50pings in 10sec, multi-ue amarisoft_ue_16 + oc-cn5g -c 50 -i 0.2 %cn_ip% 5 30 diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml b/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml index 9f6a373eca..87031898ba 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml @@ -222,6 +222,7 @@ Ping Ping: 20pings in 20sec, multi-ue amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 + oc-cn5g -c 20 %cn_ip% 5 25 @@ -237,6 +238,7 @@ Ping Ping: 50pings in 10sec, multi-ue amarisoft_ue_16 + oc-cn5g -c 50 -i 0.2 %cn_ip% 5 30 diff --git a/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml b/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml index 197a75e6b2..9c408a81f5 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml @@ -84,7 +84,8 @@ Ping Ping: 100 pings in 10 sec up2-fhi72 - -c 100 -i 0.1 172.21.6.104 + oc-cn5g-20897 + -c 100 -i 0.1 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index 927fe1a3e7..5374d216c8 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -83,7 +83,8 @@ Ping Ping: 100 pings in 10 sec up2-fhi72 - -c 100 -i 0.1 172.21.6.104 + oc-cn5g-20897 + -c 100 -i 0.1 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_nrue.xml b/ci-scripts/xml_files/container_sa_n310_nrue.xml index e6b1ba1643..00b4dfa583 100644 --- a/ci-scripts/xml_files/container_sa_n310_nrue.xml +++ b/ci-scripts/xml_files/container_sa_n310_nrue.xml @@ -127,6 +127,7 @@ Ping Ping: 20pings in 20sec oai_ue_caracal + oc-cn5g -c 20 %cn_ip% 1 25 @@ -136,6 +137,7 @@ Ping Ping: 100pings in 20sec oai_ue_caracal + oc-cn5g -c 100 -i 0.2 %cn_ip% 1 30 diff --git a/ci-scripts/xml_files/sa_cn5g_20897_closure.xml b/ci-scripts/xml_files/sa_cn5g_20897_closure.xml index 685775c1a4..eeab1b32dc 100644 --- a/ci-scripts/xml_files/sa_cn5g_20897_closure.xml +++ b/ci-scripts/xml_files/sa_cn5g_20897_closure.xml @@ -30,7 +30,7 @@ - Terminate_5GCN + UndeployCoreNetwork Terminate 5G Core oc-cn5g-20897 diff --git a/ci-scripts/xml_files/sa_cn5g_20897_start.xml b/ci-scripts/xml_files/sa_cn5g_20897_start.xml index 2d60baedc1..9c29b83563 100644 --- a/ci-scripts/xml_files/sa_cn5g_20897_start.xml +++ b/ci-scripts/xml_files/sa_cn5g_20897_start.xml @@ -31,7 +31,7 @@ - Initialize_5GCN + DeployCoreNetwork Initialize 5G Core oc-cn5g-20897 diff --git a/ci-scripts/xml_files/sa_cn5g_closure.xml b/ci-scripts/xml_files/sa_cn5g_closure.xml index 727e208d4c..beb490dbed 100644 --- a/ci-scripts/xml_files/sa_cn5g_closure.xml +++ b/ci-scripts/xml_files/sa_cn5g_closure.xml @@ -30,7 +30,7 @@ - Terminate_5GCN + UndeployCoreNetwork Terminate 5G Core oc-cn5g diff --git a/ci-scripts/xml_files/sa_cn5g_start.xml b/ci-scripts/xml_files/sa_cn5g_start.xml index 3de615330a..a49a2cda18 100644 --- a/ci-scripts/xml_files/sa_cn5g_start.xml +++ b/ci-scripts/xml_files/sa_cn5g_start.xml @@ -31,7 +31,7 @@ - Initialize_5GCN + DeployCoreNetwork Initialize 5G Core oc-cn5g diff --git a/ci-scripts/xml_files/sa_oaiue_cn5g_deploy.xml b/ci-scripts/xml_files/sa_oaiue_cn5g_deploy.xml index 3de615330a..a49a2cda18 100644 --- a/ci-scripts/xml_files/sa_oaiue_cn5g_deploy.xml +++ b/ci-scripts/xml_files/sa_oaiue_cn5g_deploy.xml @@ -31,7 +31,7 @@ - Initialize_5GCN + DeployCoreNetwork Initialize 5G Core oc-cn5g diff --git a/ci-scripts/xml_files/sa_oaiue_cn5g_undeploy.xml b/ci-scripts/xml_files/sa_oaiue_cn5g_undeploy.xml index 727e208d4c..beb490dbed 100644 --- a/ci-scripts/xml_files/sa_oaiue_cn5g_undeploy.xml +++ b/ci-scripts/xml_files/sa_oaiue_cn5g_undeploy.xml @@ -30,7 +30,7 @@ - Terminate_5GCN + UndeployCoreNetwork Terminate 5G Core oc-cn5g From 8c4a55ab1c5dc762d773b8c0ebb5c70508c2aafd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 18 Nov 2024 08:39:12 +0100 Subject: [PATCH 21/35] Remove unused/unsupported EPC types "OAI-Rel14-CUPS" and "OAI" --- ci-scripts/epc.py | 107 ++++++---------------------------------------- 1 file changed, 14 insertions(+), 93 deletions(-) diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index c4585b98b3..a49c354694 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -97,23 +97,9 @@ class EPCManagement(): time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-hss /bin/bash -c "nohup ./bin/oai_hss -j ./etc/hss_rel14.json --reloadkey true > hss_check_run.log 2>&1"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC Release 14 Cassandra-based HSS') - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - logging.debug('\u001B[1m Launching tshark on all interfaces \u001B[0m') - self.PcapFileName = 'epc_' + self.testCase_id + '.pcap' - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f ' + self.PcapFileName, '\$', 5) - mySSH.command('echo $USER; nohup sudo tshark -f "tcp port not 22 and port not 53" -i any -w ' + self.SourceCodePath + '/scripts/' + self.PcapFileName + ' > /tmp/tshark.log 2>&1 &', self.UserName, 5) - mySSH.command('echo ' + self.Password + ' | sudo -S mkdir -p logs', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f hss_' + self.testCase_id + '.log logs/hss*.*', '\$', 5) - mySSH.command('echo "oai_hss -j /usr/local/etc/oai/hss_rel14.json" > ./my-hss.sh', '\$', 5) - mySSH.command('chmod 755 ./my-hss.sh', '\$', 5) - mySSH.command('sudo daemon --unsafe --name=hss_daemon --chdir=' + self.SourceCodePath + '/scripts -o ' + self.SourceCodePath + '/scripts/hss_' + self.testCase_id + '.log ./my-hss.sh', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC HSS') - mySSH.command('cd ' + self.SourceCodePath, '\$', 5) - mySSH.command('source oaienv', '\$', 5) - mySSH.command('cd scripts', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./run_hss 2>&1 | stdbuf -o0 awk \'{ print strftime("[%Y/%m/%d %H:%M:%S] ",systime()) $0 }\' | stdbuf -o0 tee -a hss_' + self.testCase_id + '.log &', 'Core state: 2 -> 3', 35) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): logging.debug('Using the ltebox simulated HSS') mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) @@ -148,23 +134,9 @@ class EPCManagement(): time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/' + self.mmeConfFile + ' > mme_check_run.log 2>&1"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC Release 14 MME') - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f mme_' + self.testCase_id + '.log', '\$', 5) - mySSH.command('echo "./run_mme --config-file /usr/local/etc/oai/mme.conf --set-virt-if" > ./my-mme.sh', '\$', 5) - mySSH.command('chmod 755 ./my-mme.sh', '\$', 5) - mySSH.command('sudo daemon --unsafe --name=mme_daemon --chdir=' + self.SourceCodePath + '/scripts -o ' + self.SourceCodePath + '/scripts/mme_' + self.testCase_id + '.log ./my-mme.sh', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): - mySSH.command('cd ' + self.SourceCodePath, '\$', 5) - mySSH.command('source oaienv', '\$', 5) - mySSH.command('cd scripts', '\$', 5) - mySSH.command('stdbuf -o0 hostname', '\$', 5) - result = re.search('hostname\\\\r\\\\n(?P[a-zA-Z0-9\-\_]+)\\\\r\\\\n', mySSH.getBefore()) - if result is None: - logging.debug('\u001B[1;37;41m Hostname Not Found! \u001B[0m') - sys.exit(1) - host_name = result.group('host_name') - mySSH.command('echo ' + self.Password + ' | sudo -S ./run_mme 2>&1 | stdbuf -o0 tee -a mme_' + self.testCase_id + '.log &', 'MME app initialization complete', 100) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cd /opt/ltebox/tools', '\$', 5) # Clean-up the logs from previous runs @@ -219,21 +191,9 @@ class EPCManagement(): time.sleep(5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup ./bin/oai_spgwu -o -c ./etc/spgw_u.conf > spgwu_check_run.log 2>&1"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC Release 14 SPGW-CUPS') - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f spgwc_' + self.testCase_id + '.log spgwu_' + self.testCase_id + '.log', '\$', 5) - mySSH.command('echo "spgwc -c /usr/local/etc/oai/spgw_c.conf" > ./my-spgwc.sh', '\$', 5) - mySSH.command('chmod 755 ./my-spgwc.sh', '\$', 5) - mySSH.command('sudo daemon --unsafe --name=spgwc_daemon --chdir=' + self.SourceCodePath + '/scripts -o ' + self.SourceCodePath + '/scripts/spgwc_' + self.testCase_id + '.log ./my-spgwc.sh', '\$', 5) - time.sleep(5) - mySSH.command('echo "spgwu -c /usr/local/etc/oai/spgw_u.conf" > ./my-spgwu.sh', '\$', 5) - mySSH.command('chmod 755 ./my-spgwu.sh', '\$', 5) - mySSH.command('sudo daemon --unsafe --name=spgwu_daemon --chdir=' + self.SourceCodePath + '/scripts -o ' + self.SourceCodePath + '/scripts/spgwu_' + self.testCase_id + '.log ./my-spgwu.sh', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): - mySSH.command('cd ' + self.SourceCodePath, '\$', 5) - mySSH.command('source oaienv', '\$', 5) - mySSH.command('cd scripts', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./run_spgw 2>&1 | stdbuf -o0 tee -a spgw_' + self.testCase_id + '.log &', 'Initializing SPGW-APP task interface: DONE', 30) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cd /opt/ltebox/tools', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S ./start_xGw', '\$', 5) @@ -334,20 +294,9 @@ class EPCManagement(): if result is not None: mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "killall --signal SIGKILL oai_hss"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT oai_hss || true', '\$', 5) - time.sleep(2) - mySSH.command('stdbuf -o0 ps -aux | grep --colour=never hss | grep -v grep', '\$', 5) - result = re.search('oai_hss -j', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL oai_hss || true', '\$', 5) - mySSH.command('rm -f ' + self.SourceCodePath + '/scripts/my-hss.sh', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT run_hss oai_hss || true', '\$', 5) - time.sleep(2) - mySSH.command('stdbuf -o0 ps -aux | grep --colour=never hss | grep -v grep', '\$', 5) - result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL run_hss oai_hss || true', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cd ' + self.SourceCodePath, '\$', 5) mySSH.command('cd scripts', '\$', 5) @@ -375,13 +324,7 @@ class EPCManagement(): if result is not None: mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "killall --signal SIGKILL oai_mme"', '\$', 5) elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT run_mme mme || true', '\$', 5) - time.sleep(2) - mySSH.command('stdbuf -o0 ps -aux | grep mme | grep -v grep', '\$', 5) - result = re.search('mme -c', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL run_mme mme || true', '\$', 5) - mySSH.command('rm -f ' + self.SourceCodePath + '/scripts/my-mme.sh', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cd /opt/ltebox/tools', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_mme', '\$', 5) @@ -408,25 +351,9 @@ class EPCManagement(): if result is not None: mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "killall --signal SIGKILL oai_spgwu"', '\$', 5) elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT spgwc spgwu || true', '\$', 5) - time.sleep(2) - mySSH.command('stdbuf -o0 ps -aux | grep spgw | grep -v grep', '\$', 5) - result = re.search('spgwc -c |spgwu -c ', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL spgwc spgwu || true', '\$', 5) - mySSH.command('rm -f ' + self.SourceCodePath + '/scripts/my-spgw*.sh', '\$', 5) - mySSH.command('stdbuf -o0 ps -aux | grep tshark | grep -v grep', '\$', 5) - result = re.search('-w ', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT tshark || true', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S chmod 666 ' + self.SourceCodePath + '/scripts/*.pcap', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT run_spgw spgw || true', '\$', 5) - time.sleep(2) - mySSH.command('stdbuf -o0 ps -aux | grep spgw | grep -v grep', '\$', 5) - result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL run_spgw spgw || true', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cd /opt/ltebox/tools', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_xGw', '\$', 5) @@ -716,11 +643,7 @@ class EPCManagement(): elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('zip hss.log.zip hss*.log', '\$', 60) - mySSH.command('echo ' + self.Password + ' | sudo -S rm hss*.log', '\$', 5) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('zip hss.log.zip logs/hss*.* *.pcap', '\$', 60) - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f logs/hss*.* *.pcap', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cp /opt/hss_sim0609/hss.log .', '\$', 60) mySSH.command('zip hss.log.zip hss.log', '\$', 60) @@ -756,8 +679,7 @@ class EPCManagement(): elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('zip mme.log.zip mme*.log', '\$', 60) - mySSH.command('echo ' + self.Password + ' | sudo -S rm mme*.log', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cp /opt/ltebox/var/log/*Log.0 .', '\$', 5) mySSH.command('zip mme.log.zip mmeLog.0 s1apcLog.0 s1apsLog.0 s11cLog.0 libLog.0 s1apCodecLog.0 amfLog.0 ngapcLog.0 ngapcommonLog.0 ngapsLog.0', '\$', 60) @@ -791,8 +713,7 @@ class EPCManagement(): elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - mySSH.command('zip spgw.log.zip spgw*.log', '\$', 60) - mySSH.command('echo ' + self.Password + ' | sudo -S rm spgw*.log', '\$', 5) + raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): mySSH.command('cp /opt/ltebox/var/log/*Log.0 .', '\$', 5) mySSH.command('zip spgw.log.zip xGwLog.0 upfLog.0', '\$', 60) From 5db684fc52b3fecd4a23ed6b1264e612ae806d76 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 18 Nov 2024 08:42:14 +0100 Subject: [PATCH 22/35] CI: deploy ltebox EPC through CoreNetwork, use in Ping/Iperf - issue ltebox commands from ci_infra.yaml - use for ltebox-nano, ltebox-nepes (un)deployment, ping, iperf in all relevant XML files --- ci-scripts/ci_infra.yaml | 14 +++++ ci-scripts/epc.py | 51 ++++--------------- .../container_lte_b200_fdd_05Mhz_tm1.xml | 1 + ...container_lte_b200_fdd_05Mhz_tm1_if4_5.xml | 1 + ...lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml | 2 + .../container_lte_b200_fdd_10Mhz_tm1.xml | 1 + .../container_lte_b200_fdd_10Mhz_tm1_cdrx.xml | 1 + .../container_lte_b200_fdd_20Mhz_tm1.xml | 1 + .../container_lte_b200_tdd_05Mhz_tm1.xml | 1 + ...container_lte_b200_tdd_05Mhz_tm1_if4_5.xml | 1 + .../container_lte_b200_tdd_10Mhz_tm1.xml | 1 + .../container_lte_b200_tdd_20Mhz_tm1.xml | 1 + ...e_b200_tdd_20Mhz_tm1_default_scheduler.xml | 1 + .../xml_files/container_nsa_b200_quectel.xml | 4 ++ ci-scripts/xml_files/fr1_epc_closure.xml | 17 ++----- ci-scripts/xml_files/fr1_epc_start.xml | 17 ++----- ci-scripts/xml_files/nsa_epc_closure.xml | 17 ++----- ci-scripts/xml_files/nsa_epc_start.xml | 17 ++----- 18 files changed, 56 insertions(+), 93 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index f1c7d4b294..e47645b951 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -104,6 +104,13 @@ nano-cn4g: ltebox-nano: Host: nano NetworkScript: ip a show dev tun1 + Deploy: + - "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'" + - "sleep 1" + - "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &" + - "sleep 1" + Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen" + LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%" sabox-nepes: Host: nepes @@ -119,6 +126,13 @@ sabox-nepes: ltebox-nepes: Host: nepes NetworkScript: ip a show dev tun1 + Deploy: + - "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'" + - "sleep 1" + - "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &" + - "sleep 1" + Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen" + LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%" amarisoft_ue: Host: amariue diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index a49c354694..bb9d056fae 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -101,20 +101,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - logging.debug('Using the ltebox simulated HSS') - mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) - mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) - result = re.search('hss_sim s6as diam_hss', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall hss_sim', '\$', 5) - mySSH.command('ps aux | grep --colour=never xGw | grep -v grep', '\$', 5, silent=True) - result = re.search('root.*xGw', mySSH.getBefore()) - if result is not None: - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_ltebox', '\$', 5) - mySSH.command('cd /opt/hss_sim0609', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f hss.log', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S echo "Starting sudo session" && sudo su -c "screen -dm -S simulated_hss ./starthss"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() @@ -138,10 +125,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - # Clean-up the logs from previous runs - mySSH.command('echo ' + self.Password + ' | sudo -S rm -f ../var/log/*.0', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./start_mme', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() @@ -195,8 +179,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./start_xGw', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() @@ -267,7 +250,7 @@ class EPCManagement(): if self.IPAddress == 'none': return if re.match('ltebox', self.Type, re.IGNORECASE): - self.MmeIPAddress = self.IPAddress + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) @@ -298,15 +281,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cd ' + self.SourceCodePath, '\$', 5) - mySSH.command('cd scripts', '\$', 5) - time.sleep(1) - mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_hss -X quit', '\$', 5) - time.sleep(5) - mySSH.command('ps aux | grep --colour=never hss_sim | grep -v grep', '\$', 5, silent=True) - result = re.search('hss_sim s6as diam_hss', mySSH.getBefore()) - if result is not None: - mySSH.command('echo ' + self.Password + ' | sudo -S killall hss_sim', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This should not happen!') mySSH.close() @@ -326,9 +301,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_mme', '\$', 5) - time.sleep(5) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This should not happen!') mySSH.close() @@ -355,8 +328,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cd /opt/ltebox/tools', '\$', 5) - mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_xGw', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This should not happen!') mySSH.close() @@ -645,8 +617,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cp /opt/hss_sim0609/hss.log .', '\$', 60) - mySSH.command('zip hss.log.zip hss.log', '\$', 60) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() @@ -681,8 +652,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cp /opt/ltebox/var/log/*Log.0 .', '\$', 5) - mySSH.command('zip mme.log.zip mmeLog.0 s1apcLog.0 s1apsLog.0 s11cLog.0 libLog.0 s1apCodecLog.0 amfLog.0 ngapcLog.0 ngapcommonLog.0 ngapsLog.0', '\$', 60) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() @@ -715,8 +685,7 @@ class EPCManagement(): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): - mySSH.command('cp /opt/ltebox/var/log/*Log.0 .', '\$', 5) - mySSH.command('zip spgw.log.zip xGwLog.0 upfLog.0', '\$', 60) + raise NotImplemented("use cls_corenetwork.py") else: logging.error('This option should not occur!') mySSH.close() diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml index 01e1cfc4ed..2213abd413 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml @@ -124,6 +124,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml index c13952094f..2853e270f6 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml @@ -132,6 +132,7 @@ -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml index 4bfcb02258..fbff50c09c 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml @@ -162,6 +162,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano @@ -170,6 +171,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml index 6b1afaf079..78d4138517 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml @@ -118,6 +118,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml index 1469918617..223404f07e 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml @@ -111,6 +111,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml index a830803f9f..3ea5b45735 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml @@ -117,6 +117,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml -c 20 %cn_ip% 5 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml index dc85ee5813..99c6ada431 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml @@ -125,6 +125,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml -c 20 %cn_ip% 25 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml index f5467c2623..390badad91 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml @@ -132,6 +132,7 @@ -c 20 %cn_ip% 25 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml index 4d34ff1434..1d2eff3707 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml @@ -116,6 +116,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml -c 20 %cn_ip% 25 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml index 2620296bde..2db8e754b9 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml @@ -116,6 +116,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml -c 20 %cn_ip% 25 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml index 5dc0ab9585..57554d17f2 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -117,6 +117,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml -c 20 %cn_ip% 25 adb_ue_1 adb_ue_2 + ltebox-nano diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 7b43dc609b..c0c95f1ea8 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -168,6 +168,7 @@ Ping Ping: 20pings in 20sec idefix + ltebox-nepes -c 20 %cn_ip% 1 15 @@ -177,6 +178,7 @@ Ping Ping: 100pings in 20sec idefix + ltebox-nepes -c 100 -i 0.2 %cn_ip% 1 15 @@ -186,6 +188,7 @@ Ping Ping: 20pings in 20sec idefix + ltebox-nepes -c 20 %cn_ip% 1 15 @@ -195,6 +198,7 @@ Ping Ping: 100pings in 20sec idefix + ltebox-nepes -c 100 -i 0.2 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/fr1_epc_closure.xml b/ci-scripts/xml_files/fr1_epc_closure.xml index 2fd8031936..8f0349073c 100644 --- a/ci-scripts/xml_files/fr1_epc_closure.xml +++ b/ci-scripts/xml_files/fr1_epc_closure.xml @@ -25,23 +25,14 @@ EPC-Closure log-out -060000 060001 060002 +060000 - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW + UndeployCoreNetwork + Terminate EPC + ltebox-nano diff --git a/ci-scripts/xml_files/fr1_epc_start.xml b/ci-scripts/xml_files/fr1_epc_start.xml index 5cef2b5a6a..0efaca6d57 100644 --- a/ci-scripts/xml_files/fr1_epc_start.xml +++ b/ci-scripts/xml_files/fr1_epc_start.xml @@ -25,24 +25,15 @@ EPC-Start log-in - 000100 000101 000102 + 000100 - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW + DeployCoreNetwork + Initialize EPC + ltebox-nano diff --git a/ci-scripts/xml_files/nsa_epc_closure.xml b/ci-scripts/xml_files/nsa_epc_closure.xml index 2fd8031936..23181ec674 100644 --- a/ci-scripts/xml_files/nsa_epc_closure.xml +++ b/ci-scripts/xml_files/nsa_epc_closure.xml @@ -25,23 +25,14 @@ EPC-Closure log-out -060000 060001 060002 +060000 - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW + UndeployCoreNetwork + Terminate EPC + ltebox-nepes diff --git a/ci-scripts/xml_files/nsa_epc_start.xml b/ci-scripts/xml_files/nsa_epc_start.xml index 5cef2b5a6a..89761ddb74 100644 --- a/ci-scripts/xml_files/nsa_epc_start.xml +++ b/ci-scripts/xml_files/nsa_epc_start.xml @@ -25,24 +25,15 @@ EPC-Start log-in - 000100 000101 000102 + 000100 - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW + DeployCoreNetwork + Start EPC + ltebox-nepes From 586e51227e7ecec38ce9e5dded30a32295087ce6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 18 Nov 2024 08:46:19 +0100 Subject: [PATCH 23/35] CI: deploy docker-based OAI 5GC through CoreNetwork, use in Ping/Iperf - issue OAI 5GC docker commands/scripts from ci_infra.yaml - use for matix-cn5g (un)deployment, ping, iperf in all XML files --- ci-scripts/ci_infra.yaml | 7 +- ci-scripts/epc.py | 84 ++----------------- .../container_sa_n310_2X2_100MHz_quectel.xml | 1 + .../container_sa_n310_2X2_60MHz_quectel.xml | 1 + .../container_sa_n310_4X4_60MHz_quectel.xml | 1 + .../xml_files/fr1_cn5g_basic_deploy.xml | 11 +-- .../xml_files/fr1_cn5g_basic_undeploy.xml | 4 +- 7 files changed, 19 insertions(+), 90 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index e47645b951..261167aeaa 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -88,8 +88,13 @@ oc-cn5g-20897-aerial2: matix-cn5g: Host: matix NetworkScript: docker exec prod-trf-gen ip a show dev eth0 - CmdPrefix: docker exec prod-trf-gen RunIperf3Server: False + Deploy: "cd /opt/oai-cn5g-fed-v2/docker-compose && python3 ./core-network.py --type start-basic" + Undeploy: "cd /opt/oai-cn5g-fed-v2/docker-compose && python3 ./core-network.py --type stop-basic" + LogCollect: + - "docker logs oai-smf > %%log_dir%%/oai-smf.log" + - "docker logs oai-amf > %%log_dir%%/oai-amf.log" + - "docker logs oai-upf > %%log_dir%%/oai-upf.log" porcepix-cn4g: Host: porcepix diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index bb9d056fae..715f0848df 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -197,44 +197,7 @@ class EPCManagement(): if re.match('ltebox', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): - logging.debug('Starting OAI CN5G') - mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) - mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command(f'cd {self.SourceCodePath}/docker-compose', '\$', 5) - mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60) - if re.search('start-mini-as-ue', self.cfgDeploy): - dFile = 'docker-compose-mini-nrf-asue.yaml' - elif re.search('basic', self.cfgDeploy):\ - dFile = 'docker-compose-basic-nrf.yaml' - else: - dFile = 'docker-compose-mini-nrf.yaml' - mySSH.command('docker-compose -f ' + dFile + ' ps -a', '\$', 60) - if mySSH.getBefore().count('Up (healthy)') != 6: - logging.error('Not all container healthy') - else: - logging.debug('OK --> all containers are healthy') - mySSH.command('docker-compose -f ' + dFile + ' config | grep --colour=never image', '\$', 10) - listOfImages = mySSH.getBefore() - for imageLine in listOfImages.split('\\r\\n'): - res1 = re.search('image: (?P[a-zA-Z0-9\-/]+):(?P[a-zA-Z0-9\-]+)', str(imageLine)) - res2 = re.search('mysql', str(imageLine)) - if res1 is not None and res2 is None: - html_cell += res1.group('name') + ':' + res1.group('tag') + ' ' - nbChars = len(res1.group('name')) + len(res1.group('tag')) + 2 - while (nbChars < 32): - html_cell += ' ' - nbChars += 1 - mySSH.command('docker image inspect --format="Size = {{.Size}} bytes" ' + res1.group('name') + ':' + res1.group('tag'), '\$', 10) - res3 = re.search('Size *= *(?P[0-9\-]*) *bytes', mySSH.getBefore()) - if res3 is not None: - imageSize = int(res3.group('size')) - imageSize = int(imageSize/(1024*1024)) - html_cell += str(imageSize) + ' MBytes ' - mySSH.command('docker image inspect --format="Date = {{.Created}}" ' + res1.group('name') + ':' + res1.group('tag'), '\$', 10) - res4 = re.search('Date *= *(?P[0-9\-]*)T', mySSH.getBefore()) - if res4 is not None: - html_cell += '(' + res4.group('date') + ')' - html_cell += '\n' + raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") else: @@ -252,17 +215,7 @@ class EPCManagement(): if re.match('ltebox', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - response=mySSH.command3('docker container ls -f name=oai-amf', 10) - if len(response)>1: - response=mySSH.command3('docker inspect --format=\'{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}\' oai-amf', 10) - tmp = str(response[0],'utf-8') - self.MmeIPAddress = tmp.rstrip() - logging.debug('AMF IP Address ' + self.MmeIPAddress) - else: - logging.error('no container with name oai-amf found, could not retrieve AMF IP address') - mySSH.close() + raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") @@ -341,27 +294,7 @@ class EPCManagement(): if re.match('ltebox', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): - logging.debug('OAI CN5G Collecting Log files to workspace') - mySSH.command('echo ' + self.Password + ' | sudo rm -rf ' + self.SourceCodePath + '/logs', '\$', 5) - mySSH.command('mkdir ' + self.SourceCodePath + '/logs','\$', 5) - containers_list=['oai-smf','oai-spgwu','oai-amf','oai-nrf'] - for c in containers_list: - mySSH.command('docker logs ' + c + ' > ' + self.SourceCodePath + '/logs/' + c + '.log', '\$', 5) - - logging.debug('Terminating OAI CN5G') - mySSH.command(f'cd {self.SourceCodePath}/docker-compose', '\$', 5) - mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60) - mySSH.command('docker volume prune --force || true', '\$', 60) - time.sleep(2) - mySSH.command('tshark -r /tmp/oai-cn5g-v1.5.pcap | grep -E --colour=never "Tracking area update" ','\$', 30) - result = re.search('Tracking area update request', mySSH.getBefore()) - if result is not None: - message = 'UE requested ' + str(mySSH.getBefore().count('Tracking area update request')) + 'Tracking area update request(s)' - else: - message = 'No Tracking area update request' - mySSH.run(f'cd {self.SourceCodePath}/logs && zip -r -qq test_logs_CN.zip *.log') - mySSH.copyin(f'{self.SourceCodePath}/logs/test_logs_CN.zip','test_logs_CN.zip') - logging.debug(message) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") else: @@ -611,7 +544,7 @@ class EPCManagement(): mySSH.command('docker cp ' + self.containerPrefix + '-oai-hss:/tmp/hss_check_run.pcap .', '\$', 60) mySSH.command('zip hss.log.zip hss_check_run.*', '\$', 60) elif re.match('OAICN5G', self.Type, re.IGNORECASE): - logging.debug('LogCollect is bypassed for that variant') + raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): @@ -643,10 +576,7 @@ class EPCManagement(): mySSH.command('docker cp ' + self.containerPrefix + '-oai-mme:/tmp/mme_check_run.pcap .', '\$', 60) mySSH.command('zip mme.log.zip mme_check_run.*', '\$', 60) elif re.match('OAICN5G', self.Type, re.IGNORECASE): - mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5) - mySSH.command('cp -f /tmp/oai-cn5g-v1.5.pcap .','\$', 30) - mySSH.command('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap','\$', 30) - mySSH.command('mv mme.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): @@ -677,9 +607,7 @@ class EPCManagement(): mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwu-tiny:/tmp/spgwu_check_run.pcap .', '\$', 60) mySSH.command('zip spgw.log.zip spgw*_check_run.*', '\$', 60) elif re.match('OAICN5G', self.Type, re.IGNORECASE): - mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5) - mySSH.command('zip spgw.log.zip oai-smf.log oai-spgwu.log','\$', 30) - mySSH.command('mv spgw.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml index 15a9ad4065..90687e39f0 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml @@ -108,6 +108,7 @@ Ping Ping: 100pings in 20sec up2 + matix-cn5g -c 100 -i 0.2 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml index 52b05df661..631acc3285 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml @@ -108,6 +108,7 @@ Ping Ping: 100pings in 20sec up2 + matix-cn5g -c 100 -i 0.2 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml index 9ec5b37245..58e2825ff3 100644 --- a/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml @@ -108,6 +108,7 @@ Ping Ping: 100pings in 20sec up2 + matix-cn5g -c 100 -i 0.2 %cn_ip% 1 15 diff --git a/ci-scripts/xml_files/fr1_cn5g_basic_deploy.xml b/ci-scripts/xml_files/fr1_cn5g_basic_deploy.xml index 0ea2311a1f..3561d11fc9 100644 --- a/ci-scripts/xml_files/fr1_cn5g_basic_deploy.xml +++ b/ci-scripts/xml_files/fr1_cn5g_basic_deploy.xml @@ -26,20 +26,13 @@ log-in 000100 - 000200 - Terminate_5GCN - Terminate 5G Core - --type stop-basic - - - - Initialize_5GCN + DeployCoreNetwork Initialize 5G Core - --type start-basic + matix-cn5g diff --git a/ci-scripts/xml_files/fr1_cn5g_basic_undeploy.xml b/ci-scripts/xml_files/fr1_cn5g_basic_undeploy.xml index 190b58ac1b..56d7cf74c0 100644 --- a/ci-scripts/xml_files/fr1_cn5g_basic_undeploy.xml +++ b/ci-scripts/xml_files/fr1_cn5g_basic_undeploy.xml @@ -31,9 +31,9 @@ - Terminate_5GCN + UndeployCoreNetwork Terminate 5G Core - --type stop-basic + matix-cn5g From a51190a7c57c8fc46616d0f85f8d8330137582ec Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 18 Nov 2024 08:51:24 +0100 Subject: [PATCH 24/35] CI: deploy Magme-MME OAI EPC through CoreNetwork, use in Ping/Iperf - call scripts for magma MME-based deployment of OAI 5GC in ci_infra.yaml - implement the existing python code through scripts (which does the same) - save the cql file in the repo, which was previously downloaded every time - use for porcepix-cn4g and nano-cn4g (un)deployment, ping, perf, in XML files --- ci-scripts/ci_infra.yaml | 6 + ci-scripts/epc.py | 322 +----------------- ci-scripts/scripts/magma-epc-deploy.sh | 28 ++ ci-scripts/scripts/magma-epc-logcollect.sh | 12 + ...container_lte_b200_fdd_10Mhz_tm1_oaiue.xml | 1 + .../container_lte_n3xx_tdd_2x2_tm1.xml | 2 + .../container_lte_n3xx_tdd_2x2_tm2.xml | 2 + ci-scripts/xml_files/fr1_oai_cn_deploy.xml | 6 +- ci-scripts/xml_files/fr1_oai_cn_undeploy.xml | 5 +- ci-scripts/xml_files/lte_oai_cn_deploy.xml | 6 +- ci-scripts/xml_files/lte_oai_cn_undeploy.xml | 5 +- .../yaml_files/magma_nsa_20897/oai_db.cql | 93 +++++ 12 files changed, 168 insertions(+), 320 deletions(-) create mode 100755 ci-scripts/scripts/magma-epc-deploy.sh create mode 100755 ci-scripts/scripts/magma-epc-logcollect.sh create mode 100644 ci-scripts/yaml_files/magma_nsa_20897/oai_db.cql diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index 261167aeaa..edb6078e4a 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -100,11 +100,17 @@ porcepix-cn4g: Host: porcepix NetworkScript: docker exec prod-trf-gen ip a show dev eth0 CmdPrefix: docker exec prod-trf-gen + Deploy: "! scripts/magma-epc-deploy.sh /opt/oai-epc-magma/docker-compose.yml" + Undeploy: "docker compose -f /opt/oai-epc-magma/docker-compose.yml down" + LogCollect: "! scripts/magma-epc-logcollect.sh %%log_dir%%" nano-cn4g: Host: nano NetworkScript: docker exec prod-trf-gen ip a show dev eth0 CmdPrefix: docker exec prod-trf-gen + Deploy: "! scripts/magma-epc-deploy.sh /opt/oai-epc-magma/docker-compose.yml" + Undeploy: "docker compose -f /opt/oai-epc-magma/docker-compose.yml down" + LogCollect: "! scripts/magma-epc-logcollect.sh %%log_dir%%" ltebox-nano: Host: nano diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index 715f0848df..c095761cd0 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -90,12 +90,7 @@ class EPCManagement(): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC Release 14 Cassandra-based HSS in Docker') - mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) - mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-hss /bin/bash -c "nohup tshark -i eth0 -i eth1 -w /tmp/hss_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - time.sleep(5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-hss /bin/bash -c "nohup ./bin/oai_hss -j ./etc/hss_rel14.json --reloadkey true > hss_check_run.log 2>&1"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): @@ -116,10 +111,7 @@ class EPCManagement(): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC Release 14 MME in Docker') - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -f "not port 2152" -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - time.sleep(5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/' + self.mmeConfFile + ' > mme_check_run.log 2>&1"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): @@ -140,22 +132,7 @@ class EPCManagement(): return # Only in case of Docker containers, MME IP address is not the EPC HOST IP address if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - self.isMagmaUsed = False - mySSH.command('docker ps -a', '\$', 5) - result = re.search('magma', mySSH.getBefore()) - if result is not None: - self.isMagmaUsed = True - if self.isMagmaUsed: - mySSH.command('docker inspect --format="MME_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" ' + self.containerPrefix + '-magma-mme', '\$', 5) - else: - mySSH.command('docker inspect --format="MME_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" ' + self.containerPrefix + '-oai-mme', '\$', 5) - result = re.search('MME_IP_ADDR = (?P[0-9\.]+)', mySSH.getBefore()) - if result is not None: - self.MmeIPAddress = result.group('mme_ip_addr') - logging.debug('MME IP Address is ' + self.MmeIPAddress) - mySSH.close() + raise NotImplemented("use cls_corenetwork.py") else: self.MmeIPAddress = self.IPAddress @@ -167,13 +144,7 @@ class EPCManagement(): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - logging.debug('Using the OAI EPC Release 14 SPGW-CUPS in Docker') - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup tshark -i eth0 -i lo:p5c -i lo:s5c -f "not port 2152" -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup tshark -i eth0 -f "not port 2152" -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - time.sleep(5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"', '\$', 5) - time.sleep(5) - mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup ./bin/oai_spgwu -o -c ./etc/spgw_u.conf > spgwu_check_run.log 2>&1"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): @@ -223,12 +194,7 @@ class EPCManagement(): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "killall --signal SIGINT oai_hss tshark"', '\$', 5) - time.sleep(2) - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "ps aux | grep oai_hss"', '\$', 5) - result = re.search('oai_hss -j ', mySSH.getBefore()) - if result is not None: - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "killall --signal SIGKILL oai_hss"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): @@ -245,12 +211,7 @@ class EPCManagement(): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "killall --signal SIGINT oai_mme tshark"', '\$', 5) - time.sleep(2) - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "ps aux | grep oai_mme"', '\$', 5) - result = re.search('oai_mme -c ', mySSH.getBefore()) - if result is not None: - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "killall --signal SIGKILL oai_mme"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('ltebox', self.Type, re.IGNORECASE): @@ -265,17 +226,7 @@ class EPCManagement(): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "killall --signal SIGINT oai_spgwc tshark"', '\$', 5) - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "killall --signal SIGINT oai_spgwu tshark"', '\$', 5) - time.sleep(2) - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "ps aux | grep oai_spgwc"', '\$', 5) - result = re.search('oai_spgwc -o -c ', mySSH.getBefore()) - if result is not None: - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "killall --signal SIGKILL oai_spgwc"', '\$', 5) - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "ps aux | grep oai_spgwu"', '\$', 5) - result = re.search('oai_spgwu -o -c ', mySSH.getBefore()) - if result is not None: - mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "killall --signal SIGKILL oai_spgwu"', '\$', 5) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): raise NotImplemented("core network not supported") elif re.match('OAI', self.Type, re.IGNORECASE): @@ -304,227 +255,10 @@ class EPCManagement(): return True def DeployEpc(self, HTML): - logging.debug('Trying to deploy') - if not re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) - HTML.CreateHtmlTabFooter(False) - logging.error('Deploy not possible with this EPC type: ' + self.Type) - return False - - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': - HELP.GenericHelp(CONST.Version) - HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) - logging.error('Insufficient EPC Parameters') - return False - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - mySSH.command('docker-compose --version', '\$', 5) - result = re.search('docker-compose version 1|Docker Compose version v2', mySSH.getBefore()) - if result is None: - mySSH.close() - HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) - HTML.CreateHtmlTabFooter(False) - logging.error('docker-compose not installed on ' + self.IPAddress) - return False - - # Checking if it is a MAGMA deployment - self.isMagmaUsed = False - if os.path.isfile('./' + self.yamlPath + '/redis_extern.conf'): - self.isMagmaUsed = True - logging.debug('MAGMA MME is used!') - - mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) - mySSH.command('if [ -d ' + self.SourceCodePath + '/logs ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/logs ; fi', '\$', 5) - mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts ' + self.SourceCodePath + '/logs', '\$', 5) - mySSH.command('rm -f ' + self.SourceCodePath + '/*.log', '\$', 5) - - # deploying and configuring the cassandra database - # container names and services are currently hard-coded. - # they could be recovered by: - # - docker-compose config --services - # - docker-compose config | grep container_name - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/docker-compose.yml', self.SourceCodePath + '/scripts') - if self.isMagmaUsed: - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/entrypoint.sh', self.SourceCodePath + '/scripts') - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/mme.conf', self.SourceCodePath + '/scripts') - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/mme_fd.sprint.conf', self.SourceCodePath + '/scripts') - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/redis_extern.conf', self.SourceCodePath + '/scripts') - mySSH.command('chmod a+x ' + self.SourceCodePath + '/scripts/entrypoint.sh', '\$', 5) - else: - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/entrypoint.sh', self.SourceCodePath + '/scripts') - mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/mme.conf', self.SourceCodePath + '/scripts') - mySSH.command('chmod 775 entrypoint.sh', '\$', 60) - mySSH.command('wget --quiet --tries=3 --retry-connrefused https://raw.githubusercontent.com/OPENAIRINTERFACE/openair-hss/develop/src/hss_rel14/db/oai_db.cql', '\$', 30) - mySSH.command('docker-compose down -v', '\$', 60) - mySSH.command('docker-compose up -d db_init', '\$', 60) - # databases take time... - time.sleep(10) - cnt = 0 - db_init_status = False - while (cnt < 10): - mySSH.command('docker logs prod-db-init', '\$', 5) - result = re.search('OK', mySSH.getBefore()) - if result is not None: - cnt = 10 - db_init_status = True - else: - time.sleep(5) - cnt += 1 - mySSH.command('docker rm -f prod-db-init', '\$', 5) - if not db_init_status: - HTML.CreateHtmlTestRow(self.Type, 'KO', CONST.INVALID_PARAMETER) - HTML.CreateHtmlTabFooter(False) - logging.error('Cassandra DB deployment/configuration went wrong!') - return True - - # deploying EPC cNFs - mySSH.command('docker-compose up -d oai_spgwu', '\$', 60) - if self.isMagmaUsed: - listOfContainers = 'prod-cassandra prod-oai-hss prod-magma-mme prod-oai-spgwc prod-oai-spgwu-tiny prod-redis' - expectedHealthyContainers = 6 - else: - listOfContainers = 'prod-cassandra prod-oai-hss prod-oai-mme prod-oai-spgwc prod-oai-spgwu-tiny' - expectedHealthyContainers = 5 - - # Checking for additional services - mySSH.command('docker-compose config', '\$', 5) - configResponse = mySSH.getBefore() - if configResponse.count('trf_gen') == 1: - mySSH.command('docker-compose up -d trf_gen', '\$', 60) - listOfContainers += ' prod-trf-gen' - expectedHealthyContainers += 1 - - mySSH.command('docker-compose config | grep --colour=never image', '\$', 10) - html_cell = '' - listOfImages = mySSH.getBefore() - for imageLine in listOfImages.split('\\r\\n'): - res1 = re.search('image: (?P[a-zA-Z0-9\-]+):(?P[a-zA-Z0-9\-]+)', str(imageLine)) - res2 = re.search('cassandra|redis', str(imageLine)) - if res1 is not None and res2 is None: - html_cell += res1.group('name') + ':' + res1.group('tag') + ' ' - nbChars = len(res1.group('name')) + len(res1.group('tag')) + 2 - while (nbChars < 32): - html_cell += ' ' - nbChars += 1 - mySSH.command('docker image inspect --format="Size = {{.Size}} bytes" ' + res1.group('name') + ':' + res1.group('tag'), '\$', 10) - res3 = re.search('Size *= *(?P[0-9\-]*) *bytes', mySSH.getBefore()) - if res3 is not None: - imageSize = int(res3.group('size')) - imageSize = int(imageSize/(1024*1024)) - html_cell += str(imageSize) + ' MBytes ' - mySSH.command('docker image inspect --format="Date = {{.Created}}" ' + res1.group('name') + ':' + res1.group('tag'), '\$', 10) - res4 = re.search('Date *= *(?P[0-9\-]*)T', mySSH.getBefore()) - if res4 is not None: - html_cell += '(' + res4.group('date') + ')' - html_cell += '\n' - # Checking if all are healthy - cnt = 0 - while (cnt < 3): - mySSH.command('docker inspect --format=\'{{.State.Health.Status}}\' ' + listOfContainers, '\$', 10) - unhealthyNb = mySSH.getBefore().count('unhealthy') - healthyNb = mySSH.getBefore().count('healthy') - unhealthyNb - startingNb = mySSH.getBefore().count('starting') - if healthyNb == expectedHealthyContainers: - cnt = 10 - else: - time.sleep(10) - cnt += 1 - logging.debug(' -- ' + str(healthyNb) + ' healthy container(s)') - logging.debug(' -- ' + str(unhealthyNb) + ' unhealthy container(s)') - logging.debug(' -- ' + str(startingNb) + ' still starting container(s)') - if healthyNb == expectedHealthyContainers: - mySSH.command('docker exec -d prod-oai-hss /bin/bash -c "nohup tshark -i any -f \'port 9042 or port 3868\' -w /tmp/hss_check_run.pcap 2>&1 > /dev/null"', '\$', 5) - if self.isMagmaUsed: - mySSH.command('docker exec -d prod-magma-mme /bin/bash -c "nohup tshark -i any -f \'port 3868 or port 2123 or port 36412\' -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 10) - else: - mySSH.command('docker exec -d prod-oai-mme /bin/bash -c "nohup tshark -i any -f \'port 3868 or port 2123 or port 36412\' -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 10) - mySSH.command('docker exec -d prod-oai-spgwc /bin/bash -c "nohup tshark -i any -f \'port 2123 or port 8805\' -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 10) - # on SPGW-U, not capturing on SGI to avoid huge file - mySSH.command('docker exec -d prod-oai-spgwu-tiny /bin/bash -c "nohup tshark -i any -f \'port 8805\' -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 10) - mySSH.close() - logging.debug('Deployment OK') - HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [html_cell]) - return True - else: - mySSH.close() - logging.debug('Deployment went wrong') - HTML.CreateHtmlTestRowQueue(self.Type, 'KO', [html_cell]) - return False + raise NotImplemented("use cls_corenetwork.py") def UndeployEpc(self, HTML): - logging.debug('Trying to undeploy') - # No check down, we suppose everything done before. - - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - # Checking if it is a MAGMA deployment. - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('docker-compose ps -a', '\$', 5) - self.isMagmaUsed = False - result = re.search('magma', mySSH.getBefore()) - if result is not None: - self.isMagmaUsed = True - logging.debug('MAGMA MME is used!') - # Recovering logs and pcap files - mySSH.command('cd ' + self.SourceCodePath + '/logs', '\$', 5) - mySSH.command('docker exec -it prod-oai-hss /bin/bash -c "killall --signal SIGINT oai_hss tshark"', '\$', 5) - if self.isMagmaUsed: - mySSH.command('docker exec -it prod-magma-mme /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5) - else: - mySSH.command('docker exec -it prod-oai-mme /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5) - mySSH.command('docker exec -it prod-oai-spgwc /bin/bash -c "killall --signal SIGINT oai_spgwc tshark"', '\$', 5) - mySSH.command('docker exec -it prod-oai-spgwu-tiny /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5) - mySSH.command('docker logs prod-oai-hss > hss_' + self.testCase_id + '.log', '\$', 5) - if self.isMagmaUsed: - mySSH.command('docker cp --follow-link prod-magma-mme:/var/log/mme.log mme_' + self.testCase_id + '.log', '\$', 15) - else: - mySSH.command('docker logs prod-oai-mme > mme_' + self.testCase_id + '.log', '\$', 5) - mySSH.command('docker logs prod-oai-spgwc > spgwc_' + self.testCase_id + '.log', '\$', 5) - mySSH.command('docker logs prod-oai-spgwu-tiny > spgwu_' + self.testCase_id + '.log', '\$', 5) - mySSH.command('docker cp prod-oai-hss:/tmp/hss_check_run.pcap hss_' + self.testCase_id + '.pcap', '\$', 60) - if self.isMagmaUsed: - mySSH.command('docker cp prod-magma-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60) - else: - mySSH.command('docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60) - mySSH.command('tshark -r mme_' + self.testCase_id + '.pcap | grep -E --colour=never "Tracking area update"', '\$', 60) - result = re.search('Tracking area update request', mySSH.getBefore()) - if result is not None: - message = 'UE requested ' + str(mySSH.getBefore().count('Tracking area update request')) + 'Tracking area update request(s)' - else: - message = 'No Tracking area update request' - logging.debug(message) - mySSH.command('docker cp prod-oai-spgwc:/tmp/spgwc_check_run.pcap spgwc_' + self.testCase_id + '.pcap', '\$', 60) - mySSH.command('docker cp prod-oai-spgwu-tiny:/tmp/spgwu_check_run.pcap spgwu_' + self.testCase_id + '.pcap', '\$', 60) - # Remove all - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - if self.isMagmaUsed: - listOfContainers = 'prod-cassandra prod-oai-hss prod-magma-mme prod-oai-spgwc prod-oai-spgwu-tiny prod-redis' - nbContainers = 6 - else: - listOfContainers = 'prod-cassandra prod-oai-hss prod-oai-mme prod-oai-spgwc prod-oai-spgwu-tiny' - nbContainers = 5 - # Checking for additional services - mySSH.command('docker-compose config', '\$', 5) - configResponse = mySSH.getBefore() - if configResponse.count('trf_gen') == 1: - listOfContainers += ' prod-trf-gen' - nbContainers += 1 - - mySSH.command('docker-compose down -v', '\$', 60) - mySSH.command('docker inspect --format=\'{{.State.Health.Status}}\' ' + listOfContainers, '\$', 10) - noMoreContainerNb = mySSH.getBefore().count('No such object') - mySSH.command('docker inspect --format=\'{{.Name}}\' prod-oai-public-net prod-oai-private-net', '\$', 10) - noMoreNetworkNb = mySSH.getBefore().count('No such object') - mySSH.close() - if noMoreContainerNb == nbContainers and noMoreNetworkNb == 2: - logging.debug('Undeployment OK') - HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [message]) - return True - else: - logging.debug('Undeployment went wrong') - HTML.CreateHtmlTestRowQueue(self.Type, 'KO', [message]) - return False + raise NotImplemented("use cls_corenetwork.py") def LogCollectHSS(self): mySSH = SSH.SSHConnection() @@ -532,17 +266,7 @@ class EPCManagement(): mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('rm -f hss.log.zip', '\$', 5) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker inspect prod-oai-hss', '\$', 10) - result = re.search('No such object', mySSH.getBefore()) - if result is not None: - mySSH.command('cd ../logs', '\$', 5) - mySSH.command('rm -f hss.log.zip', '\$', 5) - mySSH.command('zip hss.log.zip hss_*.*', '\$', 60) - mySSH.command('mv hss.log.zip ../scripts', '\$', 60) - else: - mySSH.command('docker cp ' + self.containerPrefix + '-oai-hss:/openair-hss/hss_check_run.log .', '\$', 60) - mySSH.command('docker cp ' + self.containerPrefix + '-oai-hss:/tmp/hss_check_run.pcap .', '\$', 60) - mySSH.command('zip hss.log.zip hss_check_run.*', '\$', 60) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): @@ -564,17 +288,7 @@ class EPCManagement(): else: mySSH = cls_cmd.getConnection(self.IPAddress) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker inspect prod-oai-mme', '\$', 10) - result = re.search('No such object', mySSH.getBefore()) - if result is not None: - mySSH.command('cd ../logs', '\$', 5) - mySSH.command('rm -f mme.log.zip', '\$', 5) - mySSH.command('zip mme.log.zip mme_*.*', '\$', 60) - mySSH.command('mv mme.log.zip ../scripts', '\$', 60) - else: - mySSH.command('docker cp ' + self.containerPrefix + '-oai-mme:/openair-mme/mme_check_run.log .', '\$', 60) - mySSH.command('docker cp ' + self.containerPrefix + '-oai-mme:/tmp/mme_check_run.pcap .', '\$', 60) - mySSH.command('zip mme.log.zip mme_check_run.*', '\$', 60) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): @@ -593,19 +307,7 @@ class EPCManagement(): mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('rm -f spgw.log.zip', '\$', 5) if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - mySSH.command('docker inspect prod-oai-mme', '\$', 10) - result = re.search('No such object', mySSH.getBefore()) - if result is not None: - mySSH.command('cd ../logs', '\$', 5) - mySSH.command('rm -f spgw.log.zip', '\$', 5) - mySSH.command('zip spgw.log.zip spgw*.*', '\$', 60) - mySSH.command('mv spgw.log.zip ../scripts', '\$', 60) - else: - mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwc:/openair-spgwc/spgwc_check_run.log .', '\$', 60) - mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwu-tiny:/openair-spgwu-tiny/spgwu_check_run.log .', '\$', 60) - mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwc:/tmp/spgwc_check_run.pcap .', '\$', 60) - mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwu-tiny:/tmp/spgwu_check_run.pcap .', '\$', 60) - mySSH.command('zip spgw.log.zip spgw*_check_run.*', '\$', 60) + raise NotImplemented("use cls_corenetwork.py") elif re.match('OAICN5G', self.Type, re.IGNORECASE): raise NotImplemented("use cls_corenetwork.py") elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): diff --git a/ci-scripts/scripts/magma-epc-deploy.sh b/ci-scripts/scripts/magma-epc-deploy.sh new file mode 100755 index 0000000000..dd0459ed29 --- /dev/null +++ b/ci-scripts/scripts/magma-epc-deploy.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +function die() { echo "${@}"; exit 1; } + +[ $# -eq 1 ] || die "usage: $0 " + +DOCKERFILE="${1}" + +function wait_for() { + local timeout=${1} + local condition=${2} + echo "wait up to ${timeout} seconds for condition \"${condition}\"" + while [ $timeout -gt 0 ]; do + eval ${condition} && return + sleep 1 + let timeout=$timeout-1 + done + die "ERROR: timed out waiting for condition \"${condition}\"" +} + +# start database +docker compose -f ${DOCKERFILE} up -d db_init cassandra +wait_for 30 "docker logs prod-db-init 2> /dev/null | grep OK" + +# start EPC +docker compose -f ${DOCKERFILE} up -d oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen +wait_for 20 "docker inspect --format='{{.State.Health.Status}}' prod-cassandra prod-oai-hss prod-magma-mme prod-oai-spgwc prod-oai-spgwu-tiny prod-redis prod-trf-gen | grep healthy | wc -l | grep 7" +echo "deployment OK" diff --git a/ci-scripts/scripts/magma-epc-logcollect.sh b/ci-scripts/scripts/magma-epc-logcollect.sh new file mode 100755 index 0000000000..d840b094f3 --- /dev/null +++ b/ci-scripts/scripts/magma-epc-logcollect.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function die() { echo "${@}"; exit 1; } + +[ $# -eq 1 ] || die "usage: $0 " + +DIR=${1} + +docker logs prod-oai-hss &> ${DIR}/oai-hss.log +docker logs prod-magma-mme &> ${DIR}/magme-mme.log +docker logs prod-oai-spgwc &> ${DIR}/oai-spgwc.log +docker logs prod-oai-spgwu-tiny &> ${DIR}/oai-spgwu.log diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml index f978d14cf9..5a04dff1fc 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml @@ -147,6 +147,7 @@ -c 20 192.168.61.200 5 lte_oai_ue_carabe + nano-cn4g diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml index 5234e2d35c..511f5a0e9c 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml @@ -95,6 +95,7 @@ Ping Ping: 20 pings up2 + porcepix-cn4g -c 20 %cn_ip% 1 60 @@ -104,6 +105,7 @@ Ping Ping: 100 pings, size 1024 up2 + porcepix-cn4g -c 100 -s 1024 -i 0.2 %cn_ip% 1 60 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml index a02d0c48ef..0c85c4f028 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml @@ -95,6 +95,7 @@ Ping Ping: 20 pings up2 + porcepix-cn4g -c 20 %cn_ip% 1 60 @@ -104,6 +105,7 @@ Ping Ping: 100 pings, size 1024 up2 + porcepix-cn4g -c 100 -s 1024 -i 0.2 %cn_ip% 1 60 diff --git a/ci-scripts/xml_files/fr1_oai_cn_deploy.xml b/ci-scripts/xml_files/fr1_oai_cn_deploy.xml index 26dbebc329..9cfec6ef58 100644 --- a/ci-scripts/xml_files/fr1_oai_cn_deploy.xml +++ b/ci-scripts/xml_files/fr1_oai_cn_deploy.xml @@ -31,9 +31,9 @@ - Deploy_EPC - Deploy all EPC containers - yaml_files/magma_nsa_20897 + DeployCoreNetwork + Deploy EPC + porcepix-cn4g diff --git a/ci-scripts/xml_files/fr1_oai_cn_undeploy.xml b/ci-scripts/xml_files/fr1_oai_cn_undeploy.xml index 76192efea1..1be07ec180 100644 --- a/ci-scripts/xml_files/fr1_oai_cn_undeploy.xml +++ b/ci-scripts/xml_files/fr1_oai_cn_undeploy.xml @@ -31,8 +31,9 @@ - Undeploy_EPC - Undeploy all EPC containers + UndeployCoreNetwork + Undeploy EPC + porcepix-cn4g diff --git a/ci-scripts/xml_files/lte_oai_cn_deploy.xml b/ci-scripts/xml_files/lte_oai_cn_deploy.xml index 0279c1f3b3..3e4ea86e61 100644 --- a/ci-scripts/xml_files/lte_oai_cn_deploy.xml +++ b/ci-scripts/xml_files/lte_oai_cn_deploy.xml @@ -31,9 +31,9 @@ - Deploy_EPC - Deploy all EPC containers - yaml_files/magma_lte_20892 + DeployCoreNetwork + Deploy EPC + nano-cn4g diff --git a/ci-scripts/xml_files/lte_oai_cn_undeploy.xml b/ci-scripts/xml_files/lte_oai_cn_undeploy.xml index 76192efea1..b81aa01a1f 100644 --- a/ci-scripts/xml_files/lte_oai_cn_undeploy.xml +++ b/ci-scripts/xml_files/lte_oai_cn_undeploy.xml @@ -31,8 +31,9 @@ - Undeploy_EPC - Undeploy all EPC containers + UndeployCoreNetwork + Undeploy EPC + nano-cn4g diff --git a/ci-scripts/yaml_files/magma_nsa_20897/oai_db.cql b/ci-scripts/yaml_files/magma_nsa_20897/oai_db.cql new file mode 100644 index 0000000000..2be0a8e2e9 --- /dev/null +++ b/ci-scripts/yaml_files/magma_nsa_20897/oai_db.cql @@ -0,0 +1,93 @@ +CREATE KEYSPACE IF NOT EXISTS vhss WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '1'}; + +CREATE TABLE IF NOT EXISTS vhss.users_imsi ( + imsi text PRIMARY KEY, + access_restriction int, + idmmeidentity int, + imei text, + imei_sv text, + key text, + lipa_permissions text, + mme_cap int, + mmehost text, + mmeidentity_idmmeidentity int, + mmerealm text, + ms_ps_status text, + msisdn bigint, + niddvalidity text, + nir_dest_host text, + nir_dest_realm text, + opc text, + pgw_id int, + rand text, + rfsp_index varint, + sqn bigint, + subscription_data text, + ue_reachability varint, + urrp_mme varint, + user_identifier text, + visited_plmnid text); + +CREATE TABLE IF NOT EXISTS vhss.msisdn_imsi ( + msisdn bigint PRIMARY KEY, + imsi text +); + +CREATE TABLE IF NOT EXISTS vhss.global_ids ( + table_name text PRIMARY KEY, + id counter); + +CREATE TABLE IF NOT EXISTS vhss.mmeidentity_host ( + mmehost text PRIMARY KEY, + idmmeidentity int, + mmerealm text, + ue_reachability varint, + mmeisdn text); + +CREATE TABLE IF NOT EXISTS vhss.mmeidentity ( + idmmeidentity int PRIMARY KEY, + mmehost text, + mmerealm text, + ue_reachability varint, + mmeisdn text); + +CREATE TABLE IF NOT EXISTS vhss.events ( + scef_id text, + scef_ref_id bigint, + extid text, + monitoring_event_configuration text, + monitoring_type int, + msisdn bigint, + user_identifier text, + primary key (scef_id, scef_ref_id) +); + +CREATE TABLE IF NOT EXISTS vhss.events_msisdn ( + msisdn bigint, + scef_id text, + scef_ref_id bigint, + primary key (msisdn, scef_id, scef_ref_id) +); + +CREATE TABLE IF NOT EXISTS vhss.events_extid ( + extid text, + scef_id text, + scef_ref_id bigint, + primary key (extid, scef_id, scef_ref_id) +); + +CREATE TABLE IF NOT EXISTS vhss.extid ( + extid text primary key +); + +CREATE TABLE IF NOT EXISTS vhss.extid_imsi ( + extid text, + imsi text, + primary key (extid, imsi) +); + +CREATE TABLE IF NOT EXISTS vhss.extid_imsi_xref ( + imsi text, + extid text, + primary key (imsi, extid) +); From 98ac540d57fd3a67b798b2ff6a13257b999a174f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Mar 2025 08:38:19 +0100 Subject: [PATCH 25/35] 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 --- ci-scripts/ci_infra.yaml | 9 +++++++++ ci-scripts/cls_oaicitest.py | 11 +++++++++++ ci-scripts/main.py | 2 ++ ci-scripts/xml_files/container_4g_l2sim_tdd.xml | 4 ++++ .../xml_files/container_4g_rfsim_fdd_05MHz.xml | 6 +++++- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 4 ++++ .../xml_files/container_4g_rfsim_fdd_10MHz.xml | 4 ++++ .../xml_files/container_4g_rfsim_fdd_20MHz.xml | 4 ++++ .../xml_files/container_4g_rfsim_tdd_05MHz.xml | 4 ++++ ci-scripts/xml_files/container_5g_e1_rfsim.xml | 2 ++ ci-scripts/xml_files/container_5g_f1_rfsim.xml | 6 +++++- ci-scripts/xml_files/container_5g_fdd_rfsim.xml | 4 ++++ .../xml_files/container_5g_flexric_rfsim.xml | 2 ++ ci-scripts/xml_files/container_5g_rfsim.xml | 14 +++++++++++++- ci-scripts/xml_files/container_5g_rfsim_24prb.xml | 4 ++++ ci-scripts/xml_files/container_5g_rfsim_2x2.xml | 4 ++++ .../xml_files/container_5g_rfsim_fdd_phytest.xml | 4 ++++ .../xml_files/container_5g_rfsim_fr2_32prb.xml | 4 ++++ .../xml_files/container_5g_rfsim_ntn_geo.xml | 4 ++++ .../xml_files/container_5g_rfsim_tdd_dora.xml | 4 ++++ .../xml_files/container_5g_rfsim_u0_25prb.xml | 4 ++++ 21 files changed, 101 insertions(+), 3 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index edb6078e4a..4d1a87ddba 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -386,6 +386,15 @@ rfsim5g_ext_dn: NetworkScript: docker exec rfsim5g-oai-ext-dn ip a show dev eth0 CmdPrefix: docker exec rfsim5g-oai-ext-dn +oai_ext_dn: + Host: "%%current_host%%" + NetworkScript: docker exec oai-ext-dn ip a show dev eth0 + CmdPrefix: docker exec oai-ext-dn + +rfsim5g_5gc_fixed_ip: + Host: "%%current_host%%" + NetworkScript: echo "inet 12.1.1.1" + rfsim4g_ue: Host: "%%current_host%%" NetworkScript: docker exec rfsim4g-oai-lte-ue0 ip a show dev oaitun_ue1 diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 282667df31..8169dd6888 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -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()) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index efb4f97166..f2d04f0615 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -243,6 +243,8 @@ def ExecuteActionWithParam(action): CiTestObj.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold') CiTestObj.ue_ids = test.findtext('id').split(' ') CiTestObj.svr_id = test.findtext('svr_id') or None + if test.findtext('svr_node'): + CiTestObj.svr_node = test.findtext('svr_node') if not force_local else 'localhost' if force_local: # Change all execution targets to localhost CiTestObj.nodes = ['localhost'] * len(CiTestObj.ue_ids) diff --git a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml index 6a0e5ae00f..543db0bf75 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml @@ -101,6 +101,8 @@ Ping trf-gen from LTE-UE 1 l2sim4g_ue obelix + l2sim4g_ext_dn + obelix -c 20 192.168.61.11 0 @@ -110,6 +112,8 @@ Ping LTE-UE 1 from trf-gen l2sim4g_ext_dn obelix + l2sim4g_ue + obelix -c 20 12.0.0.2 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index 12f8f13a5b..7604a6fb20 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -116,6 +116,8 @@ Ping Traffic-Gen from LTE-UE rfsim4g_ue cacofonix + rfsim4g_ext_dn + cacofonix -c 20 192.168.61.11 5 @@ -124,8 +126,10 @@ Ping Ping LTE-UE from Traffic-Gen rfsim4g_ext_dn - -c 20 12.0.0.2 cacofonix + rfsim4g_ue + cacofonix + -c 20 12.0.0.2 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml index 031a308a5c..9783ddacfb 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -87,6 +87,8 @@ Ping Traffic-Gen from LTE-UE rfsim4g_ue cacofonix + rfsim4g_enb_nos1 + cacofonix -c 20 10.0.1.1 5 @@ -96,6 +98,8 @@ Ping LTE-UE from eNB rfsim4g_enb_nos1 cacofonix + rfsim4g_ue + cacofonix -c 20 10.0.1.2 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index d56aeb231e..15064739a1 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -116,6 +116,8 @@ Ping Traffic-Gen from LTE-UE rfsim4g_ue cacofonix + rfsim4g_ext_dn + cacofonix -c 20 192.168.61.11 5 @@ -125,6 +127,8 @@ Ping LTE-UE from Traffic-Gen rfsim4g_ext_dn cacofonix + rfsim4g_ue + cacofonix -c 20 12.0.0.2 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index e957417f1c..9bf9ac5dd9 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -116,6 +116,8 @@ Ping Traffic-Gen from LTE-UE rfsim4g_ue cacofonix + rfsim4g_ext_dn + cacofonix -c 20 192.168.61.11 5 @@ -125,6 +127,8 @@ Ping LTE-UE from Traffic-Gen rfsim4g_ext_dn cacofonix + rfsim4g_ue + cacofonix -c 20 12.0.0.2 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index e292958576..8a19ffd262 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -109,6 +109,8 @@ Ping Traffic-Gen from LTE-UE rfsim4g_ue cacofonix + rfsim4g_ext_dn + cacofonix -c 20 192.168.61.11 5 @@ -118,6 +120,8 @@ Ping LTE-UE from Traffic-Gen rfsim4g_ext_dn cacofonix + rfsim4g_ue + cacofonix -c 20 12.0.0.2 5 diff --git a/ci-scripts/xml_files/container_5g_e1_rfsim.xml b/ci-scripts/xml_files/container_5g_e1_rfsim.xml index 8128fca08c..82c5dfa774 100644 --- a/ci-scripts/xml_files/container_5g_e1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_e1_rfsim.xml @@ -88,6 +88,8 @@ Ping ext-dn from all NR-UEs rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3 cacofonix cacofonix cacofonix + rfsim5g_5gc_fixed_ip + cacofonix -c 20 12.1.1.1 -i0.25 5 diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index 280475e182..9fa92e49bb 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -117,6 +117,8 @@ Ping ext-dn from all NR-UEs rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 192.168.72.135 -i0.25 5 @@ -163,9 +165,11 @@ Ping - Ping ext-dn from all NR-UEs + Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 192.168.72.135 -i0.5 -w25 80 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 276bb5b9a3..25620b6a42 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -81,6 +81,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -90,6 +92,8 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue + cacofonix -c 20 -i 0.25 12.1.1.2 5 diff --git a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml index ef28c06bbf..9805953b27 100644 --- a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml @@ -134,6 +134,8 @@ Ping ext-dn from both UEs rfsim5g_ue rfsim5g_ue2 carabe carabe + oai_ext_dn + carabe -c 20 192.168.70.135 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index 3897421c27..77b09c4781 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -141,6 +141,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -150,7 +152,9 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 12.1.1.2 + rfsim5g_ue + cacofonix + -c 20 -i 0.25 12.1.1.2 5 @@ -159,6 +163,8 @@ Ping ext-dn from Second NR-UE rfsim5g_ue2 cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -168,6 +174,8 @@ Ping Second NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue2 + cacofonix -c 20 -i 0.25 12.1.1.3 5 @@ -177,6 +185,8 @@ Ping ext-dn from both UEs rfsim5g_ue rfsim5g_ue2 cacofonix cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -186,6 +196,8 @@ Ping ext-dn from all UEs rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10 cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix + rfsim5g_ext_dn + cacofonix -c 20 192.168.72.135 -i 0.25 -s 1016 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml index fe80891678..e139be4978 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml @@ -90,6 +90,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i0.2 192.168.72.135 5 @@ -99,6 +101,8 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue + cacofonix -c 20 12.1.1.2 -i0.2 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml index 3b7a1d738e..5557d3156d 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml @@ -81,6 +81,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -90,6 +92,8 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue + cacofonix -c 20 -i 0.25 12.1.1.2 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml index 100465614d..8346325253 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml @@ -81,6 +81,8 @@ Ping gNB from NR-UE rfsim5g_ue cacofonix + rfsim5g_gnb_nos1 + cacofonix -c20 -i0.2 10.0.1.1 0 @@ -90,6 +92,8 @@ Ping NR-UE from gNB rfsim5g_gnb_nos1 cacofonix + rfsim5g_ue + cacofonix -c20 -i0.2 10.0.1.2 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml index d700862689..b55ad45cee 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml @@ -73,6 +73,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i0.2 192.168.72.135 0 @@ -82,6 +84,8 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue + cacofonix -c 20 12.1.1.2 -i0.2 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml index 5e3c4bedb5..0d1f6e59c0 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml @@ -81,6 +81,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -90,6 +92,8 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue + cacofonix -c 20 -i 0.25 12.1.1.2 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml index 861158c08f..4bc1e8a8e5 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml @@ -80,6 +80,8 @@ Ping gNB from NR-UE rfsim5g_ue cacofonix + rfsim5g_gnb_nos1 + cacofonix -c20 -i0.2 10.0.1.1 0 @@ -89,6 +91,8 @@ Ping NR-UE from gNB rfsim5g_gnb_nos1 cacofonix + rfsim5g_ue + cacofonix -c20 -i0.2 10.0.1.2 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml index ee4c334cee..c7807fcb88 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -81,6 +81,8 @@ Ping ext-dn from NR-UE rfsim5g_ue cacofonix + rfsim5g_ext_dn + cacofonix -c 20 -i 0.25 192.168.72.135 5 @@ -90,6 +92,8 @@ Ping NR-UE from ext-dn rfsim5g_ext_dn cacofonix + rfsim5g_ue + cacofonix -c 20 -i 0.25 12.1.1.2 5 From 617255049226b1280229445312022ecae3e43b1a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 25 Mar 2025 14:02:53 +0100 Subject: [PATCH 26/35] CI: Remove %cn_ip%/hardcoded IPs from ping test options With the server object to be passed into ping test, it's not necessary to either hardcode an IP address or provide a template. Instead, always fill the IP address, which simplies the Ping() code. Verify that we don't have an IP address/hardcoded by throwing an assertion. --- ci-scripts/cls_oaicitest.py | 21 ++++++------------- ci-scripts/tests/ping-iperf.py | 2 +- .../xml_files/container_4g_l2sim_tdd.xml | 4 ++-- .../container_4g_rfsim_fdd_05MHz.xml | 4 ++-- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 4 ++-- .../container_4g_rfsim_fdd_10MHz.xml | 4 ++-- .../container_4g_rfsim_fdd_20MHz.xml | 4 ++-- .../container_4g_rfsim_tdd_05MHz.xml | 4 ++-- .../xml_files/container_5g_e1_rfsim.xml | 2 +- .../xml_files/container_5g_f1_rfsim.xml | 4 ++-- .../xml_files/container_5g_fdd_rfsim.xml | 4 ++-- .../xml_files/container_5g_flexric_rfsim.xml | 2 +- ci-scripts/xml_files/container_5g_rfsim.xml | 12 +++++------ .../xml_files/container_5g_rfsim_24prb.xml | 4 ++-- .../xml_files/container_5g_rfsim_2x2.xml | 4 ++-- .../container_5g_rfsim_fdd_phytest.xml | 4 ++-- .../container_5g_rfsim_fr2_32prb.xml | 4 ++-- .../xml_files/container_5g_rfsim_ntn_geo.xml | 4 ++-- .../xml_files/container_5g_rfsim_tdd_dora.xml | 4 ++-- .../xml_files/container_5g_rfsim_u0_25prb.xml | 4 ++-- .../container_lte_b200_fdd_05Mhz_tm1.xml | 2 +- ...container_lte_b200_fdd_05Mhz_tm1_if4_5.xml | 2 +- ...lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml | 4 ++-- .../container_lte_b200_fdd_10Mhz_tm1.xml | 2 +- .../container_lte_b200_fdd_10Mhz_tm1_cdrx.xml | 2 +- ...container_lte_b200_fdd_10Mhz_tm1_oaiue.xml | 2 +- .../container_lte_b200_fdd_20Mhz_tm1.xml | 2 +- .../container_lte_b200_tdd_05Mhz_tm1.xml | 2 +- ...container_lte_b200_tdd_05Mhz_tm1_if4_5.xml | 2 +- .../container_lte_b200_tdd_10Mhz_tm1.xml | 2 +- .../container_lte_b200_tdd_20Mhz_tm1.xml | 2 +- ...e_b200_tdd_20Mhz_tm1_default_scheduler.xml | 2 +- .../container_lte_n3xx_tdd_2x2_tm1.xml | 4 ++-- .../container_lte_n3xx_tdd_2x2_tm2.xml | 4 ++-- .../xml_files/container_nsa_b200_quectel.xml | 8 +++---- .../xml_files/container_sa_aerial_quectel.xml | 2 +- .../xml_files/container_sa_aw2s_asue.xml | 4 ++-- .../xml_files/container_sa_aw2s_asue_2x2.xml | 4 ++-- .../xml_files/container_sa_b200_quectel.xml | 4 ++-- .../container_sa_e1_b200_quectel.xml | 2 +- .../container_sa_f1_b200_quectel.xml | 8 +++---- .../container_sa_fhi72_metanoia_up2_2x2.xml | 2 +- .../xml_files/container_sa_fhi72_vvdn_up2.xml | 2 +- .../container_sa_n310_2X2_100MHz_quectel.xml | 2 +- .../container_sa_n310_2X2_60MHz_quectel.xml | 2 +- .../container_sa_n310_4X4_60MHz_quectel.xml | 2 +- .../xml_files/container_sa_n310_nrue.xml | 4 ++-- .../container_sa_sc_b200_quectel.xml | 4 ++-- 48 files changed, 87 insertions(+), 96 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 8169dd6888..33b78f3501 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -368,25 +368,16 @@ class OaiCiTest(): ueIP = ue.getIP() if not ueIP: return (False, f"UE {ue.getName()} has no IP address") + svrIP = cn.getIP() + if not svrIP: + return (False, f"CN {cn.getName()} has no IP address") ping_log_file = f'ping_{self.testCase_id}_{ue.getName()}.log' ping_time = re.findall("-c *(\d+)",str(self.ping_args)) local_ping_log_file = f'{logPath}/{ping_log_file}' - # 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") + if re.search('%cn_ip%', self.ping_args) or re.search(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', self.ping_args): + raise Exception(f"ping_args should not have IP address: {self.ping_args}") 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}' + ping_cmd = f'{ue.getCmdPrefix()} ping {interface} {self.ping_args} {svrIP} 2>&1 | tee /tmp/{ping_log_file}' cmd = cls_cmd.getConnection(ue.getHost()) response = cmd.run(ping_cmd, timeout=int(ping_time[0])*1.5) ue_header = f'UE {ue.getName()} ({ueIP})' diff --git a/ci-scripts/tests/ping-iperf.py b/ci-scripts/tests/ping-iperf.py index 6fcc159e3d..225fe4e868 100644 --- a/ci-scripts/tests/ping-iperf.py +++ b/ci-scripts/tests/ping-iperf.py @@ -25,7 +25,7 @@ class TestPingIperf(unittest.TestCase): self.cont = cls_containerize.Containerize() def test_ping(self): - self.ci.ping_args = "-c3 127.0.0.1" + self.ci.ping_args = "-c3" self.ci.ping_packetloss_threshold = "0" self.ci.svr_id = "test" infra_file = "tests/config/infra_ping_iperf.yaml" diff --git a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml index 543db0bf75..98e0ec7d08 100644 --- a/ci-scripts/xml_files/container_4g_l2sim_tdd.xml +++ b/ci-scripts/xml_files/container_4g_l2sim_tdd.xml @@ -103,7 +103,7 @@ obelix l2sim4g_ext_dn obelix - -c 20 192.168.61.11 + -c 20 0 @@ -114,7 +114,7 @@ obelix l2sim4g_ue obelix - -c 20 12.0.0.2 + -c 20 0 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index 7604a6fb20..aa80d4b5dc 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -118,7 +118,7 @@ cacofonix rfsim4g_ext_dn cacofonix - -c 20 192.168.61.11 + -c 20 5 @@ -129,7 +129,7 @@ cacofonix rfsim4g_ue cacofonix - -c 20 12.0.0.2 + -c 20 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml index 9783ddacfb..bfcade47ab 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -89,7 +89,7 @@ cacofonix rfsim4g_enb_nos1 cacofonix - -c 20 10.0.1.1 + -c 20 5 @@ -100,7 +100,7 @@ cacofonix rfsim4g_ue cacofonix - -c 20 10.0.1.2 + -c 20 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index 15064739a1..0cf4944a6c 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -118,7 +118,7 @@ cacofonix rfsim4g_ext_dn cacofonix - -c 20 192.168.61.11 + -c 20 5 @@ -129,7 +129,7 @@ cacofonix rfsim4g_ue cacofonix - -c 20 12.0.0.2 + -c 20 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 9bf9ac5dd9..069db0c585 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -118,7 +118,7 @@ cacofonix rfsim4g_ext_dn cacofonix - -c 20 192.168.61.11 + -c 20 5 @@ -129,7 +129,7 @@ cacofonix rfsim4g_ue cacofonix - -c 20 12.0.0.2 + -c 20 5 diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index 8a19ffd262..df44214af9 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -111,7 +111,7 @@ cacofonix rfsim4g_ext_dn cacofonix - -c 20 192.168.61.11 + -c 20 5 @@ -122,7 +122,7 @@ cacofonix rfsim4g_ue cacofonix - -c 20 12.0.0.2 + -c 20 5 diff --git a/ci-scripts/xml_files/container_5g_e1_rfsim.xml b/ci-scripts/xml_files/container_5g_e1_rfsim.xml index 82c5dfa774..95ae2f7b0a 100644 --- a/ci-scripts/xml_files/container_5g_e1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_e1_rfsim.xml @@ -90,7 +90,7 @@ cacofonix cacofonix cacofonix rfsim5g_5gc_fixed_ip cacofonix - -c 20 12.1.1.1 -i0.25 + -c 20 -i0.25 5 diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index 9fa92e49bb..f45265db43 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -119,7 +119,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 192.168.72.135 -i0.25 + -c 20 -i0.25 5 @@ -170,7 +170,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 192.168.72.135 -i0.5 -w25 + -c 20 -i0.5 -w25 80 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 25620b6a42..5000ed1bb2 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -83,7 +83,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -94,7 +94,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 -i 0.25 12.1.1.2 + -c 20 -i 0.25 5 diff --git a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml index 9805953b27..d0d3446f41 100644 --- a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml @@ -136,7 +136,7 @@ carabe carabe oai_ext_dn carabe - -c 20 192.168.70.135 + -c 20 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index 77b09c4781..f20820629b 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -143,7 +143,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -154,7 +154,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 -i 0.25 12.1.1.2 + -c 20 -i 0.25 5 @@ -165,7 +165,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -176,7 +176,7 @@ cacofonix rfsim5g_ue2 cacofonix - -c 20 -i 0.25 12.1.1.3 + -c 20 -i 0.25 5 @@ -187,7 +187,7 @@ cacofonix cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -198,7 +198,7 @@ cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix rfsim5g_ext_dn cacofonix - -c 20 192.168.72.135 -i 0.25 -s 1016 + -c 20 -i 0.25 -s 1016 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml index e139be4978..f4ee341c94 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_24prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_24prb.xml @@ -92,7 +92,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i0.2 192.168.72.135 + -c 20 -i0.2 5 @@ -103,7 +103,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 12.1.1.2 -i0.2 + -c 20 -i0.2 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml index 5557d3156d..77d39a3c55 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_2x2.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_2x2.xml @@ -83,7 +83,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -94,7 +94,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 -i 0.25 12.1.1.2 + -c 20 -i 0.25 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml index 8346325253..cd908d0d82 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml @@ -83,7 +83,7 @@ cacofonix rfsim5g_gnb_nos1 cacofonix - -c20 -i0.2 10.0.1.1 + -c20 -i0.2 0 @@ -94,7 +94,7 @@ cacofonix rfsim5g_ue cacofonix - -c20 -i0.2 10.0.1.2 + -c20 -i0.2 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml index b55ad45cee..db10ff6478 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml @@ -75,7 +75,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i0.2 192.168.72.135 + -c 20 -i0.2 0 @@ -86,7 +86,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 12.1.1.2 -i0.2 + -c 20 -i0.2 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml index 0d1f6e59c0..72a6836882 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_ntn_geo.xml @@ -83,7 +83,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -94,7 +94,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 -i 0.25 12.1.1.2 + -c 20 -i 0.25 5 diff --git a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml index 4bc1e8a8e5..bf71fc98ab 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml @@ -82,7 +82,7 @@ cacofonix rfsim5g_gnb_nos1 cacofonix - -c20 -i0.2 10.0.1.1 + -c20 -i0.2 0 @@ -93,7 +93,7 @@ cacofonix rfsim5g_ue cacofonix - -c20 -i0.2 10.0.1.2 + -c20 -i0.2 0 diff --git a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml index c7807fcb88..bedb40799e 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_u0_25prb.xml @@ -83,7 +83,7 @@ cacofonix rfsim5g_ext_dn cacofonix - -c 20 -i 0.25 192.168.72.135 + -c 20 -i 0.25 5 @@ -94,7 +94,7 @@ cacofonix rfsim5g_ue cacofonix - -c 20 -i 0.25 12.1.1.2 + -c 20 -i 0.25 5 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml index 2213abd413..a6d39d3f98 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml @@ -121,7 +121,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml Ping ping (5MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml index 2853e270f6..3e306844de 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_if4_5.xml @@ -129,7 +129,7 @@ Ping ping (5MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml index fbff50c09c..9d54eceaeb 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml @@ -159,7 +159,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Ping ping (5MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano @@ -168,7 +168,7 @@ Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xm Ping ping (5MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml index 78d4138517..2889101ee8 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml @@ -115,7 +115,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Ping ping (10MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml index 223404f07e..fb18ce090f 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml @@ -108,7 +108,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Ping ping (10MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml index 5a04dff1fc..5501ad86fb 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_oaiue.xml @@ -144,7 +144,7 @@ Ping ping (10MHz - 20 sec) - -c 20 192.168.61.200 + -c 20 5 lte_oai_ue_carabe nano-cn4g diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml index 3ea5b45735..3a64107484 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml @@ -114,7 +114,7 @@ Replaces xml_files/enb_usrp210_band7_test_10mhz_tm1.xml Ping ping (20MHz - 20 sec) - -c 20 %cn_ip% + -c 20 5 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml index 99c6ada431..bb6359d636 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml @@ -122,7 +122,7 @@ Replaces xml_files/enb_usrp210_band40_test_05mhz_tm1.xml Ping ping (5MHz - 20 sec) - -c 20 %cn_ip% + -c 20 25 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml index 390badad91..0d4d1cae81 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1_if4_5.xml @@ -129,7 +129,7 @@ Ping ping (5MHz - 20 sec) - -c 20 %cn_ip% + -c 20 25 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml index 1d2eff3707..e261a3a057 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml @@ -113,7 +113,7 @@ Replaces xml_files/enb_usrp210_band40_test_10mhz_tm1.xml Ping ping (10MHz - 20 sec) - -c 20 %cn_ip% + -c 20 25 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml index 2db8e754b9..dd8ef337b8 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml @@ -113,7 +113,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1.xml Ping ping (20MHz - 20 sec) - -c 20 %cn_ip% + -c 20 25 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml index 57554d17f2..1719ad2691 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -114,7 +114,7 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml Ping ping (20MHz - 20 sec) - -c 20 %cn_ip% + -c 20 25 adb_ue_1 adb_ue_2 ltebox-nano diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml index 511f5a0e9c..f127601e39 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm1.xml @@ -96,7 +96,7 @@ Ping: 20 pings up2 porcepix-cn4g - -c 20 %cn_ip% + -c 20 1 60 @@ -106,7 +106,7 @@ Ping: 100 pings, size 1024 up2 porcepix-cn4g - -c 100 -s 1024 -i 0.2 %cn_ip% + -c 100 -s 1024 -i 0.2 1 60 diff --git a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml index 0c85c4f028..af3299061a 100644 --- a/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml +++ b/ci-scripts/xml_files/container_lte_n3xx_tdd_2x2_tm2.xml @@ -96,7 +96,7 @@ Ping: 20 pings up2 porcepix-cn4g - -c 20 %cn_ip% + -c 20 1 60 @@ -106,7 +106,7 @@ Ping: 100 pings, size 1024 up2 porcepix-cn4g - -c 100 -s 1024 -i 0.2 %cn_ip% + -c 100 -s 1024 -i 0.2 1 60 diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index c0c95f1ea8..035163f3db 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -169,7 +169,7 @@ Ping: 20pings in 20sec idefix ltebox-nepes - -c 20 %cn_ip% + -c 20 1 15 @@ -179,7 +179,7 @@ Ping: 100pings in 20sec idefix ltebox-nepes - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 @@ -189,7 +189,7 @@ Ping: 20pings in 20sec idefix ltebox-nepes - -c 20 %cn_ip% + -c 20 1 15 @@ -199,7 +199,7 @@ Ping: 100pings in 20sec idefix ltebox-nepes - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml index 1d91dbd482..07c0c095a2 100644 --- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml +++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml @@ -90,7 +90,7 @@ Ping: 100pings in 20sec up2-aerial oc-cn5g-20897-aerial2 - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 5 diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue.xml b/ci-scripts/xml_files/container_sa_aw2s_asue.xml index 29c864e8d1..7eb6411827 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue.xml @@ -226,7 +226,7 @@ Ping: 50 pings in 10sec, multi-ue amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 oc-cn5g - -c 50 -i 0.2 %cn_ip% + -c 50 -i 0.2 5 25 @@ -242,7 +242,7 @@ Ping: 50pings in 10sec, multi-ue amarisoft_ue_16 oc-cn5g - -c 50 -i 0.2 %cn_ip% + -c 50 -i 0.2 5 30 diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml b/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml index 87031898ba..739534be21 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml @@ -223,7 +223,7 @@ Ping: 20pings in 20sec, multi-ue amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 oc-cn5g - -c 20 %cn_ip% + -c 20 5 25 @@ -239,7 +239,7 @@ Ping: 50pings in 10sec, multi-ue amarisoft_ue_16 oc-cn5g - -c 50 -i 0.2 %cn_ip% + -c 50 -i 0.2 5 30 diff --git a/ci-scripts/xml_files/container_sa_b200_quectel.xml b/ci-scripts/xml_files/container_sa_b200_quectel.xml index e75eb2a977..f4f415acdf 100644 --- a/ci-scripts/xml_files/container_sa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_b200_quectel.xml @@ -131,7 +131,7 @@ Ping: 20pings in 20sec idefix sabox-nepes - -c 20 %cn_ip% + -c 20 1 15 @@ -141,7 +141,7 @@ Ping: 100pings in 20sec idefix sabox-nepes - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 diff --git a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml index 10acef9644..1718eb3152 100644 --- a/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_e1_b200_quectel.xml @@ -132,7 +132,7 @@ Ping: 50pings in 10sec idefix sabox-nepes - -c 20 -i 0.2 %cn_ip% + -c 20 -i 0.2 1 25 diff --git a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml index d9743704df..614b9ac57e 100644 --- a/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_f1_b200_quectel.xml @@ -144,7 +144,7 @@ Ping: 20pings in 20sec idefix sabox-nepes - -c 20 %cn_ip% + -c 20 1 25 @@ -154,7 +154,7 @@ Ping: 100pings in 20sec idefix sabox-nepes - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 110 @@ -164,7 +164,7 @@ Ping: 20pings in 20sec idefix sabox-nepes - -c 20 %cn_ip% + -c 20 1 110 @@ -174,7 +174,7 @@ Ping: 100pings in 20sec idefix sabox-nepes - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 110 diff --git a/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml b/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml index 9c408a81f5..e71ec3e37c 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_metanoia_up2_2x2.xml @@ -85,7 +85,7 @@ Ping: 100 pings in 10 sec up2-fhi72 oc-cn5g-20897 - -c 100 -i 0.1 %cn_ip% + -c 100 -i 0.1 1 15 diff --git a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml index 5374d216c8..28abfb3871 100644 --- a/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml +++ b/ci-scripts/xml_files/container_sa_fhi72_vvdn_up2.xml @@ -84,7 +84,7 @@ Ping: 100 pings in 10 sec up2-fhi72 oc-cn5g-20897 - -c 100 -i 0.1 %cn_ip% + -c 100 -i 0.1 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml index 90687e39f0..94e97176ff 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_100MHz_quectel.xml @@ -109,7 +109,7 @@ Ping: 100pings in 20sec up2 matix-cn5g - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml index 631acc3285..a701fc5ab9 100644 --- a/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_2X2_60MHz_quectel.xml @@ -109,7 +109,7 @@ Ping: 100pings in 20sec up2 matix-cn5g - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml b/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml index 58e2825ff3..7f5a926948 100644 --- a/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml +++ b/ci-scripts/xml_files/container_sa_n310_4X4_60MHz_quectel.xml @@ -109,7 +109,7 @@ Ping: 100pings in 20sec up2 matix-cn5g - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 diff --git a/ci-scripts/xml_files/container_sa_n310_nrue.xml b/ci-scripts/xml_files/container_sa_n310_nrue.xml index 00b4dfa583..7d093be3d7 100644 --- a/ci-scripts/xml_files/container_sa_n310_nrue.xml +++ b/ci-scripts/xml_files/container_sa_n310_nrue.xml @@ -128,7 +128,7 @@ Ping: 20pings in 20sec oai_ue_caracal oc-cn5g - -c 20 %cn_ip% + -c 20 1 25 @@ -138,7 +138,7 @@ Ping: 100pings in 20sec oai_ue_caracal oc-cn5g - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 30 diff --git a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml index d301bee3ac..f72dafee06 100644 --- a/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml +++ b/ci-scripts/xml_files/container_sa_sc_b200_quectel.xml @@ -125,7 +125,7 @@ Ping: 20pings in 20sec idefix sabox-nepes - -c 20 %cn_ip% + -c 20 1 15 @@ -135,7 +135,7 @@ Ping: 100pings in 20sec idefix sabox-nepes - -c 100 -i 0.2 %cn_ip% + -c 100 -i 0.2 1 15 From 96e20b1399501c282aae47e05549343f23e6d2ad Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 12 Nov 2024 19:07:09 +0100 Subject: [PATCH 27/35] Remove LogCollectUE options: not used --- ci-scripts/Jenkinsfile-tmp-full-ran | 3 --- ci-scripts/Jenkinsfile-tmp-multi-enb-nsa | 3 --- ci-scripts/cls_oaicitest.py | 11 ----------- ci-scripts/main.py | 5 +---- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index c1ed3e6b0e..4ba94294e2 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -309,9 +309,6 @@ pipeline { withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'] ]) { - echo '\u2705 \u001B[32mLog Collection (OAI UE - Run)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectOAIUE --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath}" - echo '\u2705 \u001B[32mLog Transfer (OAI UE - Run)\u001B[0m' sh "sshpass -p \'${UE_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${UE_Username}@${params.UE_IPAddress}:${UE_SourceCodePath}/cmake_targets/ue.log.zip ./ue.log.${env.BUILD_ID}.zip || true" } diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa index 4ee2cf9b0e..b31c99b0ad 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa @@ -293,9 +293,6 @@ pipeline { withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'] ]) { - echo '\u2705 \u001B[32mLog Collection (OAI UE - Run)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectOAIUE --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath}" - echo '\u2705 \u001B[32mLog Transfer (OAI UE - Run)\u001B[0m' sh "sshpass -p \'${UE_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${UE_Username}@${params.UE_IPAddress}:${UE_SourceCodePath}/cmake_targets/ue.log.zip ./ue.log.${env.BUILD_ID}.zip || true" } diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 33b78f3501..435d7c4128 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -930,17 +930,6 @@ class OaiCiTest(): cmd.run(f'cd {d} && zip iperf.log.zip iperf*.log') cmd.run(f'rm {d}/iperf*.log') - def LogCollectOAIUE(self): - # Some pipelines are using "none" IP / Credentials - # In that case, just forget about it - if self.UEIPAddress == 'none': - sys.exit(0) - with cls_cmd.getConnection(self.UEIPAddress) as cmd: - d = f'{self.UESourceCodePath}/cmake_targets' - cmd.run(f'echo {self.UEPassword} | sudo -S rm -f {d}/ue.log.zip') - cmd.run(f'cd {d} && echo {self.UEPassword} | sudo -S zip ue.log.zip ue*.log core* ue_*record.raw ue_*.pcap ue_*txt') - cmd.run(f'echo {self.UEPassword} | sudo -S rm {d}/ue*.log {d}/core* {d}/ue_*record.raw {d}/ue_*.pcap {d}/ue_*txt') - def ShowTestID(self): logging.info(f'\u001B[1m----------------------------------------\u001B[0m') logging.info(f'\u001B[1m Test ID: {self.testCase_id} \u001B[0m') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index f2d04f0615..ad451c68b5 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -582,10 +582,7 @@ elif re.match('^LogCollectIperf$', mode, re.IGNORECASE): sys.exit('Insufficient Parameter') CiTestObj.LogCollectIperf(EPC) elif re.match('^LogCollectOAIUE$', mode, re.IGNORECASE): - if CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - CiTestObj.LogCollectOAIUE() + logging.warning("Option LogCollectOAIUE ignored") elif re.match('^InitiateHtml$', mode, re.IGNORECASE): count = 0 foundCount = 0 From ed3f02bb64fc1fc157ea40f2c2e8c70f8c1294e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 12 Nov 2024 19:09:04 +0100 Subject: [PATCH 28/35] Remove LogCollectPing option: not used --- ci-scripts/Jenkinsfile-tmp-full-ran | 21 --------------------- ci-scripts/Jenkinsfile-tmp-multi-enb | 22 ---------------------- ci-scripts/Jenkinsfile-tmp-ran | 22 ---------------------- ci-scripts/cls_oaicitest.py | 11 ----------- ci-scripts/helpreadme.py | 1 - ci-scripts/main.py | 5 +---- 6 files changed, 1 insertion(+), 81 deletions(-) diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index 4ba94294e2..32a47dff9d 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -319,27 +319,6 @@ pipeline { } } } - stage('Log Collection (Ping)') { - when { - expression {doEpcLogCollection} - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Ping)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectPing --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (Ping)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/ping.log.zip ./ping.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("ping.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ping.log.${env.BUILD_ID}.zip" - } - } - } - } stage('Log Collection (Iperf)') { when { expression {doEpcLogCollection} diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb b/ci-scripts/Jenkinsfile-tmp-multi-enb index 778c32ecb1..7bdaf9a35e 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb @@ -385,28 +385,6 @@ pipeline { } } } - stage('Log Collection (Ping)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Ping)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectPing --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (Ping)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/ping.log.zip ./ping.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("ping.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ping.log.${env.BUILD_ID}.zip" - } - } - } - } stage('Log Collection (Iperf)') { // Bypassing this stage if EPC server is not defined when { diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index bc8c742bb5..52545349e7 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -411,28 +411,6 @@ pipeline { } } } - stage('Log Collection (Ping)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Ping)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectPing --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (Ping)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/ping.log.zip ./ping.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("ping.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "ping.log.${env.BUILD_ID}.zip" - } - } - } - } stage('Log Collection (Iperf)') { // Bypassing this stage if EPC server is not defined when { diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 435d7c4128..73e8d538a0 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -908,17 +908,6 @@ class OaiCiTest(): cmd.run(f'rm -f {d}/build.log.zip') cmd.run(f'cd {d} && zip -r build.log.zip build_log_*/*') - def LogCollectPing(self,EPC): - # Some pipelines are using "none" IP / Credentials - # In that case, just forget about it - if EPC.IPAddress == 'none': - sys.exit(0) - with cls_cmd.getConnection(EPC.IPAddress) as cmd: - d = f"{EPC.SourceCodePath}/scripts" - cmd.run(f'rm -f {d}/ping.log.zip') - cmd.run(f'cd {d} && zip ping.log.zip ping*.log') - cmd.run(f'rm {d}/ping*.log') - def LogCollectIperf(self,EPC): # Some pipelines are using "none" IP / Credentials # In that case, just forget about it diff --git a/ci-scripts/helpreadme.py b/ci-scripts/helpreadme.py index e1640fc899..7c1582e151 100644 --- a/ci-scripts/helpreadme.py +++ b/ci-scripts/helpreadme.py @@ -42,7 +42,6 @@ def GenericHelp(vers): print(' TesteNB') print(' InitiateHtml, FinalizeHtml') print(' TerminateeNB, TerminateHSS, TerminateMME, TerminateSPGW') - print(' LogCollectBuild, LogCollecteNB, LogCollectHSS, LogCollectMME, LogCollectSPGW, LogCollectPing, LogCollectIperf') print(' --local Force local execution: rewrites the test xml script before running to always execute on localhost. Assumes') print(' images are available locally, will not remove any images and will run inside the current repo directory') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ad451c68b5..2a61f030a4 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -572,10 +572,7 @@ elif re.match('^LogCollectSPGW$', mode, re.IGNORECASE): sys.exit('Insufficient Parameter') EPC.LogCollectSPGW() elif re.match('^LogCollectPing$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - CiTestObj.LogCollectPing(EPC) + logging.warning("Option LogCollectPing ignored") elif re.match('^LogCollectIperf$', mode, re.IGNORECASE): if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': HELP.GenericHelp(CONST.Version) From b8020204a9731a10e71ed09c994a039f7c829bb9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Nov 2024 18:56:01 +0100 Subject: [PATCH 29/35] Remove LogCollectIperf option: not used --- ci-scripts/Jenkinsfile-tmp-full-ran | 21 --------------------- ci-scripts/Jenkinsfile-tmp-multi-enb | 22 ---------------------- ci-scripts/Jenkinsfile-tmp-ran | 22 ---------------------- ci-scripts/cls_oaicitest.py | 11 ----------- ci-scripts/main.py | 5 +---- 5 files changed, 1 insertion(+), 80 deletions(-) diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index 32a47dff9d..31a652cbda 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -319,27 +319,6 @@ pipeline { } } } - stage('Log Collection (Iperf)') { - when { - expression {doEpcLogCollection} - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Iperf)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectIperf --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (Iperf)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/iperf.log.zip ./iperf.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("iperf.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "iperf.log.${env.BUILD_ID}.zip" - } - } - } - } stage('Log Collection (SPGW)') { when { expression {doEpcLogCollection} diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb b/ci-scripts/Jenkinsfile-tmp-multi-enb index 7bdaf9a35e..0b3ec1001a 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb @@ -385,28 +385,6 @@ pipeline { } } } - stage('Log Collection (Iperf)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Iperf)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectIperf --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (Iperf)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/iperf.log.zip ./iperf.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("iperf.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "iperf.log.${env.BUILD_ID}.zip" - } - } - } - } } } } diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index 52545349e7..89f3735b9e 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -411,28 +411,6 @@ pipeline { } } } - stage('Log Collection (Iperf)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (Iperf)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectIperf --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (Iperf)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/iperf.log.zip ./iperf.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("iperf.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "iperf.log.${env.BUILD_ID}.zip" - } - } - } - } } } } diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 73e8d538a0..c01587688a 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -908,17 +908,6 @@ class OaiCiTest(): cmd.run(f'rm -f {d}/build.log.zip') cmd.run(f'cd {d} && zip -r build.log.zip build_log_*/*') - def LogCollectIperf(self,EPC): - # Some pipelines are using "none" IP / Credentials - # In that case, just forget about it - if EPC.IPAddress == 'none': - sys.exit(0) - with cls_cmd.getConnection(EPC.IPAddress) as cmd: - d = f"{EPC.SourceCodePath}/scripts" - cmd.run(f'rm -f {d}/iperf.log.zip') - cmd.run(f'cd {d} && zip iperf.log.zip iperf*.log') - cmd.run(f'rm {d}/iperf*.log') - def ShowTestID(self): logging.info(f'\u001B[1m----------------------------------------\u001B[0m') logging.info(f'\u001B[1m Test ID: {self.testCase_id} \u001B[0m') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 2a61f030a4..d9523c0c00 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -574,10 +574,7 @@ elif re.match('^LogCollectSPGW$', mode, re.IGNORECASE): elif re.match('^LogCollectPing$', mode, re.IGNORECASE): logging.warning("Option LogCollectPing ignored") elif re.match('^LogCollectIperf$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - CiTestObj.LogCollectIperf(EPC) + logging.warning("Option LogCollectIperf ignored") elif re.match('^LogCollectOAIUE$', mode, re.IGNORECASE): logging.warning("Option LogCollectOAIUE ignored") elif re.match('^InitiateHtml$', mode, re.IGNORECASE): From e37ffc63f14513be9e0ecaeada20bc89bace54d0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Nov 2024 18:56:11 +0100 Subject: [PATCH 30/35] Jenkinsfiles: clean up EPC options, not used anymore --- ci-scripts/Jenkinsfile-cluster | 20 +-- ci-scripts/Jenkinsfile-nrue | 19 +-- ci-scripts/Jenkinsfile-physim-deploy | 20 +-- ci-scripts/Jenkinsfile-tmp-full-ran | 84 +----------- ci-scripts/Jenkinsfile-tmp-multi-enb | 124 +---------------- ci-scripts/Jenkinsfile-tmp-multi-enb-nsa | 65 +-------- ci-scripts/Jenkinsfile-tmp-ran | 166 +---------------------- 7 files changed, 7 insertions(+), 491 deletions(-) diff --git a/ci-scripts/Jenkinsfile-cluster b/ci-scripts/Jenkinsfile-cluster index 69c72eebfa..e91b27426e 100644 --- a/ci-scripts/Jenkinsfile-cluster +++ b/ci-scripts/Jenkinsfile-cluster @@ -144,23 +144,6 @@ pipeline { echo "no eNB_mergeRequest given - not merging develop" } - if (params.EPC_IPAddress == null) { - echo "no EPC_IPAddress given" - allParametersPresent = false - } - if (params.EPC_Type == null) { - echo "no EPC_Type given" - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - echo "no EPC_SourceCodePath given" - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - echo "no EPC_Credentials given" - allParametersPresent = false - } - if (params.OC_Credentials == null) { echo "no OC_Credentials given" allParametersPresent = false @@ -206,7 +189,6 @@ pipeline { } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.OC_Credentials}", usernameVariable: 'OC_Username', passwordVariable: 'OC_Password'] ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}" @@ -214,7 +196,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName}" + sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName}" } } catch (Exception e) { currentBuild.result = 'FAILURE' diff --git a/ci-scripts/Jenkinsfile-nrue b/ci-scripts/Jenkinsfile-nrue index 2a8f21483a..aed99b3568 100644 --- a/ci-scripts/Jenkinsfile-nrue +++ b/ci-scripts/Jenkinsfile-nrue @@ -141,18 +141,6 @@ pipeline { } } - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } if (params.OC_Credentials == null) { allParametersPresent = false } @@ -201,7 +189,6 @@ pipeline { withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB1_Credentials}", usernameVariable: 'eNB1_Username', passwordVariable: 'eNB1_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.OC_Credentials}", usernameVariable: 'OC_Username', passwordVariable: 'OC_Password'] ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}" @@ -210,7 +197,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath}" + sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath}" } } catch (Exception e) { currentBuild.result = 'FAILURE' @@ -240,10 +227,6 @@ pipeline { if (fileExists("test_logs_${env.BUILD_ID}.zip")) { archiveArtifacts artifacts: "test_logs_${env.BUILD_ID}.zip" } - if (fileExists("test_logs_CN.zip")){ - sh "mv test_logs_CN.zip test_logs_CN_${env.BUILD_ID}.zip" - archiveArtifacts artifacts: "test_logs_CN_${env.BUILD_ID}.zip" - } if (fileExists("test_results.html")) { sh "mv test_results.html test_results-${env.JOB_NAME}.html" sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" diff --git a/ci-scripts/Jenkinsfile-physim-deploy b/ci-scripts/Jenkinsfile-physim-deploy index 23398d6d8e..ffeff8685b 100644 --- a/ci-scripts/Jenkinsfile-physim-deploy +++ b/ci-scripts/Jenkinsfile-physim-deploy @@ -133,19 +133,6 @@ pipeline { } } - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - if (params.OC_Credentials == null) { allParametersPresent = false } @@ -193,7 +180,6 @@ pipeline { } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.OC_Credentials}", usernameVariable: 'OC_Username', passwordVariable: 'OC_Password'] ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}" @@ -202,7 +188,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName}" + sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --XMLTestFile=${xmlFile} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName}" } } catch (Exception e) { currentBuild.result = 'FAILURE' @@ -232,10 +218,6 @@ pipeline { if (fileExists("test_logs_${env.BUILD_ID}.zip")) { archiveArtifacts artifacts: "test_logs_${env.BUILD_ID}.zip" } - if (fileExists("test_logs_CN.zip")){ - sh "mv test_logs_CN.zip test_logs_CN_${env.BUILD_ID}.zip" - archiveArtifacts artifacts: "test_logs_CN_${env.BUILD_ID}.zip" - } if (fileExists("test_results.html")) { sh "mv test_results.html test_results-${env.JOB_NAME}.html" sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html" diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index 31a652cbda..3aea407002 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -141,24 +141,6 @@ pipeline { } } - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } else { - if (params.EPC_IPAddress == "none") { - doEpcLogCollection = false - echo "No EPC collections (ping/iperf/hss/mme/spgw)" - } - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - if (allParametersPresent) { echo "All parameters are present" if (eNB_AllowMergeRequestProcess) { @@ -200,7 +182,6 @@ pipeline { withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}" String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") @@ -208,7 +189,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile}" + sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath} --XMLTestFile=${xmlFile}" } } catch (Exception e) { currentBuild.result = 'FAILURE' @@ -319,69 +300,6 @@ pipeline { } } } - stage('Log Collection (SPGW)') { - when { - expression {doEpcLogCollection} - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (SPGW)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (SPGW)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("spgw.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "spgw.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (MME)') { - when { - expression {doEpcLogCollection} - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (MME)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (MME)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("mme.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "mme.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (HSS)') { - when { - expression {doEpcLogCollection} - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (HSS)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("hss.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "hss.log.${env.BUILD_ID}.zip" - } - } - } - } } } } diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb b/ci-scripts/Jenkinsfile-tmp-multi-enb index 0b3ec1001a..2680fbe863 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb @@ -143,19 +143,6 @@ pipeline { } } - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - if (allParametersPresent) { echo "All parameters are present" if (eNB_AllowMergeRequestProcess) { @@ -198,7 +185,6 @@ pipeline { [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB1_Credentials}", usernameVariable: 'eNB1_Username', passwordVariable: 'eNB1_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB2_Credentials}", usernameVariable: 'eNB2_Username', passwordVariable: 'eNB2_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}" String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") @@ -206,7 +192,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile}" + sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --XMLTestFile=${xmlFile}" } } catch (Exception e) { currentBuild.result = 'FAILURE' @@ -232,48 +218,6 @@ pipeline { } } } - stage('Terminate SPGW') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - echo '\u2705 \u001B[32mTerminate SPGW\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - } - stage('Terminate MME') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - echo '\u2705 \u001B[32mTerminate MME\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - } - stage('Terminate HSS') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - echo '\u2705 \u001B[32mTerminate HSS\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - } } } stage('Log Collection') { @@ -319,72 +263,6 @@ pipeline { } } } - stage('Log Collection (SPGW)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (SPGW)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (SPGW)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("spgw.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "spgw.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (MME)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (MME)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (MME)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("mme.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "mme.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (HSS)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (HSS)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("hss.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "hss.log.${env.BUILD_ID}.zip" - } - } - } - } } } } diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa index b31c99b0ad..5df1992bf8 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa @@ -154,19 +154,6 @@ pipeline { } } - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - if (allParametersPresent) { echo "All parameters are present" if (eNB_AllowMergeRequestProcess) { @@ -209,7 +196,6 @@ pipeline { [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB1_Credentials}", usernameVariable: 'eNB1_Username', passwordVariable: 'eNB1_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB2_Credentials}", usernameVariable: 'eNB2_Username', passwordVariable: 'eNB2_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password'] ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${mainPythonAllXmlFiles}" @@ -218,7 +204,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile}" + sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --eNB1IPAddress=${params.eNB1_IPAddress} --eNB1UserName=${eNB1_Username} --eNB1Password=${eNB1_Password} --eNB1SourceCodePath=${params.eNB1_SourceCodePath} --eNB2IPAddress=${params.eNB2_IPAddress} --eNB2UserName=${eNB2_Username} --eNB2Password=${eNB2_Password} --eNB2SourceCodePath=${params.eNB2_SourceCodePath} --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath} --XMLTestFile=${xmlFile}" } } catch (Exception e) { currentBuild.result = 'FAILURE' @@ -303,55 +289,6 @@ pipeline { } } } - stage('Log Collection (CN)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - script { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - if (params.EPC_Type != 'OAICN5G') { - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true" - } - echo '\u2705 \u001B[32mLog Collection (MME or AMF)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - if (params.EPC_Type == 'OAICN5G') { - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./amf.log.${env.BUILD_ID}.zip || true" - } else { - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true" - } - echo '\u2705 \u001B[32mLog Collection (SPGW or SMF/UPF)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - if (params.EPC_Type == 'OAICN5G') { - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./smf-upf.log.${env.BUILD_ID}.zip || true" - } else { - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true" - } - } - if(fileExists("hss.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "hss.log.${env.BUILD_ID}.zip" - } - if(fileExists("mme.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "mme.log.${env.BUILD_ID}.zip" - } - if(fileExists("spgw.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "spgw.log.${env.BUILD_ID}.zip" - } - if(fileExists("amf.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "amf.log.${env.BUILD_ID}.zip" - } - if(fileExists("smf-upf.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "smf-upf.log.${env.BUILD_ID}.zip" - } - echo '\u2705 \u001B[32mLog Collection for CoreNetwork Done!\u001B[0m' - } - } - } } } } diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index 89f3735b9e..03c0f9a0cb 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -137,19 +137,6 @@ pipeline { } } - if (params.EPC_IPAddress == null) { - allParametersPresent = false - } - if (params.EPC_Type == null) { - allParametersPresent = false - } - if (params.EPC_SourceCodePath == null) { - allParametersPresent = false - } - if (params.EPC_Credentials == null) { - allParametersPresent = false - } - if (params.Flexric_Tag != null) { echo "This pipeline is configured to run with a FlexRIC deployment." echo "Appending FlexRicTag option to the list of options" @@ -196,7 +183,6 @@ pipeline { } withCredentials([ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'], - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'], ]) { sh "python3 main.py --mode=InitiateHtml --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${flexricOption} ${mainPythonAllXmlFiles}" String[] myXmlTestSuite = testXMLFile.split("\\r?\\n") @@ -204,7 +190,7 @@ pipeline { if (fileExists(xmlFile)) { try { timeout (time: 60, unit: 'MINUTES') { - sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${flexricOption} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --XMLTestFile=${xmlFile}" + sh "python3 main.py --mode=TesteNB --ranRepository=${eNB_Repository} --ranBranch=${eNB_Branch} --ranCommitID=${eNB_CommitID} --ranAllowMerge=${eNB_AllowMergeRequestProcess} --ranTargetBranch=${eNB_TargetBranch} ${flexricOption} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --XMLTestFile=${xmlFile}" } } catch (Exception e) { currentBuild.result = 'FAILURE' @@ -237,69 +223,6 @@ pipeline { } } } - stage('Terminate SPGW') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - echo '\u2705 \u001B[32mTerminate SPGW\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - post { - success { - script { - termStatusArray[termSPGW] = true - } - } - } - } - stage('Terminate MME') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - echo '\u2705 \u001B[32mTerminate MME\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - post { - success { - script { - termStatusArray[termMME] = true - } - } - } - } - stage('Terminate HSS') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - echo '\u2705 \u001B[32mTerminate HSS\u001B[0m' - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - post { - success { - script { - termStatusArray[termHSS] = true - } - } - } - } } } stage('Log Collection') { @@ -345,72 +268,6 @@ pipeline { } } } - stage('Log Collection (SPGW)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (SPGW)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (SPGW)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("spgw.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "spgw.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (MME)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (MME)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (MME)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("mme.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "mme.log.${env.BUILD_ID}.zip" - } - } - } - } - stage('Log Collection (HSS)') { - // Bypassing this stage if EPC server is not defined - when { - expression { params.EPC_IPAddress != "none" } - } - steps { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m' - sh "python3 ci-scripts/main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}" - - echo '\u2705 \u001B[32mLog Transfer (HSS)\u001B[0m' - sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true" - } - script { - if(fileExists("hss.log.${env.BUILD_ID}.zip")) { - archiveArtifacts "hss.log.${env.BUILD_ID}.zip" - } - } - } - } } } } @@ -440,27 +297,6 @@ pipeline { sh "python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" } } - if ((!termStatusArray[termSPGW]) && (params.EPC_IPAddress != "none")) { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - if ((!termStatusArray[termMME]) && (params.EPC_IPAddress != "none")) { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } - if ((!termStatusArray[termHSS]) && (params.EPC_IPAddress != "none")) { - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] - ]) { - sh "python3 ci-scripts/main.py --mode=TerminateHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" - } - } } } } From 1037f4ddd988ff740aaf2941adb3aec6f9b2e999 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Nov 2024 18:48:28 +0100 Subject: [PATCH 31/35] Remove epc.py and use from python files All core networks have been migrated to a file-based configuration. References to epc.py are not needed anymore. Remove all unused XML steps. --- ci-scripts/args_parse.py | 27 +- ci-scripts/epc.py | 321 ------------------ ci-scripts/helpreadme.py | 7 - ci-scripts/main.py | 85 +---- ci-scripts/run_locally.sh | 4 +- ci-scripts/tests/test-runner/run.sh | 5 - ci-scripts/xml_class_list.yml | 12 - .../xml_files/test_case_list_template.xml | 32 -- 8 files changed, 16 insertions(+), 477 deletions(-) delete mode 100644 ci-scripts/epc.py diff --git a/ci-scripts/args_parse.py b/ci-scripts/args_parse.py index cbf4159da2..abf8f57a41 100644 --- a/ci-scripts/args_parse.py +++ b/ci-scripts/args_parse.py @@ -41,7 +41,7 @@ import constants as CONST #----------------------------------------------------------- -def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): +def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): py_param_file_present = False @@ -192,7 +192,6 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): SCA.eNBSourceCodePath=matchReg.group(1) PHYSIM.eNBSourceCodePath=matchReg.group(1) CLUSTER.eNBSourceCodePath=matchReg.group(1) - EPC.eNBSourceCodePath=matchReg.group(1) elif re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE) RAN.eNB1SourceCodePath=matchReg.group(1) @@ -202,26 +201,17 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): RAN.eNB2SourceCodePath=matchReg.group(1) CONTAINERS.eNB2SourceCodePath=matchReg.group(1) elif re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE) - EPC.IPAddress=matchReg.group(1) + print("parameter --EPCIPAddress ignored") elif re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE) - EPC.UserName=matchReg.group(1) + print("parameter --EPCUserName ignored") elif re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE) - EPC.Password=matchReg.group(1) + print("parameter --EPCPassword ignored") elif re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE) - EPC.SourceCodePath=matchReg.group(1) + print("parameter --EPCSourceCodePath ignored") elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE) - if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-Docker', matchReg.group(1), re.IGNORECASE) or re.match('OC-OAI-CN5G', matchReg.group(1), re.IGNORECASE): - EPC.Type=matchReg.group(1) - else: - sys.exit('Invalid EPC Type: ' + matchReg.group(1) + ' -- (should be OAI or ltebox or OAI-Rel14-Docker or OC-OAI-CN5G)') + print("parameter --EPCType ignored") elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE) - EPC.ContainerPrefix=matchReg.group(1) + print("parameter --EPCContainerPrefix ignored") elif re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE) CiTestObj.testXMLfiles.append(matchReg.group(1)) @@ -248,17 +238,14 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,EPC,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): matchReg = re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE) PHYSIM.OCUserName = matchReg.group(1) CLUSTER.OCUserName = matchReg.group(1) - EPC.OCUserName = matchReg.group(1) elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE) PHYSIM.OCPassword = matchReg.group(1) CLUSTER.OCPassword = matchReg.group(1) - EPC.OCPassword = matchReg.group(1) elif re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE) PHYSIM.OCProjectName = matchReg.group(1) CLUSTER.OCProjectName = matchReg.group(1) - EPC.OCProjectName = matchReg.group(1) elif re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE) CLUSTER.OCUrl = matchReg.group(1) diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py deleted file mode 100644 index c095761cd0..0000000000 --- a/ci-scripts/epc.py +++ /dev/null @@ -1,321 +0,0 @@ -#/* -# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more -# * contributor license agreements. See the NOTICE file distributed with -# * this work for additional information regarding copyright ownership. -# * The OpenAirInterface Software Alliance licenses this file to You under -# * the OAI Public License, Version 1.1 (the "License"); you may not use this file -# * except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.openairinterface.org/?page_id=698 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# *------------------------------------------------------------------------------- -# * For more information about the OpenAirInterface (OAI) Software Alliance: -# * contact@openairinterface.org -# */ -#--------------------------------------------------------------------- -# Python for CI of OAI-eNB + COTS-UE -# -# Required Python Version -# Python 3.x -# -# Required Python Package -# pexpect -#--------------------------------------------------------------------- - -#----------------------------------------------------------- -# Import -#----------------------------------------------------------- -import sys # arg -import re # reg -import logging -import os -import time -import signal - -#----------------------------------------------------------- -# OAI Testing modules -#----------------------------------------------------------- -import sshconnection as SSH -import helpreadme as HELP -import constants as CONST -import cls_cluster as OC -import cls_cmd -import cls_module -#----------------------------------------------------------- -# Class Declaration -#----------------------------------------------------------- - - -class EPCManagement(): - - def __init__(self): - - self.IPAddress = '' - self.UserName = '' - self.Password = '' - self.SourceCodePath = '' - self.Type = '' - self.PcapFileName = '' - self.testCase_id = '' - self.MmeIPAddress = '' - self.containerPrefix = 'prod' - self.mmeConfFile = 'mme.conf' - self.yamlPath = '' - self.isMagmaUsed = False - self.cfgDeploy = '--type start-mini --scenario 1 --capture /tmp/oai-cn5g-v1.5.pcap' #from xml, 'mini' is default normal for docker-network.py - self.cfgUnDeploy = '--type stop-mini --scenario 1' #from xml, 'mini' is default normal for docker-network.py - self.OCUrl = "https://api.oai.cs.eurecom.fr:6443" - self.OCRegistry = "default-route-openshift-image-registry.apps.oai.cs.eurecom.fr" - self.OCUserName = '' - self.OCPassword = '' - self.cnID = '' - self.imageToPull = '' - self.eNBSourceCodePath = '' - -#----------------------------------------------------------- -# EPC management functions -#----------------------------------------------------------- - - def InitializeHSS(self, HTML): - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': - HELP.GenericHelp(CONST.Version) - HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) - sys.exit('Insufficient EPC Parameters') - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('OAI', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() - HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) - return True - - def InitializeMME(self, HTML): - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': - HELP.GenericHelp(CONST.Version) - HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) - sys.exit('Insufficient EPC Parameters') - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('OAI', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() - HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) - return True - - def SetMmeIPAddress(self): - # Not an error if we don't need an EPC - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': - return - if self.IPAddress == 'none': - return - # Only in case of Docker containers, MME IP address is not the EPC HOST IP address - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - self.MmeIPAddress = self.IPAddress - - def InitializeSPGW(self, HTML): - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': - HELP.GenericHelp(CONST.Version) - HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.SourceCodePath, self.Type) - sys.exit('Insufficient EPC Parameters') - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('OAI', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() - HTML.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) - return True - - def Initialize5GCN(self, HTML): - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.Type == '': - HELP.GenericHelp(CONST.Version) - HELP.EPCSrvHelp(self.IPAddress, self.UserName, self.Password, self.Type) - logging.error('Insufficient EPC Parameters') - return False - mySSH = cls_cmd.getConnection(self.IPAddress) - html_cell = '' - if re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAICN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() - HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [html_cell]) - return True - - def SetAmfIPAddress(self): - # Not an error if we don't need an 5GCN - if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': - return - if self.IPAddress == 'none': - return - if re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAICN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - - def TerminateHSS(self, HTML): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('OAI', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This should not happen!') - mySSH.close() - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - return True - - def TerminateMME(self, HTML): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This should not happen!') - mySSH.close() - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - return True - - def TerminateSPGW(self, HTML): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('OAI', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This should not happen!') - mySSH.close() - HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - return True - - def Terminate5GCN(self, HTML): - mySSH = cls_cmd.getConnection(self.IPAddress) - message = '' - if re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAICN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This should not happen!') - mySSH.close() - HTML.CreateHtmlTestRowQueue(self.Type, 'OK', [message]) - return True - - def DeployEpc(self, HTML): - raise NotImplemented("use cls_corenetwork.py") - - def UndeployEpc(self, HTML): - raise NotImplemented("use cls_corenetwork.py") - - def LogCollectHSS(self): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('rm -f hss.log.zip', '\$', 5) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAICN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() - - def LogCollectMME(self): - if self.Type != 'OC-OAI-CN5G': - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('rm -f mme.log.zip', '\$', 5) - else: - mySSH = cls_cmd.getConnection(self.IPAddress) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAICN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() - - def LogCollectSPGW(self): - mySSH = SSH.SSHConnection() - mySSH.open(self.IPAddress, self.UserName, self.Password) - mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('rm -f spgw.log.zip', '\$', 5) - if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAICN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OC-OAI-CN5G', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): - raise NotImplemented("core network not supported") - elif re.match('ltebox', self.Type, re.IGNORECASE): - raise NotImplemented("use cls_corenetwork.py") - else: - logging.error('This option should not occur!') - mySSH.close() diff --git a/ci-scripts/helpreadme.py b/ci-scripts/helpreadme.py index 7c1582e151..6f192acd9c 100644 --- a/ci-scripts/helpreadme.py +++ b/ci-scripts/helpreadme.py @@ -64,13 +64,6 @@ def OAIUESrvHelp(ipaddr, username, password, sourcepath): print(' --UEPassword=[UE\'s Login Password] -- ' + password) print(' --UESourceCodePath=[UE\'s Source Code Path] -- ' + sourcepath) -def EPCSrvHelp(ipaddr, username, password, sourcepath, epctype): - print(' --EPCIPAddress=[EPC\'s IP Address] -- ' + ipaddr) - print(' --EPCUserName=[EPC\'s Login User Name] -- ' + username) - print(' --EPCPassword=[EPC\'s Login Password] -- ' + password) - print(' --EPCSourceCodePath=[EPC\'s Source Code Path] -- ' + sourcepath) - print(' --EPCType=[EPC\'s Type: OAI or ltebox or OC-OAI-CN5G] -- ' + epctype) - def XmlHelp(filename): print(' --XMLTestFile=[XML Test File to be run] -- ' + filename) print(' Note: multiple xml files can be specified (--XMLFile=File1 ... --XMLTestFile=FileN) when HTML headers are created ("InitiateHtml" mode)') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index d9523c0c00..72376d9a70 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -45,7 +45,6 @@ import cls_physim1 #class PhySim for physical simulators deploy and run import cls_cluster # class for building/deploying on cluster import cls_native # class for all native/source-based operations -import epc import ran import cls_oai_html @@ -94,7 +93,6 @@ def AssignParams(params_dict): setattr(HTML, key, value) def ExecuteActionWithParam(action): - global EPC global RAN global HTML global CONTAINERS @@ -299,48 +297,6 @@ def ExecuteActionWithParam(action): elif action == 'Deploy_Run_PhySim': success = PHYSIM.Deploy_PhySim(HTML) - elif action == 'Initialize_MME': - string_field = test.findtext('option') - if (string_field is not None): - EPC.mmeConfFile = string_field - success = EPC.InitializeMME(HTML) - - elif action == 'Initialize_HSS' or action == 'Initialize_SPGW': - if action == 'Initialize_HSS': - success = EPC.InitializeHSS(HTML) - elif action == 'Initialize_SPGW': - success = EPC.InitializeSPGW(HTML) - elif action == 'Terminate_HSS' or action == 'Terminate_MME' or action == 'Terminate_SPGW': - if action == 'Terminate_HSS': - success = EPC.TerminateHSS(HTML) - elif action == 'Terminate_MME': - success = EPC.TerminateMME(HTML) - elif action == 'Terminate_SPGW': - success = EPC.TerminateSPGW(HTML) - - elif action == 'Deploy_EPC': - string_field = test.findtext('parameters') - if (string_field is not None): - EPC.yamlPath = string_field - success = EPC.DeployEpc(HTML) - - elif action == 'Undeploy_EPC': - success = EPC.UndeployEpc(HTML) - - elif action == 'Initialize_5GCN': - string_field = test.findtext('args') - if (string_field is not None): - EPC.cfgDeploy = string_field - EPC.cnID = test.findtext('cn_id') - success = EPC.Initialize5GCN(HTML) - - elif action == 'Terminate_5GCN': - string_field = test.findtext('args') - if (string_field is not None): - EPC.cfgUnDeploy = string_field - EPC.cnID = test.findtext('cn_id') - success = EPC.Terminate5GCN(HTML) - elif action == 'DeployCoreNetwork' or action == 'UndeployCoreNetwork': cn_id = test.findtext('cn_id') core_op = getattr(cls_oaicitest.OaiCiTest, action) @@ -479,7 +435,6 @@ mode = '' CiTestObj = cls_oaicitest.OaiCiTest() -EPC = epc.EPCManagement() RAN = ran.RANManagement() HTML = cls_oai_html.HTMLManagement() CONTAINERS = cls_containerize.Containerize() @@ -494,7 +449,7 @@ CLUSTER = cls_cluster.Cluster() import args_parse # Force local execution, move all execution targets to localhost force_local = False -py_param_file_present, py_params, mode, force_local = args_parse.ArgsParse(sys.argv,CiTestObj,RAN,HTML,EPC,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER) +py_param_file_present, py_params, mode, force_local = args_parse.ArgsParse(sys.argv,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER) @@ -521,20 +476,11 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): RAN.eNBSourceCodePath='/tmp/' RAN.TerminateeNB(HTML) elif re.match('^TerminateHSS$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - EPC.TerminateHSS(HTML) + logging.warning("Option TerminateHSS ignored") elif re.match('^TerminateMME$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - EPC.TerminateMME(HTML) + logging.warning("Option TerminateMME ignored") elif re.match('^TerminateSPGW$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath== '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - EPC.TerminateSPGW(HTML) + logging.warning("Option TerminateSPGW ignored") elif re.match('^LogCollectBuild$', mode, re.IGNORECASE): if (RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '') and (CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == ''): HELP.GenericHelp(CONST.Version) @@ -557,20 +503,11 @@ elif re.match('^LogCollecteNB$', mode, re.IGNORECASE): sys.exit(0) RAN.LogCollecteNB() elif re.match('^LogCollectHSS$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - EPC.LogCollectHSS() + logging.warning("Option LogCollectHSS ignored") elif re.match('^LogCollectMME$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - EPC.LogCollectMME() + logging.warning("Option LogCollectMME ignored") elif re.match('^LogCollectSPGW$', mode, re.IGNORECASE): - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': - HELP.GenericHelp(CONST.Version) - sys.exit('Insufficient Parameter') - EPC.LogCollectSPGW() + logging.warning("Option LogCollectSPGW ignored") elif re.match('^LogCollectPing$', mode, re.IGNORECASE): logging.warning("Option LogCollectPing ignored") elif re.match('^LogCollectIperf$', mode, re.IGNORECASE): @@ -609,10 +546,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re logging.info('\u001B[1m Starting Scenario: ' + CiTestObj.testXMLfiles[0] + '\u001B[0m') logging.info('\u001B[1m----------------------------------------\u001B[0m') if re.match('^TesteNB$', mode, re.IGNORECASE): - if RAN.eNBIPAddress == '' or RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '' or EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': + if RAN.eNBIPAddress == '' or RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '': HELP.GenericHelp(CONST.Version) - if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.SourceCodePath == '' or EPC.Type == '': - HELP.EPCSrvHelp(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath, EPC.Type) if RAN.ranRepository == '': HELP.GitSrvHelp(RAN.ranRepository, RAN.ranBranch, RAN.ranCommitID, RAN.ranAllowMerge, RAN.ranTargetBranch) if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '': @@ -663,9 +598,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re else: logging.error('requested test is invalidly formatted: ' + test) sys.exit(1) - if (EPC.IPAddress != '') and (EPC.IPAddress != 'none'): - EPC.SetMmeIPAddress() - EPC.SetAmfIPAddress() #get the list of tests to be done todo_tests=[] @@ -690,7 +622,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re continue CiTestObj.testCase_id = id HTML.testCase_id=CiTestObj.testCase_id - EPC.testCase_id=CiTestObj.testCase_id CiTestObj.desc = test.findtext('desc') always_exec = test.findtext('always_exec') in ['True', 'true', 'Yes', 'yes'] HTML.desc=CiTestObj.desc diff --git a/ci-scripts/run_locally.sh b/ci-scripts/run_locally.sh index c8e9a289f0..60010ea30a 100755 --- a/ci-scripts/run_locally.sh +++ b/ci-scripts/run_locally.sh @@ -29,7 +29,5 @@ docker tag oai-gnb oai-ci/oai-gnb:develop-${SHORT_COMMIT_SHA} python3 main.py --mode=TesteNB --ranRepository=NONE --ranBranch=${CURRENT_BRANCH} \ --ranCommitID=${COMMIT_SHA} --ranAllowMerge=false \ --ranTargetBranch=NONE --eNBIPAddress=NONE --eNBUserName=NONE --eNBPassword=NONE \ - --eNBSourceCodePath=NONE --EPCIPAddress=NONE --EPCType=OAI --eNBPassword=NONE \ - --eNBSourceCodePath=${REPO_PATH} --EPCIPAddress=NONE \ - --EPCUserName=NONE --EPCPassword=NONE --EPCSourceCodePath=NONE \ + --eNBSourceCodePath=${REPO_PATH} \ --XMLTestFile=xml_files/${TESTCASE} --local diff --git a/ci-scripts/tests/test-runner/run.sh b/ci-scripts/tests/test-runner/run.sh index 40d0289453..808bc563a7 100755 --- a/ci-scripts/tests/test-runner/run.sh +++ b/ci-scripts/tests/test-runner/run.sh @@ -30,11 +30,6 @@ python3 main.py \ --UEUserName=NONE \ --UEPassword=NONE \ --UESourceCodePath=NONE \ - --EPCIPAddress=localhost \ - --EPCType=OAI \ - --EPCUserName=NONE \ - --EPCPassword=NONE \ - --EPCSourceCodePath=NONE \ --XMLTestFile=tests/test-runner/test.xml python3 main.py \ diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index 5ad4c0820e..211e02d4c1 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -15,16 +15,6 @@ - Ping - Iperf - Iperf2_Unidir - - Deploy_EPC - - Undeploy_EPC - - Initialize_HSS - - Terminate_HSS - - Initialize_MME - - Terminate_MME - - Initialize_SPGW - - Terminate_SPGW - - Initialize_5GCN - - Terminate_5GCN - DeployCoreNetwork - UndeployCoreNetwork - IdleSleep @@ -34,8 +24,6 @@ - Undeploy_Object - Cppcheck_Analysis - Deploy_Run_PhySim - - DeployGenObject - - UndeployGenObject - LicenceAndFormattingCheck - Push_Local_Registry - Pull_Local_Registry diff --git a/ci-scripts/xml_files/test_case_list_template.xml b/ci-scripts/xml_files/test_case_list_template.xml index fddf8ad0e4..bcc8f94c09 100644 --- a/ci-scripts/xml_files/test_case_list_template.xml +++ b/ci-scripts/xml_files/test_case_list_template.xml @@ -102,36 +102,4 @@ Detach UE - - - - Initialize_HSS - Initialize HSS - - - - Terminate_HSS - Terminate HSS - - - - Initialize_MME - Initialize MME - - - - Terminate_MME - Terminate MME - - - - Initialize_SPGW - Initialize SPGW - - - - Terminate_SPGW - Terminate SPGW - - From 000ae3dfad1710de5a24633a85612a62fe664e81 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 21 Mar 2025 17:04:25 +0100 Subject: [PATCH 32/35] Fix invalid escape sequence errors in cls_oaicitest.py In all these cases, we have a regex whose escape sequences are not to be evaluated in the string, but given verbatim to the regex engine. Hence, mark them as raw strings. ci-scripts/cls_oaicitest.py:55: SyntaxWarning: invalid escape sequence '\s' result = re.search('-b\s*(?P[0-9\.]+)(?P[KMG])', str(args)) ci-scripts/cls_oaicitest.py:81: SyntaxWarning: invalid escape sequence '\s' result = re.search('-t\s*(?P\d+)', str(args)) ci-scripts/cls_oaicitest.py:373: SyntaxWarning: invalid escape sequence '\d' ping_time = re.findall("-c *(\d+)",str(self.ping_args)) ci-scripts/cls_oaicitest.py:404: SyntaxWarning: invalid escape sequence '\.' result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) ci-scripts/cls_oaicitest.py:409: SyntaxWarning: invalid escape sequence '\/' result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', ping_output) ci-scripts/cls_oaicitest.py:691: SyntaxWarning: invalid escape sequence '\d' result = re.search("MIB Information => ([a-zA-Z]{1,10}), ([a-zA-Z]{1,10}), NidCell (?P\d{1,3}), N_RB_DL (?P\d{1,3}), PHICH DURATION (?P\d), PHICH RESOURCE (?P.{1,4}), TX_ANT (?P\d)", str(line)) ci-scripts/cls_oaicitest.py:724: SyntaxWarning: invalid escape sequence '\d' result = re.search("PLMN MCC (?P\d{1,3}), MNC (?P\d{1,3}), TAC", str(line)) ci-scripts/cls_oaicitest.py:733: SyntaxWarning: invalid escape sequence '\w' result = re.search("Found (?P[\w,\s]{1,15}) \(name from internal table\)", str(line)) ci-scripts/cls_oaicitest.py:749: SyntaxWarning: invalid escape sequence '\-' result = re.search("DL Carrier Frequency/ARFCN : \-*(?P\d{1,15}/\d{1,4})", str(line)) ci-scripts/cls_oaicitest.py:759: SyntaxWarning: invalid escape sequence '\d' result = re.search("AllowedMeasBandwidth : (?P\d{1,7})", str(line)) --- ci-scripts/cls_oaicitest.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index c01587688a..038449870d 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -52,7 +52,7 @@ import cls_cmd # Helper functions used here and in other classes #----------------------------------------------------------- def Iperf_ComputeModifiedBW(idx, ue_num, profile, args): - result = re.search('-b\s*(?P[0-9\.]+)(?P[KMG])', str(args)) + result = re.search(r'-b\s*(?P[0-9\.]+)(?P[KMG])', str(args)) if result is None: raise ValueError(f'requested iperf bandwidth not found in iperf options "{args}"') iperf_bandwidth = float(result.group('iperf_bandwidth')) @@ -78,7 +78,7 @@ def Iperf_ComputeModifiedBW(idx, ue_num, profile, args): return iperf_bandwidth_new, args_new def Iperf_ComputeTime(args): - result = re.search('-t\s*(?P\d+)', str(args)) + result = re.search(r'-t\s*(?P\d+)', str(args)) if result is None: raise Exception('Iperf time not found!') return int(result.group('iperf_time')) @@ -372,7 +372,7 @@ class OaiCiTest(): if not svrIP: return (False, f"CN {cn.getName()} has no IP address") ping_log_file = f'ping_{self.testCase_id}_{ue.getName()}.log' - ping_time = re.findall("-c *(\d+)",str(self.ping_args)) + ping_time = re.findall(r"-c *(\d+)",str(self.ping_args)) local_ping_log_file = f'{logPath}/{ping_log_file}' if re.search('%cn_ip%', self.ping_args) or re.search(r'[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', self.ping_args): raise Exception(f"ping_args should not have IP address: {self.ping_args}") @@ -391,12 +391,12 @@ class OaiCiTest(): with open(local_ping_log_file, 'r') as f: ping_output = "".join(f.readlines()) - result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) + result = re.search(r', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', ping_output) if result is None: message = ue_header + ': Packet Loss Not Found!' return (False, message) packetloss = result.group('packetloss') - result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', ping_output) + result = re.search(r'rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', ping_output) if result is None: message = ue_header + ': Ping RTT_Min RTT_Avg RTT_Max Not Found!' return (False, message) @@ -678,7 +678,7 @@ class OaiCiTest(): result = re.search('TRIED TO PUSH MBMS DATA', str(line)) if result is not None: mbms_messages += 1 - result = re.search("MIB Information => ([a-zA-Z]{1,10}), ([a-zA-Z]{1,10}), NidCell (?P\d{1,3}), N_RB_DL (?P\d{1,3}), PHICH DURATION (?P\d), PHICH RESOURCE (?P.{1,4}), TX_ANT (?P\d)", str(line)) + result = re.search(r"MIB Information => ([a-zA-Z]{1,10}), ([a-zA-Z]{1,10}), NidCell (?P\d{1,3}), N_RB_DL (?P\d{1,3}), PHICH DURATION (?P\d), PHICH RESOURCE (?P.{1,4}), TX_ANT (?P\d)", str(line)) if result is not None and (not mib_found): try: mibMsg = "MIB Information: " + result.group(1) + ', ' + result.group(2) @@ -711,7 +711,7 @@ class OaiCiTest(): frequency_found = True except Exception as e: logging.error(f'\033[91m UE did not find PBCH\033[0m') - result = re.search("PLMN MCC (?P\d{1,3}), MNC (?P\d{1,3}), TAC", str(line)) + result = re.search(r"PLMN MCC (?P\d{1,3}), MNC (?P\d{1,3}), TAC", str(line)) if result is not None and (not plmn_found): try: mibMsg = f"PLMN MCC = {result.group('mcc')} MNC = {result.group('mnc')}" @@ -720,7 +720,7 @@ class OaiCiTest(): plmn_found = True except Exception as e: logging.error(f'\033[91m PLMN not found \033[0m') - result = re.search("Found (?P[\w,\s]{1,15}) \(name from internal table\)", str(line)) + result = re.search(r"Found (?P[\w,\s]{1,15}) \(name from internal table\)", str(line)) if result is not None: try: mibMsg = f"The operator is: {result.group('operator')}" @@ -736,7 +736,7 @@ class OaiCiTest(): logging.debug(f'\033[94m{mibMsg}\033[0m') except Exception as e: logging.error(f'\033[91m SIB5 InterFreqCarrierFreq element not found \033[0m') - result = re.search("DL Carrier Frequency/ARFCN : \-*(?P\d{1,15}/\d{1,4})", str(line)) + result = re.search(r"DL Carrier Frequency/ARFCN : \-*(?P\d{1,15}/\d{1,4})", str(line)) if result is not None: try: freq = result.group('carrier_frequency') @@ -746,7 +746,7 @@ class OaiCiTest(): logging.debug(f'\033[94m DL Carrier Frequency is: {freq}\033[0m') except Exception as e: logging.error(f'\033[91m DL Carrier Frequency not found \033[0m') - result = re.search("AllowedMeasBandwidth : (?P\d{1,7})", str(line)) + result = re.search(r"AllowedMeasBandwidth : (?P\d{1,7})", str(line)) if result is not None: try: prb = result.group('allowed_bandwidth') From 87f0f64fe770ddd91a116af5167563c1fb88952d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Mar 2025 16:55:43 +0100 Subject: [PATCH 33/35] Fix invalid escape sequence errors in cls_module.py As parent. The second change has no escape sequence, but since it's also a regex, mark it as raw for uniformity (it doesn't hurt either). ci-scripts/cls_module.py:165: SyntaxWarning: invalid escape sequence '\.' result = re.search('inet (?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output.stdout) --- ci-scripts/cls_module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_module.py b/ci-scripts/cls_module.py index 4eadddf686..3ec6ffc9e5 100644 --- a/ci-scripts/cls_module.py +++ b/ci-scripts/cls_module.py @@ -162,7 +162,7 @@ class Module_UE: def getIP(self): output = self._command(self.cmd_dict["getNetwork"], silent=True) - result = re.search('inet (?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output.stdout) + result = re.search(r'inet (?P[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output.stdout) if result and result.group('ip'): ip = result.group('ip') return ip @@ -170,7 +170,7 @@ class Module_UE: def checkMTU(self): output = self._command(self.cmd_dict["getNetwork"], silent=True) - result = re.search('mtu (?P[0-9]+)', output.stdout) + result = re.search(r'mtu (?P[0-9]+)', output.stdout) if result and result.group('mtu') and int(result.group('mtu')) == self.MTU: logging.debug(f'\u001B[1mUE Module {self.module_name} NIC MTU is {self.MTU} as expected\u001B[0m') return True From 1fa0b501c64697d25f875dbfcba5453368b04d95 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 25 Mar 2025 11:38:56 +0100 Subject: [PATCH 34/35] Fix invalid escape sequence errors in args_parse.py As parent. Fix these warnings: /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:55: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-help$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:58: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-local$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:63: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-Apply=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:64: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-Apply=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:74: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:75: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:77: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBRepository=(.+)$|^\-\-ranRepository(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:78: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:79: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:81: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:89: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:90: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:91: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:93: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:103: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:104: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:105: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:107: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:115: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:116: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:117: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:119: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:127: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:128: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:129: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:131: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:139: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:140: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:141: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:147: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:148: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:151: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:152: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:155: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBUserName=(.+)$|^\-\-eNB[1-2]UserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:156: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:157: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:163: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:164: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:167: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:168: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:171: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBPassword=(.+)$|^\-\-eNB[1-2]Password=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:172: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:173: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:179: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:180: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:183: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:184: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:187: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNBSourceCodePath=(.+)$|^\-\-eNB[1-2]SourceCodePath=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:188: SyntaxWarning: invalid escape sequence '\-' if re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:189: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:195: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:196: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:199: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:200: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:203: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:205: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:207: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:209: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:211: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:213: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:215: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:216: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:220: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:221: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:223: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:224: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:226: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:227: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:229: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:230: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:232: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:233: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:237: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:238: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:241: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:242: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:245: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:246: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:249: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:250: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:252: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-OCRegistry=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:253: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-OCRegistry=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:255: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-BuildId=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:256: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-BuildId=(.+)$', myArgv, re.IGNORECASE) /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:258: SyntaxWarning: invalid escape sequence '\-' elif re.match('^\-\-FlexRicTag=(.+)$', myArgv, re.IGNORECASE): /home/richie/w/ci-refactor-core-handling/ci-scripts/args_parse.py:259: SyntaxWarning: invalid escape sequence '\-' matchReg = re.match('^\-\-FlexRicTag=(.+)$', myArgv, re.IGNORECASE) --- ci-scripts/args_parse.py | 172 +++++++++++++++++++-------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/ci-scripts/args_parse.py b/ci-scripts/args_parse.py index abf8f57a41..4bb999bd9d 100644 --- a/ci-scripts/args_parse.py +++ b/ci-scripts/args_parse.py @@ -52,16 +52,16 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): myArgv = argvs.pop(1) # 0th is this file's name #--help - if re.match('^\-\-help$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-help$', myArgv, re.IGNORECASE): HELP.GenericHelp(CONST.Version) sys.exit(0) - if re.match('^\-\-local$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-local$', myArgv, re.IGNORECASE): force_local = True #--apply= as parameters file, to replace inline parameters - elif re.match('^\-\-Apply=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-Apply=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-Apply=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-Apply=(.+)$', myArgv, re.IGNORECASE) py_params_file = matchReg.group(1) with open(py_params_file,'r') as file: # The FullLoader parameter handles the conversion from YAML @@ -71,14 +71,14 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): #AssignParams(py_params) #to be uncommented once validated #consider inline parameters - elif re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-mode=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-mode=(.+)$', myArgv, re.IGNORECASE) mode = matchReg.group(1) - elif re.match('^\-\-eNBRepository=(.+)$|^\-\-ranRepository(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBRepository=(.+)$|^\-\-ranRepository(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBRepository=(.+)$', myArgv, re.IGNORECASE) else: - matchReg = re.match('^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE) + matchReg = re.match(r'^\-\-ranRepository=(.+)$', myArgv, re.IGNORECASE) CiTestObj.ranRepository = matchReg.group(1) RAN.ranRepository=matchReg.group(1) HTML.ranRepository=matchReg.group(1) @@ -86,11 +86,11 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): SCA.ranRepository=matchReg.group(1) PHYSIM.ranRepository=matchReg.group(1) CLUSTER.ranRepository=matchReg.group(1) - elif re.match('^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB_AllowMerge=(.+)$|^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB_AllowMerge=(.+)$', myArgv, re.IGNORECASE) else: - matchReg = re.match('^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE) + matchReg = re.match(r'^\-\-ranAllowMerge=(.+)$', myArgv, re.IGNORECASE) doMerge = matchReg.group(1) if ((doMerge == 'true') or (doMerge == 'True')): CiTestObj.ranAllowMerge = True @@ -100,11 +100,11 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): SCA.ranAllowMerge=True PHYSIM.ranAllowMerge=True CLUSTER.ranAllowMerge=True - elif re.match('^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBBranch=(.+)$|^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBBranch=(.+)$', myArgv, re.IGNORECASE) else: - matchReg = re.match('^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE) + matchReg = re.match(r'^\-\-ranBranch=(.+)$', myArgv, re.IGNORECASE) CiTestObj.ranBranch = matchReg.group(1) RAN.ranBranch=matchReg.group(1) HTML.ranBranch=matchReg.group(1) @@ -112,11 +112,11 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): SCA.ranBranch=matchReg.group(1) PHYSIM.ranBranch=matchReg.group(1) CLUSTER.ranBranch=matchReg.group(1) - elif re.match('^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBCommitID=(.*)$|^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBCommitID=(.*)$', myArgv, re.IGNORECASE) else: - matchReg = re.match('^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE) + matchReg = re.match(r'^\-\-ranCommitID=(.*)$', myArgv, re.IGNORECASE) CiTestObj.ranCommitID = matchReg.group(1) RAN.ranCommitID=matchReg.group(1) HTML.ranCommitID=matchReg.group(1) @@ -124,11 +124,11 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): SCA.ranCommitID=matchReg.group(1) PHYSIM.ranCommitID=matchReg.group(1) CLUSTER.ranCommitID=matchReg.group(1) - elif re.match('^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBTargetBranch=(.*)$|^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBTargetBranch=(.*)$', myArgv, re.IGNORECASE) else: - matchReg = re.match('^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE) + matchReg = re.match(r'^\-\-ranTargetBranch=(.*)$', myArgv, re.IGNORECASE) CiTestObj.ranTargetBranch = matchReg.group(1) RAN.ranTargetBranch=matchReg.group(1) HTML.ranTargetBranch=matchReg.group(1) @@ -136,127 +136,127 @@ def ArgsParse(argvs,CiTestObj,RAN,HTML,CONTAINERS,HELP,SCA,PHYSIM,CLUSTER): SCA.ranTargetBranch=matchReg.group(1) PHYSIM.ranTargetBranch=matchReg.group(1) CLUSTER.ranTargetBranch=matchReg.group(1) - elif re.match('^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBIPAddress=(.+)$|^\-\-eNB[1-2]IPAddress=(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE) RAN.eNBIPAddress=matchReg.group(1) CONTAINERS.eNBIPAddress=matchReg.group(1) SCA.eNBIPAddress=matchReg.group(1) PHYSIM.eNBIPAddress=matchReg.group(1) CLUSTER.eNBIPAddress=matchReg.group(1) - elif re.match('^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB1IPAddress=(.+)$', myArgv, re.IGNORECASE) RAN.eNB1IPAddress=matchReg.group(1) CONTAINERS.eNB1IPAddress=matchReg.group(1) - elif re.match('^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB2IPAddress=(.+)$', myArgv, re.IGNORECASE) RAN.eNB2IPAddress=matchReg.group(1) CONTAINERS.eNB2IPAddress=matchReg.group(1) - elif re.match('^\-\-eNBUserName=(.+)$|^\-\-eNB[1-2]UserName=(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBUserName=(.+)$|^\-\-eNB[1-2]UserName=(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBUserName=(.+)$', myArgv, re.IGNORECASE) RAN.eNBUserName=matchReg.group(1) CONTAINERS.eNBUserName=matchReg.group(1) SCA.eNBUserName=matchReg.group(1) PHYSIM.eNBUserName=matchReg.group(1) CLUSTER.eNBUserName=matchReg.group(1) - elif re.match('^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB1UserName=(.+)$', myArgv, re.IGNORECASE) RAN.eNB1UserName=matchReg.group(1) CONTAINERS.eNB1UserName=matchReg.group(1) - elif re.match('^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB2UserName=(.+)$', myArgv, re.IGNORECASE) RAN.eNB2UserName=matchReg.group(1) CONTAINERS.eNB2UserName=matchReg.group(1) - elif re.match('^\-\-eNBPassword=(.+)$|^\-\-eNB[1-2]Password=(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBPassword=(.+)$|^\-\-eNB[1-2]Password=(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBPassword=(.+)$', myArgv, re.IGNORECASE) RAN.eNBPassword=matchReg.group(1) CONTAINERS.eNBPassword=matchReg.group(1) SCA.eNBPassword=matchReg.group(1) PHYSIM.eNBPassword=matchReg.group(1) CLUSTER.eNBPassword=matchReg.group(1) - elif re.match('^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB1Password=(.+)$', myArgv, re.IGNORECASE) RAN.eNB1Password=matchReg.group(1) CONTAINERS.eNB1Password=matchReg.group(1) - elif re.match('^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB2Password=(.+)$', myArgv, re.IGNORECASE) RAN.eNB2Password=matchReg.group(1) CONTAINERS.eNB2Password=matchReg.group(1) - elif re.match('^\-\-eNBSourceCodePath=(.+)$|^\-\-eNB[1-2]SourceCodePath=(.+)$', myArgv, re.IGNORECASE): - if re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNBSourceCodePath=(.+)$|^\-\-eNB[1-2]SourceCodePath=(.+)$', myArgv, re.IGNORECASE): + if re.match(r'^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNBSourceCodePath=(.+)$', myArgv, re.IGNORECASE) RAN.eNBSourceCodePath=matchReg.group(1) CONTAINERS.eNBSourceCodePath=matchReg.group(1) SCA.eNBSourceCodePath=matchReg.group(1) PHYSIM.eNBSourceCodePath=matchReg.group(1) CLUSTER.eNBSourceCodePath=matchReg.group(1) - elif re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB1SourceCodePath=(.+)$', myArgv, re.IGNORECASE) RAN.eNB1SourceCodePath=matchReg.group(1) CONTAINERS.eNB1SourceCodePath=matchReg.group(1) - elif re.match('^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-eNB2SourceCodePath=(.+)$', myArgv, re.IGNORECASE) RAN.eNB2SourceCodePath=matchReg.group(1) CONTAINERS.eNB2SourceCodePath=matchReg.group(1) - elif re.match('^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE): + elif re.match(r'^\-\-EPCIPAddress=(.+)$', myArgv, re.IGNORECASE): print("parameter --EPCIPAddress ignored") - elif re.match('^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE): + elif re.match(r'^\-\-EPCUserName=(.+)$', myArgv, re.IGNORECASE): print("parameter --EPCUserName ignored") - elif re.match('^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE): + elif re.match(r'^\-\-EPCPassword=(.+)$', myArgv, re.IGNORECASE): print("parameter --EPCPassword ignored") - elif re.match('^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE): + elif re.match(r'^\-\-EPCSourceCodePath=(.+)$', myArgv, re.IGNORECASE): print("parameter --EPCSourceCodePath ignored") - elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): + elif re.match(r'^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): print("parameter --EPCType ignored") - elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): + elif re.match(r'^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): print("parameter --EPCContainerPrefix ignored") - elif re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE) CiTestObj.testXMLfiles.append(matchReg.group(1)) HTML.testXMLfiles.append(matchReg.group(1)) HTML.nbTestXMLfiles=HTML.nbTestXMLfiles+1 - elif re.match('^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE): # cleanup + matchReg = re.match(r'^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE) CiTestObj.UEIPAddress = matchReg.group(1) - elif re.match('^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE) CiTestObj.UEUserName = matchReg.group(1) - elif re.match('^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE) CiTestObj.UEPassword = matchReg.group(1) - elif re.match('^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE) CiTestObj.UESourceCodePath = matchReg.group(1) - elif re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE) finalStatus = matchReg.group(1) if ((finalStatus == 'true') or (finalStatus == 'True')): CiTestObj.finalStatus = True - elif re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-OCUserName=(.+)$', myArgv, re.IGNORECASE) PHYSIM.OCUserName = matchReg.group(1) CLUSTER.OCUserName = matchReg.group(1) - elif re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-OCPassword=(.+)$', myArgv, re.IGNORECASE) PHYSIM.OCPassword = matchReg.group(1) CLUSTER.OCPassword = matchReg.group(1) - elif re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-OCProjectName=(.+)$', myArgv, re.IGNORECASE) PHYSIM.OCProjectName = matchReg.group(1) CLUSTER.OCProjectName = matchReg.group(1) - elif re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-OCUrl=(.+)$', myArgv, re.IGNORECASE) CLUSTER.OCUrl = matchReg.group(1) - elif re.match('^\-\-OCRegistry=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-OCRegistry=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-OCRegistry=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-OCRegistry=(.+)$', myArgv, re.IGNORECASE) CLUSTER.OCRegistry = matchReg.group(1) - elif re.match('^\-\-BuildId=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-BuildId=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-BuildId=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-BuildId=(.+)$', myArgv, re.IGNORECASE) RAN.BuildId = matchReg.group(1) - elif re.match('^\-\-FlexRicTag=(.+)$', myArgv, re.IGNORECASE): - matchReg = re.match('^\-\-FlexRicTag=(.+)$', myArgv, re.IGNORECASE) + elif re.match(r'^\-\-FlexRicTag=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match(r'^\-\-FlexRicTag=(.+)$', myArgv, re.IGNORECASE) CONTAINERS.flexricTag = matchReg.group(1) else: HELP.GenericHelp(CONST.Version) From ee3601df5d12eed713327e7711c9af3283b0b1e2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 31 Mar 2025 16:31:01 +0200 Subject: [PATCH 35/35] Fix invalid escape sequence errors in cls_cluster.py The following cases are covered - we have a regex whose escape sequences are not to be evaluated in the string, but given verbatim to the regex engine. Hence, mark them as raw strings. - some are parameters for the cmd.run() call, but the parameters are wrong, so remove that - there is a `\|` that is also to be passed verbatim /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:97: SyntaxWarning: invalid escape sequence '\-' if re.search('buildconfig.build.openshift.io/[a-zA-Z\-0-9]+ created', ret.stdout) is not None: /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:167: SyntaxWarning: invalid escape sequence '\-' result = re.search(f'pod/(?P[a-zA-Z0-9_\-]+) created', ret.stdout) /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:325: SyntaxWarning: invalid escape sequence '\$' self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:385: SyntaxWarning: invalid escape sequence '\$' self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:398: SyntaxWarning: invalid escape sequence '\$' self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:413: SyntaxWarning: invalid escape sequence '\$' self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:429: SyntaxWarning: invalid escape sequence '\|' grep_exp = "\|".join(attemptedImages) /home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:431: SyntaxWarning: invalid escape sequence '\$' self.cmd.run(f'for pod in $(oc get pods | tail -n +2 | awk \'{{print $1}}\'); do oc get pod $pod -o json &>> cmake_targets/log/build_pod_summary.log; done', '\$', 60) --- ci-scripts/cls_cluster.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 67e6253dcc..00cd2fd7ca 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -94,7 +94,7 @@ class Cluster: self._retag_image_statement(name, name, newTag, filename) self.cmd.run(f'oc delete -f {filename}') ret = self.cmd.run(f'oc create -f {filename}') - if re.search('buildconfig.build.openshift.io/[a-zA-Z\-0-9]+ created', ret.stdout) is not None: + if re.search(r'buildconfig.build.openshift.io/[a-zA-Z\-0-9]+ created', ret.stdout) is not None: return True logging.error('error while creating buildconfig: ' + ret.stdout) return False @@ -164,7 +164,7 @@ class Cluster: def _deploy_pod(self, filename, timeout = 120): ret = self.cmd.run(f'oc create -f {filename}') - result = re.search(f'pod/(?P[a-zA-Z0-9_\-]+) created', ret.stdout) + result = re.search(r'pod/(?P[a-zA-Z0-9_\-]+) created', ret.stdout) if result is None: logging.error(f'could not deploy pod: {ret.stdout}') return None @@ -322,7 +322,7 @@ class Cluster: self.cmd.run(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log') self.cmd.run(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log') self.cmd.run(f'oc logs {clang_job} &> cmake_targets/log/oai-clang.log') - self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) + self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log') if status: self._recreate_is_tag('oai-enb', imageTag, 'openshift/oai-enb-is.yaml') @@ -382,7 +382,7 @@ class Cluster: self.cmd.run(f'oc logs {nr_cuup_job} &> cmake_targets/log/oai-nr-cuup.log') self.cmd.run(f'oc logs {lteue_job} &> cmake_targets/log/oai-lte-ue.log') self.cmd.run(f'oc logs {nrue_job} &> cmake_targets/log/oai-nr-ue.log') - self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) + self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log') if status: self._recreate_is_tag('ran-build-fhi72', imageTag, 'openshift/ran-build-fhi72-is.yaml') @@ -395,7 +395,7 @@ class Cluster: if not wait: logging.error('error during build of ranbuildfhi72_job') status = status and wait self.cmd.run(f'oc logs {ranbuildfhi72_job} &> cmake_targets/log/ran-build-fhi72.log') - self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) + self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log') if status: self._recreate_is_tag('oai-gnb-fhi72', imageTag, 'openshift/oai-gnb-fhi72-is.yaml') @@ -410,7 +410,7 @@ class Cluster: status = status and wait # recover logs self.cmd.run(f'oc logs {gnb_fhi72_job} &> cmake_targets/log/oai-gnb-fhi72.log') - self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10) + self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log') # split and analyze logs imageSize = {} @@ -426,9 +426,9 @@ class Cluster: imageSize[image] = f'{sizeMb:.1f} Mbytes (uncompressed: ~{sizeMb*2.5:.1f} Mbytes)' logging.info(f'\u001B[1m{image} size is {imageSize[image]}\u001B[0m') - grep_exp = "\|".join(attemptedImages) + grep_exp = r"\|".join(attemptedImages) self.cmd.run(f'oc get images | grep -e \'{grep_exp}\' &> cmake_targets/log/image_registry.log'); - self.cmd.run(f'for pod in $(oc get pods | tail -n +2 | awk \'{{print $1}}\'); do oc get pod $pod -o json &>> cmake_targets/log/build_pod_summary.log; done', '\$', 60) + self.cmd.run(f'for pod in $(oc get pods | tail -n +2 | awk \'{{print $1}}\'); do oc get pod $pod -o json &>> cmake_targets/log/build_pod_summary.log; done') build_log_name = f'build_log_{self.testCase_id}' cls_containerize.CopyLogsToExecutor(self.cmd, lSourcePath, build_log_name)