From d0aa233aaf73add0a18721c0072f91afe62db84f Mon Sep 17 00:00:00 2001 From: Dhanuja Elizabeth Thomas Date: Mon, 12 Jun 2023 17:11:22 +0200 Subject: [PATCH] Remove PingFromContainer definition and portions where it is called in main.py --- ci-scripts/cls_containerize.py | 56 ---------------------------------- ci-scripts/main.py | 15 --------- ci-scripts/xml_class_list.yml | 1 - 3 files changed, 72 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 520876ad06..813b14ce22 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -1341,62 +1341,6 @@ class Containerize(): HTML.CreateHtmlTestRowQueue(self.pingOptions, 'OK', [message]) - def PingFromContainer(self, HTML, RAN, UE): - myCmd = cls_cmd.LocalCmd() - self.exitStatus = 0 - ymlPath = self.yamlPath[0].split('/') - logPath = '../cmake_targets/log/' + ymlPath[1] - cmd = f'mkdir -p {logPath}' - myCmd.run(cmd, silent=True) - - cmd = f'docker exec {self.pingContName} /bin/bash -c "ping {self.pingOptions}" 2>&1 | tee {logPath}/ping_{HTML.testCase_id}.log' - pingStatus = myCmd.run(cmd, timeout=100, reportNonZero=False) - myCmd.close() - - result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', pingStatus.stdout) - if result is None: - self.PingExit(HTML, RAN, UE, False, 'Packet Loss Not Found') - return - - packetloss = result.group('packetloss') - if float(packetloss) == 100: - self.PingExit(HTML, RAN, UE, False, 'Packet Loss is 100%') - return - - result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', pingStatus.stdout) - if result is None: - self.PingExit(HTML, RAN, UE, False, 'Ping RTT_Min RTT_Avg RTT_Max Not Found!') - return - - rtt_min = result.group('rtt_min') - rtt_avg = result.group('rtt_avg') - rtt_max = result.group('rtt_max') - pal_msg = 'Packet Loss : ' + packetloss + '%' - min_msg = 'RTT(Min) : ' + rtt_min + ' ms' - avg_msg = 'RTT(Avg) : ' + rtt_avg + ' ms' - max_msg = 'RTT(Max) : ' + rtt_max + ' ms' - - message = 'ping result\n' - message += ' ' + pal_msg + '\n' - message += ' ' + min_msg + '\n' - message += ' ' + avg_msg + '\n' - message += ' ' + max_msg + '\n' - packetLossOK = True - if float(packetloss) > float(self.pingLossThreshold): - message += '\nPacket Loss too high' - packetLossOK = False - elif float(packetloss) > 0: - message += '\nPacket Loss is not 0%' - self.PingExit(HTML, RAN, UE, packetLossOK, message) - - if packetLossOK: - logging.debug('\u001B[1;37;44m ping result \u001B[0m') - logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') - logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') - logging.info('\u001B[1m Ping Test PASS\u001B[0m') - def PingExit(self, HTML, RAN, UE, status, message): if status: HTML.CreateHtmlTestRowQueue(self.pingOptions, 'OK', [message]) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 97bc6fbef1..898dfca6d8 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -374,17 +374,6 @@ def GetParametersFromXML(action): if (string_field is not None): CONTAINERS.ran_checkers['u_retx_th'] = [float(x) for x in string_field.split(',')] - elif action == 'PingFromContainer': - string_field = test.findtext('container_name') - if (string_field is not None): - CONTAINERS.pingContName = string_field - string_field = test.findtext('options') - if (string_field is not None): - CONTAINERS.pingOptions = string_field - string_field = test.findtext('loss_threshold') - if (string_field is not None): - CONTAINERS.pingLossThreshold = string_field - elif action == 'IperfFromContainer': string_field = test.findtext('server_container_name') if (string_field is not None): @@ -881,10 +870,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re CONTAINERS.UndeployGenObject(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True - elif action == 'PingFromContainer': - CONTAINERS.PingFromContainer(HTML, RAN, CiTestObj) - if CONTAINERS.exitStatus==1: - RAN.prematureExit = True elif action == 'IperfFromContainer': CONTAINERS.IperfFromContainer(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index 1f7b1afdbe..116ad769c1 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -40,7 +40,6 @@ - Deploy_Run_PhySim - DeployGenObject - UndeployGenObject - - PingFromContainer - IperfFromContainer - StatsFromGenObject - LicenceAndFormattingCheck