Commit 5e1e2769 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): the PCAP file was getting too big

 -- Excluded the 2nd UE container IP address from capture
 -- Also added support for multiple UEs for dlsch_ulsch_stats
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 4869b109
...@@ -723,9 +723,13 @@ class Containerize(): ...@@ -723,9 +723,13 @@ class Containerize():
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"'
networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None: if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None:
# Excluding any traffic from LTE-UE container (192.168.61.30)
# From the trf-gen, keeping only PING traffic
cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"' cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"'
elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None: elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None:
cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"' # Excluding any traffic from NR-UE containers (192.168.71.150 and 192.168.71.151)
# From the ext-dn, keeping only PING traffic
cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not host 192.168.71.151 and not arp and not port 53 and not port 2152 and not port 2153)"'
else: else:
return return
for name in networkNames.split('\n'): for name in networkNames.split('\n'):
...@@ -781,46 +785,48 @@ class Containerize(): ...@@ -781,46 +785,48 @@ class Containerize():
# Analyzing log file(s)! # Analyzing log file(s)!
listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du']
for container in listOfPossibleRanContainers: for container in listOfPossibleRanContainers:
filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' filenames = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log'
cmd = 'ls ' + filename cmd = 'ls ' + filenames
containerStatus = True containerStatus = True
try: try:
lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
filename = str(lsStatus).strip() filenames = str(lsStatus).strip()
except: except:
containerStatus = False containerStatus = False
if not containerStatus: if not containerStatus:
continue continue
logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') for filename in filenames.split('\n'):
logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers) logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m')
if (logStatus < 0): logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers)
fullStatus = False if (logStatus < 0):
self.exitStatus = 1 fullStatus = False
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) self.exitStatus = 1
else: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) else:
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*'] listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*']
for container in listOfPossibleUeContainers: for container in listOfPossibleUeContainers:
filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' filenames = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log'
cmd = 'ls ' + filename cmd = 'ls ' + filenames
containerStatus = True containerStatus = True
try: try:
lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
filename = str(lsStatus).strip() filenames = str(lsStatus).strip()
except: except:
containerStatus = False containerStatus = False
if not containerStatus: if not containerStatus:
continue continue
logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m') for filename in filenames.split('\n'):
logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN) logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m')
if (logStatus < 0): logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN)
fullStatus = False if (logStatus < 0):
HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus) fullStatus = False
else: HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK) else:
HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)
cmd = 'rm ' + self.yamlPath[0] + '/*.log' cmd = 'rm ' + self.yamlPath[0] + '/*.log'
logging.debug(cmd) logging.debug(cmd)
......
...@@ -999,8 +999,18 @@ class RANManagement(): ...@@ -999,8 +999,18 @@ class RANManagement():
for k in keys: for k in keys:
result = re.search(k, line) result = re.search(k, line)
if result is not None: if result is not None:
ue_prefix = 'ue0'
ue_res = re.search('UE ID 1|UE 1:', line)
if ue_res is not None:
ue_prefix = 'ue1'
ue_res = re.search('UE ID 2|UE 2:', line)
if ue_res is not None:
ue_prefix = 'ue2'
ue_res = re.search('UE ID 3|UE 3:', line)
if ue_res is not None:
ue_prefix = 'ue3'
#remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char #remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char
dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip()) dlsch_ulsch_stats[ue_prefix+k]=re.sub(r'^.*\]\s+', r'' , line.rstrip())
#count "problem receiving samples" msg #count "problem receiving samples" msg
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<desc>Deploy Second OAI 5G NR-UE RF sim SA</desc> <desc>Deploy Second OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path> <yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<services>oai-nr-ue2</services> <services>oai-nr-ue2</services>
<nb_healthy>8</nb_healthy> <nb_healthy>9</nb_healthy>
</testCase> </testCase>
<testCase id="020001"> <testCase id="020001">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment